Switch to DuckDuckGo Search
   March 11, 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:22] *** Raystorm has quit IRC
[00:01:00] <SniperFodder> cbeust: Next time I ask about a singleton I want that article, not "Don't use singletons" XD
[00:01:39] *** bitshuffler_ has joined ##java
[00:02:01] <cbeust> SniperFodder: I've been repeatedly saying that singletons are not evil at every opportunity, now I have a link I can refer to :)
[00:02:04] *** gratz|home has quit IRC
[00:02:35] <SniperFodder> lol I asked about singletons, oh idk, a good 3 months back I think. I can't remember. The answer I got was, "Don't use em" and as your article suggested, I was puzzled to say the least.
[00:03:24] *** Charrit has quit IRC
[00:03:48] *** blackswan has joined ##java
[00:03:48] <SniperFodder> Great article. Now only if I can remember what I wanted to use a singleton for...
[00:05:31] <blackswan> how does one pass arguments to a variadic function in JNI? is it actually an array under the hood?
[00:05:43] *** bitshuffler has quit IRC
[00:07:03] <cbeust> SniperFodder: That's exactly why I broke down and decided to put my thoughts together once and for all in a post
[00:07:19] *** yxz97 has quit IRC
[00:08:05] *** Cogito has joined ##java
[00:09:22] *** Sou|cutter has quit IRC
[00:09:37] *** Johannes13 has joined ##java
[00:09:48] *** epalm has joined ##java
[00:10:35] <SniperFodder> I'm grinning like an idiot cause I'm wondering if I used Enum's properly. XD
[00:11:31] *** vipaca has quit IRC
[00:14:28] *** Rissien has quit IRC
[00:14:30] *** aksn has quit IRC
[00:15:39] *** pr3d4t0r has joined ##java
[00:15:59] *** bitshuffler_ has quit IRC
[00:16:14] <blackswan> yes, yes it is. thx.
[00:17:27] *** daark has joined ##java
[00:18:08] *** melow01 has quit IRC
[00:18:12] *** kinks has joined ##java
[00:18:33] *** djbpython has quit IRC
[00:18:51] *** djbpython has joined ##java
[00:19:35] *** tjololo has quit IRC
[00:20:51] *** TheTrash has joined ##java
[00:21:17] *** thevishy has quit IRC
[00:21:44] *** gtrak has quit IRC
[00:21:58] <SniperFodder> out of curiosity, is there a limit to package name sizes? or can you have really long package names like my.package.name.is.so.long.it.hurts.to.look.at.it.and.import.it.*;
[00:22:57] <cbeust> SniperFodder: http://stackoverflow.com/questions/1039029/does-java-have-a-limit-on-the-class-name-length
[00:23:09] <SniperFodder> lol funny, I was just looking at that article
[00:23:11] *** djbpython has quit IRC
[00:23:46] *** Kristen207 has quit IRC
[00:23:54] <SniperFodder> hrm. I'll have to be mindfull of package names then *sigh*
[00:24:09] <cbeust> SniperFodder: I doubt it will ever be a concern
[00:24:42] *** Soliah has quit IRC
[00:24:59] <SniperFodder> Maybe. My package names almost seem irritably long because all my packages start with org.silicateillusion.
[00:27:09] *** Denebola has joined ##java
[00:29:38] *** Cymage has quit IRC
[00:30:27] *** maxorator has quit IRC
[00:31:03] *** Cymage has joined ##java
[00:31:18] *** phantomcircuit has quit IRC
[00:31:21] *** aLeSD has quit IRC
[00:31:49] *** phantomcircuit has joined ##java
[00:31:56] *** jogla has quit IRC
[00:32:01] *** Dux has joined ##java
[00:33:13] *** m_W has quit IRC
[00:38:51] *** eyesUnclouded has joined ##java
[00:39:27] *** davo has quit IRC
[00:43:59] *** GFlam has joined ##java
[00:45:21] *** anaconda has quit IRC
[00:46:23] *** GFlam has left ##java
[00:46:41] *** anaconda_ is now known as anaconda
[00:46:45] *** Sliker has quit IRC
[00:47:16] *** cythrawll has quit IRC
[00:47:20] *** L-----D has joined ##java
[00:47:39] *** ormaaj has quit IRC
[00:48:11] *** Tjololo12 has quit IRC
[00:49:27] *** ormaaj has joined ##java
[00:49:34] *** okiwan has quit IRC
[00:53:28] *** Nikelandjelo has quit IRC
[00:53:40] *** eyesUnclouded has quit IRC
[00:53:44] *** wolfman2000 has joined ##java
[00:54:59] *** BoF has joined ##java
[00:56:45] *** caverdude has joined ##java
[00:56:49] *** wcfs96 has joined ##java
[00:58:27] *** Fuco has quit IRC
[00:59:17] *** fisted has quit IRC
[00:59:48] *** Alkhi has quit IRC
[01:00:30] *** fisted has joined ##java
[01:01:30] *** DerHorst has joined ##java
[01:02:51] *** wolfman2000 has quit IRC
[01:03:39] *** elfrank has joined ##java
[01:03:39] *** Johannes13 has quit IRC
[01:03:44] *** eerie has quit IRC
[01:03:53] *** meling has quit IRC
[01:05:33] *** caverdude has quit IRC
[01:06:36] *** eerie has joined ##java
[01:07:28] <RogueShadow> I've started working with java recently, I was never sure what to name packages. When I finally discovered the convention was using your domain, well I dont' have one. So sad. :/
[01:08:00] <Planck_> If you don't intend to distribute your code for use in other people's apps, it hardly matters.
[01:08:40] <RogueShadow> This is true. I was happy just to understand how package names come about, it bugs me if I don't understand why something is there.
[01:08:48] <Planck_> Domain names just happen to be a useful way to avoid collisions.
[01:09:11] *** rtdos is now known as z80
[01:09:38] *** daark has quit IRC
[01:10:29] *** Fisiu has quit IRC
[01:10:51] <cbeust> RogueShadow: Just grab one at a cheap ISP, it's a few dollars a year
[01:12:09] *** Bombstone has quit IRC
[01:13:31] <Planck_> Of course, the convention does slightly break down in some cases. But it's a useful guideline.
[01:14:06] *** cbeust has quit IRC
[01:14:41] *** guidj0s has joined ##java
[01:15:30] *** plarsen has joined ##java
[01:15:42] *** jor has quit IRC
[01:16:47] *** Wicked has joined ##java
[01:17:32] *** arborist has quit IRC
[01:18:10] *** pipeep has joined ##java
[01:18:14] *** tktiddle has quit IRC
[01:22:13] *** Sou|cutter has joined ##java
[01:22:50] *** alex9999 has quit IRC
[01:23:38] *** Behold has quit IRC
[01:25:24] *** rpaddock has joined ##java
[01:27:15] *** gtrak has joined ##java
[01:28:20] *** BoF has quit IRC
[01:28:26] *** sphenxes has quit IRC
[01:28:42] *** meling has joined ##java
[01:28:51] *** BeholdMyGlory has joined ##java
[01:29:01] *** PelleTut has quit IRC
[01:29:20] *** jdolan has quit IRC
[01:29:48] *** jdolan has joined ##java
[01:32:18] *** rpaddock has left ##java
[01:32:52] *** Soliah has joined ##java
[01:33:46] *** cool123 has quit IRC
[01:34:17] *** wcfs96 has left ##java
[01:35:51] *** Dmole has joined ##java
[01:35:59] *** DerHorst has quit IRC
[01:36:44] <Dmole> anyone know how to use ntlm for a java web server server?
[01:37:11] *** Soliah has quit IRC
[01:39:28] *** jesmon has quit IRC
[01:40:16] *** cbeust has joined ##java
[01:41:23] *** raystorm has joined ##java
[01:42:05] *** bobbytek has joined ##java
[01:45:26] *** pipeep has quit IRC
[01:46:30] <raystorm> I'm refactoring a class for unit testing. It has one public method to "drive" a series of protected methods, which return a value which the "driver" sets to a corresponding read only property. I want to refactor the protected methods to set the property directly instead. However, I'm worried it will hamper readability. Whats the "Best Practice" for this situation?
[01:48:26] *** seicherlbob has joined ##java
[01:49:31] <seicherlbob> hi there! I need to configure a bean via Spring. I need to set a printstream to system.err (or out). how can i referre a bean property to a that stream?
[01:49:49] *** KarlKFI|work has joined ##java
[01:50:16] *** z80 is now known as retrodos
[01:51:28] <cbeust> raystorm: Maybe a small pastebin would help visualize what you're trying to do
[01:52:10] *** zatan has quit IRC
[01:53:32] *** Soliah has joined ##java
[01:53:42] *** kbotnen has quit IRC
[01:56:45] <raystorm> cbeust: http://eugeneciurana.com/pastebin/pastebin.php?show=43944 I have stufff like this.myField=this.calcWhatever(); and I want to just call this.calcWhatever(); I'm just worried about the readability, e.g. knowing that calcWhatever() saves data to this.myField
[01:58:32] *** DJClean has quit IRC
[01:59:19] <seicherlbob> raystorm: i joined in late. whats your question about this paste?
[02:01:08] <raystorm> seicherlbob: I'm updating the class for unit testing, I pasted part of my "driver" method. I want to refactor the methods called by the "driver" to actually save the data they return instead of returning it. I'm just worried about how that will impact readability and what the "Best Practice" is.
[02:01:56] <whaley> raystorm: this.yField=this.calcWhatever() reads better, imo. the way you are proposing means that calcWhatever is responsible for both calculating something & the side effect of altering the state of your object
[02:02:40] <seicherlbob> raystorm: whaley is right. If i were you, i'd call them calcAndSetFoobar() - then its clear
[02:02:58] <seicherlbob> raystorm: imagine, someone reads the outline - your list of methods.
[02:03:36] <seicherlbob> raystorm: then, it would be clear, what calcAndSetX does, but only calcX would not imply that the values are set aswell
[02:04:36] <seicherlbob> But i would rather not let them set any values. it makes them more flexible as you can use them for "test calculations" aswell, without setting the values.
[02:05:46] <seicherlbob> you could also implement static calculation methods - that change no states at all and get all values via parameters - and then write a wrapper method that uses the local fields as parameters. that way you can use the calculation methods "stand alone"
[02:06:12] <seicherlbob> but this depends on the domain and the usecases. just my 2 cent
[02:07:18] *** IamTrying has quit IRC
[02:08:33] <raystorm> well the problem is I have a method CalcResults() which creates an array of all my data. I'm trying to get the class to insert data into some of the fields and there is no way to directly set them, and there shouldn't be since they are calculated fields. but getting the kind of data in there I want is impossible using the driver. What about the impact of adding CalcandsetX as wrapper methods?
[02:09:58] <seicherlbob> so the class you are trying to test has no setters, but you need to set values for the testcases?
[02:11:52] *** BeholdMyGlory has quit IRC
[02:11:54] *** GeorgeBrabazon has joined ##java
[02:12:44] <raystorm> seicherlbob: it has several properties, some are calculated only, some are input by the user, for example eligiblePfd is a flag set by the user to say if they got a PFD this year. If they did CalcPFD returns the value of this years pfd from a properties file, which the driver then stores to a "read only" property PFDAmount
[02:13:40] <raystorm> seicherlbob: the method that returns an array of all the data returns an array of approx 50 elements
[02:14:24] <seicherlbob> and you want to set the PFDAmount?
[02:14:45] *** wrtpeeps has quit IRC
[02:14:54] *** Brewer- has joined ##java
[02:15:03] <Brewer-> http://pastie.org/1657919 Line 49 does not wait for the user to input a value for paymentMethod. Can someone tell me why?
[02:16:15] <raystorm> seichlerbob, I just want to save it, without having to call my driver method, if I can do that, then I can follow the unit testing easier
[02:16:43] <grug> anybody here know much about SNMP? just have a quick question
[02:16:48] <grug> woops wrong channel
[02:16:51] <grug> ignore that :P
[02:17:17] <seicherlbob> raystorm: so you want to "inject" a value into the PDFAmount, without calculating it from the values you mentionend, to go on testing something else?
[02:18:33] <raystorm> seicherlbob: i suppose
[02:19:45] <seicherlbob> Brewer-: no sure, i dont know scanner too well, but maybe the "nextDouble" does not consume the newline and thus the "nextline" only reads this empty EOL. try setting the delimiter for the scanner.
[02:19:55] <seicherlbob> raystorm: hmm....
[02:20:26] <Brewer-> seicherlbob, I changed nextLine to next and it works :)
[02:21:12] <seicherlbob> raystorm: tricky. but you could make the setters protected. not the best way, but this would allow a testcase in the same package to use it but an application (which is usually not in the same package) couldnt use it.
[02:21:29] <seicherlbob> Brewer-: well then. nice. good luck!
[02:22:04] <Brewer-> Thanks :)
[02:22:17] *** tangatools has joined ##java
[02:22:41] *** msieradzki has quit IRC
[02:22:41] *** dangertools has quit IRC
[02:23:16] *** tangatools is now known as dangertools
[02:25:01] <raystorm> seicherlbob: thats what I did to get access to the calcroutines in the first place. (they were originally private.) It looks like the jsp front end doesn't have access, to the protected functions so I think that will work. seicherlbob, thanks
[02:25:09] * raystorm feels like an idiot now
[02:25:23] *** pipeep has joined ##java
[02:25:24] <Brewer-> Part of my assignment: "Provide an "equals" method that accepts a "Month" object as an argument." How do I pass an object to a method as an argument?
[02:26:00] <seicherlbob> Brewer-: what do you think are "arguments"?
[02:26:24] <GeorgeBrabazon> Brewer-: read your text book some more, probably starting at chapter 1
[02:26:39] <seicherlbob> raystorm: no problem. everyone has such days. maybe you should make a brake.
[02:27:21] <raystorm> seicherlbob: its almost 5, Then I get to go Home :)
[02:27:32] *** SniperFodder has quit IRC
[02:27:43] *** realtime has quit IRC
[02:27:48] <seicherlbob> raystorm: its 2:25 AM here... i'll go soon aswell ;)
[02:28:00] <Brewer-> GeorgeBrabazon, learn to not be a douchebag
[02:28:10] <seicherlbob> Brewer-: do you know, what Objects, Classes, arguments, parameters and variables are?
[02:28:16] <Brewer-> Yes, I do
[02:28:34] <Brewer-> When you pass a string object to a method you do myMethod(String myStr)
[02:28:44] <seicherlbob> ok
[02:28:49] <Brewer-> For a Month object, do I just do myMethod(Month myMonth)?
[02:28:51] <GeorgeBrabazon> public boolean equals(Month month){}
[02:28:53] <seicherlbob> so how would you do it with a Month
[02:29:01] <GeorgeBrabazon> correct
[02:29:03] <seicherlbob> 10 points
[02:29:11] <Brewer-> Thats what I was trying to figure out
[02:29:14] <Brewer-> Thank you
[02:29:21] <seicherlbob> YW
[02:32:04] <seicherlbob> Brewer-: btw.: when talking about equality, you should read this: http://www.ibm.com/developerworks/java/library/j-jtp05273.html and you get a + from your teacher, if this is a serious programming class/course
[02:33:24] *** wyvern` has quit IRC
[02:33:29] *** chrome_ has joined ##java
[02:33:34] <Brewer-> This is a first year programming class lol
[02:33:40] <Brewer-> This class is a joke
[02:34:13] <seicherlbob> then you should read this anyway - if you want to become a serious programmer. this is one of the most importaint things to know about object oriented programming.
[02:34:34] <chrome_> hi, I have some words like "youã" "sodç". Is there any method to turn ã into a and ç into c?
[02:35:13] <Brewer-> Will do
[02:35:13] <Brewer-> I only have 20 minutes to finish this assignment though
[02:35:14] <Brewer-> So I'll bookmark it for later! :)
[02:35:31] *** tissue has joined ##java
[02:35:43] <seicherlbob> Brewer-: yw. good luck!
[02:35:58] *** ngochai has quit IRC
[02:36:06] <raystorm> Brewer-: I wish a teacher had gone over stuff like that with me. It's not something I use all the time but it's vitally important especially if you start dealing with saving objects for use later.(for example in a database.)
[02:36:09] <Planck_> chrome_: I had a look around a few months back for such a thing and didn't find anything
[02:36:13] <RogueShadow> hehe, first year programming class. I had a visual basic class called "intro to computer programming" in an electronics course I took. I got 105%, and it was the only class I ever slept in. I did the homework before lab, ie: writing it out by hand in my notebook.
[02:36:34] <chrome_> Planck_: ty
[02:36:44] <seicherlbob> chrome_: if there aren't too many of these characters and you know them, write a mapping and use string.replace or anyhting similar
[02:37:08] <Planck_> There's Normalizer, which gets part way there
[02:38:04] <chrome_> ok I'll check that
[02:38:23] *** wyvern` has joined ##java
[02:39:07] <seicherlbob> ok guys. I gotta go. Have fun everybody!
[02:39:26] *** seicherlbob has left ##java
[02:45:37] *** tilerendering has quit IRC
[02:46:39] *** gtrak has quit IRC
[02:48:39] *** Sdw195 has joined ##java
[02:49:03] *** Sdw195 has left ##java
[02:49:14] *** Cymage has quit IRC
[02:49:16] *** eyesUnclouded has joined ##java
[02:52:05] *** tigger0jk has quit IRC
[02:52:22] *** tigger0jk has joined ##java
[02:52:38] *** Cymage has joined ##java
[02:53:31] *** xiliax has quit IRC
[02:54:38] *** Luc1fel has quit IRC
[02:54:53] *** DroidAgent has quit IRC
[02:58:14] *** matsebc has joined ##java
[02:58:20] *** Kraln has joined ##java
[03:00:37] *** hanstech has quit IRC
[03:03:31] <elfrank> Trying to do the following puzzle with the least number of chars, given a number of test cases "t" and a number "n", have to print out "n-1" say say 3.. print 2 1 0. However, if 0 is enter it should print not possible
[03:03:58] <elfrank> I have it figured out for printing the numbers n-1, but can't get to do the case when n ==0
[03:04:02] <elfrank> http://pastie.org/1658042
[03:04:25] *** Rainier has joined ##java
[03:05:44] <svm_invictvs> elfrank: Do you get extra points for packing as much shit into one line as possible?
[03:06:04] <elfrank> haha yea
[03:06:11] *** chameloid has quit IRC
[03:06:11] *** chameloid has joined ##java
[03:06:17] *** boringwall has joined ##java
[03:06:21] <elfrank> well not points, rather can't submit if its less than 200 bytes
[03:06:56] <svm_invictvs> ....submit for what?
[03:07:05] <svm_invictvs> you meanmore than 100bytes?
[03:07:26] <elfrank> can't submit the puzzle
[03:07:44] <svm_invictvs> er, 200
[03:07:48] <elfrank> more than 200 I meant
[03:07:51] <svm_invictvs> Yeah
[03:08:10] <svm_invictvs> I see when you say least number you mean in terms of code.
[03:08:18] <elfrank> Yea
[03:08:23] <svm_invictvs> So you really do get more points for terseness
[03:08:34] <svm_invictvs> Doe sit have to be java/
[03:08:41] <elfrank> yea
[03:09:12] *** yates has joined ##java
[03:09:50] <Rainier> svm_invictvs, only 18 more questions to go.
[03:09:51] <yates> i'm having a difficult time getting my JNI dlls to load properly
[03:09:51] <elfrank> currently I have about 206, but my printout is not working for when n is 0
[03:10:02] <yates> using Java SE 6/1.6
[03:10:07] <svm_invictvs> heh
[03:10:08] *** Cymage has quit IRC
[03:10:16] *** phantomcircuit has quit IRC
[03:10:25] <svm_invictvs> elfrank: What if you postdecrement x?
[03:10:44] <yates> i'm getting UnsatisfiedLinkError
[03:10:58] <yates> but my dlls are in the system path
[03:11:00] *** mufasis has joined ##java
[03:11:21] <yates> C:/WINDOWS/system32, to be precise
[03:11:27] <elfrank> won't work
[03:11:44] *** psst has quit IRC
[03:11:56] <mufasis> can someone help me real quick, im just learning java
[03:11:58] <mufasis> http://pastebin.com/SWezzvGS
[03:12:10] *** Cymage has joined ##java
[03:12:15] <yates> ojacobson: do you have any more suggestions?
[03:12:19] <mufasis> trying to make a craps simulator but i dont think the loops are working correct or my logic is wrong
[03:12:22] <mufasis> any help would be great
[03:12:40] *** eyesUnclouded has quit IRC
[03:13:10] <Rainier> "Welcome to the Crap simulator" :D
[03:13:26] <yates> has anyone used the "depends" utility to check exported functions and dependencies?
[03:13:35] <yates> of dlls, that is?
[03:13:50] <elfrank> if I postcrement x in the loop, then I would remove it from the print statement, and it won't print 0
[03:13:54] <Rainier> yates, frequent use requires frequent changes.
[03:13:59] <Rainier> ;)
[03:14:04] *** raystorm has quit IRC
[03:14:05] <mufasis> haha
[03:14:09] *** rpaddock has joined ##java
[03:14:14] <yates> Rainier: huh? I don't get you.
[03:14:17] <mufasis> rainier can you help me?
[03:14:23] <rpaddock> Does anyone see anything wrong with this function? http://pastebin.com/GrmFNaQQ
[03:14:27] <Rainier> yates, hint: diapers.
[03:14:57] <yates> Rainier: how about a straight answer instead of riddles?
[03:15:13] <Rainier> yates, I was making a joke.
[03:15:27] <yates> ah!
[03:15:29] <yates> i get it!
[03:15:32] <yates> "depends"
[03:15:33] <yates> ha
[03:15:45] <yates> it's been a long day...
[03:16:07] <Rainier> ~~ mufasis PM
[03:16:07] <javabot> mufasis, pm is use /msg to talk to javabot, but ask other users first. See: http://javachannel.net/wiki/pmwiki.php/FAQ/Pm
[03:16:15] <yates> this UnsatisfiedLinkError is driving me crazy too...
[03:16:25] <Rainier> Also, you should be a little less vague about the problem.
[03:16:35] <mufasis> who me?
[03:16:46] *** eidolon has joined ##java
[03:16:56] <Rainier> "I don't think the loops are working correctly" doesn't really tell us what's happening versus what you want/expect to happen.
[03:17:01] <Rainier> and please stop PMing me.
[03:17:02] *** chrome_ has quit IRC
[03:17:12] <Rainier> Do it again and I won't help at all.
[03:17:46] <mufasis> alright well the output doesnt seem right as its not giving any numbers for how many times ive won/lost etc
[03:18:08] <svm_invictvs> elfrank: *shrug*
[03:18:48] <elfrank> haha, Yea its a shitty problem
[03:19:04] <Rainier> mufasis, not giving any numbers ... what does that mean in terms of output?
[03:19:07] *** wliao has joined ##java
[03:19:26] *** Brewer- has quit IRC
[03:19:42] *** CodeWar has joined ##java
[03:19:54] <mufasis> it means something in the loop is not working as its not counting when its suppost to
[03:20:16] *** rpaddock has left ##java
[03:20:31] <Rainier> mufasis, well the first thing I notice is that you don't reset the firstroll/secondroll between games.
[03:20:44] <Rainier> I bet that's not helping ...
[03:22:29] <Rainier> also, it would make more sense (even if it's less compact) to use braces on your if statements.
[03:23:40] <Rainier> Your expressions are simple enough I can follow the flow, but (and I don't know how to play craps, other than something about magic numbers) there may be logic issues in that you may have wanted an if-elseif-else, not if if-else
[03:23:47] <yates> would some please discuss ideas on the jni dll loading problem?
[03:24:00] *** Dmole has quit IRC
[03:24:12] <Rainier> yates, if people have answers or knowledge they'll try and help.
[03:24:20] <Rainier> If not, they're not going to waste your time.
[03:24:25] <yates> is there anyone here who knows intimately the JVM?
[03:24:30] <yates> Rainier: yeah, ok.
[03:24:45] <yates> is the jvm code open source?
[03:24:57] <yates> that is, is the source available?
[03:25:00] <mufasis> thank you rainier well craps is you roll the dice 7 or 11 on first roll you win 2 3 or 12 you lose, anything else becomes the point and you have to make that number to win
[03:25:02] <Rainier> intimately? you could ask the JVM's prior girlfriends ...
[03:25:19] <elfrank> lol
[03:25:22] <yates> Your wife?
[03:25:24] <mufasis> i have to run my class stars shortly but thank you i will work on it some more hehe, sorry for messaging ya too
[03:25:25] <mufasis> later
[03:25:28] *** mufasis has quit IRC
[03:26:19] <Rainier> Figures. Most people wouldn't build a craps "simulator" just for fun.
[03:26:41] <Rainier> They'd try for something with a bit more of a fun factor to it :P
[03:26:46] *** yates has quit IRC
[03:26:46] <elfrank> Yea, its a typical starting programming assignment
[03:26:58] * Rainier goes to work on his MT4J layout manager :P
[03:27:34] *** DroidAgent has joined ##java
[03:27:37] <Rainier> Laying out "3D" things in a 2D X/Y plane :P
[03:27:51] <Rainier> depth is wasted on this program/me ;)
[03:28:33] *** khasathan has joined ##java
[03:28:33] <Rainier> Unfortunately, the underlying setup doesn't like remote desktop so much. It doesn't send images across and text sometimes gets screwy.
[03:29:28] <Rainier> ultimately though, it's cool.
[03:29:59] <elfrank> what's this for? a game?
[03:31:05] <Rainier> elfrank, nah. something at work was using the framework and I wanted to try something (noted above), so I branched it. They've already got the right bits setup, so far easier than starting from scratch. I don't have anything ubercool beyond the manager in mind.
[03:31:30] <Rainier> we have some nice touch devices too at work if I ever get around to getting an account on those machines.
[03:31:57] <elfrank> nice
[03:32:03] <Rainier> Though I guess MT4J can also do Mac trackpads (laptops) because they have nice multitouch support :) so I could use that too.
[03:33:08] <RogueShadow> no multitouch for me. :( not yet anyway.
[03:33:21] <elfrank> ah cool! didn't know about that framework
[03:33:37] *** devish has joined ##java
[03:33:42] <Rainier> I did have an idea waaay back for a 3D tetris once, but I've not managed a successful tetris in 2D yet, and it would be annoying to play because the center could be blocked by the sides for view.
[03:34:05] *** CodeWar has quit IRC
[03:34:30] *** Matuku has quit IRC
[03:34:31] <Rainier> (in that I don't want top-down like Blockout), some interesting twists would be a the screen flipping (mirror) or upsidedown and all the pieces falling down and resituating.
[03:34:32] <RogueShadow> I made an actual fun to play working tetris once. Took a while, was glad to have finally made something remotely interesting.
[03:34:42] <elfrank> is it not now impossible to release any tetris derivatives ?
[03:35:11] <Rainier> eh, probably no worse than before, I wouldn't know though ...
[03:35:48] <Rainier> RogueShadow, I tried with Canvas (HTML5, using Y!WE though) and got pieces falling and knowing when to stop and left-right movement, some rotation, but I stopped when I had to figure out rotation for pieces that might pass through other blocks to rotate, etc.
[03:35:55] <Rainier> I have completed a nice minesweeper though :P
[03:36:14] <RogueShadow> I only checked to see if the final rotated position fit.
[03:36:16] <Rainier> I guess I'm not a game programmer or at least a very imaginative one. Not my thing so much.
[03:36:26] <Rainier> RogueShadow, I think I thought about that.
[03:36:40] <Rainier> hmm, I wonder if I have pictures of it.
[03:37:11] <RogueShadow> I thinkI have mine, but it was for a small application (created just for me by a friend) using javascript as the scripting language, it was so primitive it was exciting.
[03:37:13] *** homie has quit IRC
[03:37:23] <RogueShadow> No IO at all, draw using only primitives.
[03:37:35] <RogueShadow> I used a series of dots to represent images, stored in an array
[03:37:36] <Rainier> http://asmcbain.net/projects/6 last one, click the preview for a larger one.
[03:37:57] <Rainier> ah, I had Y!WE's Canvas impl, so I could draw all I wanted. Even if I didn't, I could use images, etc.
[03:38:30] <RogueShadow> I also started a platformer game, tile based level
[03:38:32] <RogueShadow> got pretty far
[03:38:59] <RogueShadow> made tiles, then had a map file. all arrays. all drawn with primitives
[03:39:06] <RogueShadow> tile tpes
[03:39:12] <RogueShadow> walking in front/back blocking/nonblocking
[03:39:30] <elfrank> looks cool
[03:39:48] <Rainier> elfrank, yeah, Canvas has nice gradient support :) CSS does now too.
[03:40:28] <Rainier> I used the new box-shadow to create a "cut out" effect for the empty tile on an HTML/JS sliding tile puzzle.
[03:40:37] <RogueShadow> Canvas seems a reasonable way to do a lot of things now.
[03:41:13] <Rainier> It's nice that it's simple too.
[03:41:29] <Rainier> Took me forever to find out Graphics2D supported much of the same stuff.
[03:41:34] <RogueShadow> I've been looking at Slick as a good way to do a lot of simple games or even complex one's in java.
[03:42:08] <Rainier> RogueShadow, wait until full adoption of WebGL
[03:42:09] <Rainier> :)
[03:42:38] <RogueShadow> Yeah, then it'll be a better option, assuming you want in browser stuff. as I hear applets are not really suggested anymore.
[03:42:45] *** jbwiv has joined ##java
[03:42:45] <Rainier> I hate them.
[03:42:56] <Rainier> I swear people use them still because they like to torture their developers.
[03:43:00] *** Ochikobore has joined ##java
[03:43:09] <RogueShadow> haha, I haven't seen an applet in a long time unless I went looking.
[03:43:12] <RogueShadow> I think they give java a bad rep
[03:43:17] <RogueShadow> More than anything else
[03:43:24] <Rainier> I have a current project that will eventually have to have an applet face.
[03:43:36] <Rainier> Fortunately for me, it will have an edit button and that pops out a real window.
[03:43:45] <Rainier> Which defeats the purpose, but means I limit my exposure.
[03:44:42] <Rainier> I know one project using them because they can share code, even though one of (or the) deployment envivronment has issues with them because they're always on top of everything.
[03:45:29] *** gh0st has joined ##java
[03:45:37] <Rainier> Sometimes the best solution is not achieved through dedup. Do it when it makes sense, otherwise you're just asking for trouble.
[03:46:35] <RogueShadow> I have only been into java a couple weeks, I haven't made any apps available anywhere except my netbeans projects folder. Haven't gotten around to reading about distribution methods.
[03:46:37] <Rainier> Untarnished shared A will eventually need to support and know it's currently being used in spot B, which may require more and different behavior over time ... who wants to manage that and ensure it doesn't break for the original environment? :(
[03:47:18] <Rainier> RogueShadow, JARs, bundles (Mac), or WebStart are the way to go.
[03:47:42] <RogueShadow> Yeah, webstart seems underated for sure. It's like instant install.
[03:47:54] <Rainier> Mac bundles are nice because you can hide a lot of stuff in what appears to be a single file with complete FS access :) and you can have a program icon that way.
[03:48:06] <Rainier> All sorts of goodness there.
[03:48:38] <RogueShadow> The only thing about Webstart I don't like is.. well it's kinda an installer, but who knew it was installing anything?
[03:49:00] *** ormaaj has quit IRC
[03:49:02] <Rainier> well, I think only on Windows does it truly install anything beyond saving program preferences.
[03:49:16] <Rainier> Which is annoying, and I think they may have changed that past XP? I don't know ...
[03:49:24] <RogueShadow> I was surprised to find uninstall entries for webstart things I oepned
[03:49:27] <RogueShadow> I didn't know about it
[03:49:35] <RogueShadow> I'm on windows 7
[03:49:47] <Rainier> oh, then I guess it still happens. Strange stuff.
[03:49:51] <RogueShadow> A simple demo app should just startup and go away, leaving nothing behind.
[03:49:55] <RogueShadow> It's totally weird.
[03:50:12] <Rainier> Probably their way of keeping something that knows what keys to remove, since if they use Preferences it gets stored in the registry.
[03:50:53] <Rainier> I'm sure there's more reasons for why than that, but *shrug*.
[03:51:16] <Rainier> It's not really WebStart's fault or problem that people make "useless" demo apps that get installed.
[03:51:20] <Rainier> just to run once
[03:51:22] *** ormaaj has joined ##java
[03:51:42] <RogueShadow> I haven't gotten to reading webstart info yet, but when I do maybe I'll understand why this happens more.
[03:52:07] <Rainier> It probably won't say ... I wouldn't worry to much I guess unless it really bothers you.
[03:52:29] <RogueShadow> It just feels really invasive, you know, like googles invisible auto updater
[03:52:37] <RogueShadow> But not as bad lol
[03:52:50] <Rainier> hehe, my AV caught that. I uninstalled Chrome shortly thereafter.
[03:53:02] <Rainier> I didn't like the browser anyway.
[03:53:18] <RogueShadow> For a browser with isolated tabs the whole thing sure crashed often enough.
[03:53:38] <RogueShadow> I can open a hundred tabs on firefox and not lose responsiveness, it's fine.
[03:53:46] *** gelignite has quit IRC
[03:53:48] *** Ochikobore has left ##java
[03:53:56] <Rainier> Some people at work with advanced versions (I think?) on Macs had the entire Mac lock up because some display thing would just loop on occasion.
[03:53:56] <RogueShadow> and I get noscript
[03:54:18] <Rainier> eh, my only dig against Fx is that on my XP box it takes a long time to start.
[03:54:44] <Rainier> but I must say having the plugins crash and not taking down the browser is nice. Flash no longer takes down Firefox with it.
[03:55:43] <RogueShadow> Since I switched to windows 7 things seem more responsive. I often use linux also, but I play a lot of games on occasion and it's bothersome to switch, also wifi adapter troubles prevail often.
[03:55:45] <elfrank> FF4 is getting much faster though
[03:56:12] <Rainier> RogueShadow, WINE doesn't run everything? Shock! ;P
[03:56:18] <elfrank> compared to 3.x.x that is
[03:56:27] <Rainier> I hope so.
[03:56:58] <RogueShadow> Not games
[03:57:16] <RogueShadow> Well, I got world of warcraft running fine before, but I don't even play that anymore.
[03:57:23] <RogueShadow> Most of the games I play are on steam or so.
[03:57:27] <cbeust> RogueShadow: Hence your irc nickname? :)
[03:57:28] <RogueShadow> It's just a lot of bother
[03:57:31] <RogueShadow> No
[03:57:33] *** khasathan has left ##java
[03:57:40] <RogueShadow> I made this name up a long tiem before wow
[03:57:46] <Rainier> Steam is nice.
[03:57:53] <RogueShadow> I also played EverQuest, but that wasn't it either lol
[03:58:33] <Rainier> I'm surprisingly free of subscription based games and additions :P but I'm equally as weird as those folks for spending that time instead coding ;)
[03:58:58] <RogueShadow> I don't play any games with a subscription anymore, takes too much time.
[03:59:11] <RogueShadow> I play EQ2 Extended sometimes as it's free.
[04:00:14] <Rainier> I just don't quite get the point of all the leveling and acquiring of stuff. You pay them money for something you don't even really own, can't take outside anywhere, and means absolutely nothing outside of the context of their garden.
[04:00:43] <elfrank> its more of a competitive thing. People want to be better than others haha
[04:00:54] <RogueShadow> You have a great point. :)
[04:01:17] *** jdolan has quit IRC
[04:01:31] *** BSWolf has joined ##java
[04:01:39] <RogueShadow> I play mmo's at all, for the multiplayer part of it, what else is there? lol
[04:01:47] <Rainier> elfrank, better being finding all the people that logged off leaving their character standing in a field open to attack? :P (I have no idea if this is realistic, since I've never played)
[04:02:08] <RogueShadow> It's just AMAZING to me how many people play mmo's and complain they can't solo.
[04:02:12] <RogueShadow> It's like. over half I think
[04:02:26] <RogueShadow> So they get so ridiculously easy, it's not worth playing anymore.
[04:02:27] <Rainier> RogueShadow, well it's certainly not for the food or great entertainment aspects ...
[04:02:32] <RogueShadow> lol
[04:02:39] <elfrank> lol
[04:03:18] * Rainier reaches into the screen and grabs a loaf of bread: Stop thief! You have broken the law ...
[04:03:31] <elfrank> haha
[04:03:32] <RogueShadow> There is something exciting about playing an mmo, with a group of people, not solo. And only when it's actually challenging, which rules out all current mmo's lol. I know ultimatly it wasn't "real" but it was fun.
[04:04:18] <elfrank> its just a way of getting out of reality for some people. Forget about work, you're just an avatar walking around haha
[04:04:37] <RogueShadow> Escape is definitely a part of it, and not a good thing haha.
[04:04:38] <Rainier> Here's the funny thing, the Myst series was (until about half way through) all pre-generated, there was almost no one to interact with inside the worlds, and yet so many people have played at least one in the series and found it to be extremely enjoyable ...
[04:04:41] <elfrank> I played a mmo for a long time, becomes addictive
[04:04:56] <Rainier> and you didn't even get to see your character until Uru (if you count that one)
[04:05:32] <RogueShadow> There are a lot of good single player games if you want immersion and a good game by yourself. But why do people flock to an mmo to play by themselves?
[04:05:36] <Rainier> definitely more out for the playability and entertainment factor than "wowzer best graphics"
[04:05:55] <Rainier> RogueShadow, who knows ...
[04:06:05] <elfrank> to meet others haha
[04:06:30] <cbeust> Rainier: you're missing the fun part of it
[04:06:40] <Rainier> RogueShadow, I dunno, people play Minecraft ;) there are just some unexplainable things ...
[04:06:51] <RogueShadow> lol, I play minecraft sometimes.
[04:06:58] <Rainier> cbeust, which comment were you referring too?
[04:07:05] <RogueShadow> I play it in multiplayer, for the social aspect.
[04:07:14] *** AliasWeird[v1] has joined ##java
[04:07:15] <cbeust> Minecraft is pretty addictive too, and it's almost on topic for this channel
[04:07:29] <cbeust> Rainier: I was commenting on you not getting the point in acquiring things you don't really own
[04:07:32] <Rainier> yeah, that's one of the cool things.
[04:07:37] <Rainier> cbeust, oh.
[04:07:45] <Rainier> well some people do trade in futures ;)
[04:08:03] <RogueShadow> Playing minecraft in singleplayer I just stopped doing after it was viable to play online, if you can't share your experiences it just seems pointless.
[04:08:07] <elfrank> Micrecraft is so imaginative... nice work by the developers
[04:08:26] <cbeust> Developer, just one.
[04:08:29] *** AliasWeird[v1] has left ##java
[04:08:33] <RogueShadow> Not anymore
[04:08:34] <cbeust> Well, more now but until recently, it was just Markus
[04:08:39] <elfrank> even more impresive
[04:08:41] <Rainier> elfrank, I think they achieved the right balance of minimalism and enjoyment.
[04:08:55] <Rainier> You'd probably admit it's simple, yet people really like playing it.
[04:08:57] *** phantomcircuit has joined ##java
[04:09:49] <RogueShadow> Anyway, I'm learning java to get away from another game :p the game that helped me learn to code. makes me sad it's so pathetic.
[04:09:49] <Rainier> Altitude is also in Java if you've ever played that.
[04:09:55] <Rainier> That one is all multiplayer oriented.
[04:10:11] <Rainier> It's also good.
[04:10:42] <RogueShadow> oh, I played a demo of that I think
[04:11:16] <Rainier> well learning Java is a good thing, it's a gateway to other languages and such if you let yourself.
[04:11:35] <RogueShadow> I picked Java because it's capable of such a wide variety of things.
[04:11:40] <RogueShadow> And it's plenty powerful enough.
[04:11:43] <Rainier> It's a very nice hammer.
[04:12:02] <RogueShadow> Like the swiss army knife of programming, well maybe.
[04:12:05] <Rainier> It's also very good at helping people craft even more elegent hammers.
[04:12:26] <cbeust> Java is a meta hammer.
[04:12:27] <RogueShadow> Every coder I ever respected that I got to know said I have talent, I should persue it.
[04:13:30] <RogueShadow> I took a course in electronics with a intro to comp programming class in it. It's my favorite thing to mention.. I got 105%
[04:13:34] <RogueShadow> literally
[04:14:53] <elfrank> nice
[04:14:58] <RogueShadow> 1. Slept in class a few times 2. Wrote out the programs in pencil during class 3. Spent lab helping others, and working on much more advanced programs. 4. Due to previous I convinced him to give me 5% extra credit.
[04:15:17] <Rainier> heh
[04:15:24] <Rainier> Helping others is always a cool thing.
[04:15:32] <Rainier> and working on your own stuff is always nice.
[04:15:33] *** dgreen has joined ##java
[04:15:35] <RogueShadow> I enjoy that quite a bit.
[04:16:02] <Rainier> I got a professor to change the requirements for a future assignment because it was based on the one before it and I overachieved :P
[04:16:12] <RogueShadow> Helping people is a good way to re-enforce the knowledge you've already gained. Keep the basics sharp.
[04:16:30] <dgreen> I would appreciate any feedback on my XML databinding/webservices implementation for the Gosu JVM-based programming language - http://gosu-lang.org/xml/introxml/index.html
[04:16:35] <Rainier> I think I got called at least twice on my all-but-useless land-line in college to come down to lower campus to help someone out :P
[04:16:48] <RogueShadow> lol, yeah I kinda did the mid-term for that class way ahead of time and didn't realize it.
[04:17:27] *** wolfman2000 has joined ##java
[04:17:36] <RogueShadow> But it wasn't a very serious class, the teacher was just a fill-in because it wasn't needed to have an actual programmer who knew it well.
[04:17:52] <RogueShadow> Just enough to cover what was in the class, he couldn't answer my questions.
[04:17:55] <Rainier> RogueShadow, the program was battle ship and the first program's reqs said it didn't need to have a GUI. Most people went with JOptionPanes and other stuff and I said "that's fraught with dumb inputs and stupid validation" so I wrote a real Swing GUI at the time I wasn't as good as I was now, so it was *all* drawn, even bits that were better off some other way, but it worked.
[04:17:59] *** devish has quit IRC
[04:18:21] <RogueShadow> cool
[04:18:23] <Rainier> The next assignment was to make a battle-ship GUI, but we had to use JButtons in a grid :P
[04:18:47] <Rainier> now, if the AI didn't cheat ...
[04:18:48] <RogueShadow> ah
[04:19:10] <RogueShadow> I haven't read about Swing yet, as I was first going to start with making games with slick.
[04:19:19] <Rainier> Somehow my project partner and I couldn't work out why code that prevented a human from placing things in invalid places allowed the AI to do it :(
[04:19:48] <Rainier> No ships overlapped, but it could place them partially off the grid, made it impossible to win.
[04:19:58] <RogueShadow> aw, sad.
[04:20:33] <Rainier> heh, yeah, but it was still fun. I could probably do it now and right, but then again now I'm not constrained by having to have a sorta pattern, and I know much more.
[04:20:59] <RogueShadow> I'm loving having the new problems of the best way to do something, instead of how the heck can I do this at all!
[04:21:06] <Rainier> classes after us got to do break-out.
[04:21:17] <Rainier> :)
[04:21:19] <RogueShadow> after switching from that evil game that sucked me in
[04:22:03] <paissad> i would like to convert an int/long (226) for example to 3:46
[04:22:03] <paissad> is there an utility that do that kind of job or do i have to hard code it ?
[04:22:06] <Rainier> Always challenge yourself, you might seem to have reached a plateau at some point, but if you're always stretching you'll find out its short.
[04:22:22] <Rainier> paissad, SimpleDateFormat?
[04:22:28] <paissad> it not really hard to code, but i don't really want to reinvent the wheel
[04:22:44] <paissad> Rainier, ok i take a look
[04:22:44] <Rainier> feed the long into a Date instance, then feed that Date instance into a SimpleDateFormat with a pattern for what you want out.
[04:22:59] <Rainier> assuming that output is what I think it is (Date/Time)
[04:23:37] <paissad> oh, i just want to make more human readable the duration of some soundtracks ^^
[04:23:48] <Rainier> then that would probably be fine.
[04:23:55] <paissad> ok thanks
[04:24:22] <RogueShadow> You know, for as many people are in here, it's not very active at the moment.
[04:24:37] <Rainier> It just depends on the time, day, and number of people with actual questions.
[04:25:22] <Rainier> hmm, the Eclipse setting to automatically add missing @Override is nice.
[04:25:24] <elfrank> later guys
[04:25:28] <Rainier> seeya
[04:25:37] *** elfrank has quit IRC
[04:26:00] <RogueShadow> Somehow I ended up deciding to use netbeans. hmm.
[04:26:08] <Rainier> It doesn't really matter.
[04:26:10] <RogueShadow> Seems good, but there's a lot about it to learn
[04:26:19] <RogueShadow> Seems as hard to learn java as netbeans
[04:26:24] <RogueShadow> ... well harder
[04:26:27] <Rainier> I've been told the Eclipse debugger is nicer than other IDEs, but really just get good at something.
[04:26:31] <dgreen> IntelliJ is pretty amazing.. I used eclipse for a decade then joined a company that used IntelliJ
[04:26:34] <Rainier> Well you can start (and I recommend starting) at a lower level.
[04:26:42] <Rainier> Just command line compiling, etc.
[04:26:56] <Rainier> It does get tedious after a while, but then it might be time to try out an IDE again.
[04:27:43] <Rainier> dgreen, you'll find a quite a few regulars in here who'd agree with you.
[04:28:01] * Rainier doesn't care either way, use what makes you most productive.
[04:28:05] <dgreen> first thing i did at the new company was try to get their 6M lines of code project working in eclipse, fail
[04:28:25] *** eyesUnclouded has joined ##java
[04:28:33] <cbeust> dgreen: there are plenty of techniques to make Eclipse work on huge code bases
[04:29:10] <dgreen> it did eventually work, but it was laggy, never quite worked right
[04:29:26] <cbeust> dgreen: Eclipse works fine on the Google code base, just to give you an idea :)
[04:30:39] *** chandan_kumar has joined ##java
[04:31:01] <cbeust> Anyway, you can't go wrong with either Eclipse or IDEA. Using anything else to write Java is counter productive
[04:31:44] *** chandan_kumar has quit IRC
[04:32:19] *** chandan_kumar has joined ##java
[04:32:33] <dgreen> cbeust: ++
[04:32:37] <RogueShadow> o.O I'm going with "just get good at using 'something'" Although in truth it isn't too late for me to switch around IDE's a bit, I haven't really written anything at all yet.
[04:33:21] <surial> If it's 6M lines of highly interconnected code (read: mess o' spaghetti) then eclipse will be a tad slow. Note that while eclipse tends to call its own parsers way too frequently, its parser is at least 15x faster as the competition.
[04:33:34] <dgreen> yes spahetti... horrible
[04:33:44] <surial> ('way too frequently' is about 2 to 3x more than needed).
[04:33:45] <Rainier> surial, it balances out! :)
[04:33:50] <dgreen> yes the ejc compiler is great
[04:33:57] <surial> So, you still get a 5x margin.
[04:34:05] <dgreen> we tried it and it wasn't 100% standards compliant (you find out quickly on a 6M line codebase)
[04:34:13] <dgreen> so the build guy went back to javac
[04:34:17] <cbeust> RogueShadow: if you haven't settled on anything yet, then pick Eclipse or IDEA because you will have to learn one of these in your career (maybe even both)
[04:34:24] <dgreen> but it was much faster
[04:34:33] <Rainier> dgreen, you sure about that? I think it may do things a little differently, but it does follow the spec.
[04:34:37] <surial> The ecj compiler is the worst piece of shit I've ever laid my eyes upon. The source that is. This idiotic mess of generated and hand-rolled lunacy runs great. Guy maintaining it must be a minor deity.
[04:34:40] <dgreen> generics are hard
[04:34:47] <RogueShadow> I was under the impression netbeans was getting a lot better from my googling o.O
[04:34:49] <cbeust> dgreen: yeah occasionally the Eclipse compiler disagrees with javac and I find that most of the time, javac is right. But it's very, very rare
[04:34:59] <surial> Deja vu.
[04:35:16] <cbeust> RogueShadow: it's not about whether it's getting better, it's just that NetBeans is a minor player that will never catch up. Hardly anyone uses it compared to Eclipse/IDEA
[04:35:32] <Rainier> surial, I'm sure the guy will get recognized for his status long after he's gone and they have to make a major change to it :P
[04:35:39] <dgreen> it wasn't producing the same output as javac, it was generating errors when javac wasn't... the build guy should have fixed those issues and made it work, but it didn't happen
[04:35:52] <dgreen> *he
[04:35:57] <surial> Rainier: I am making major changes to it. No longer than 2 hours a day or I'll just jump right out the window.
[04:36:19] <Rainier> haha
[04:36:31] <dgreen> we have a build completing in 3 minutes now on our autobuilds using javac, he parallellized the modules, so all is good... used to take 30+ minutes
[04:36:44] <surial> RogueShadow: Oracle's recent treatment of netbeans _really_ isn't helping it catch up, either. As sad as it is to admit this (as it had a bunch of really great stuff going for it), I concur: IntelliJ and Eclipse. For now. Keep an eye out, the netbeans team is still hard at work. Technically Netbeans is great. The marketing bit is the problem.
[04:36:47] *** pt108 has joined ##java
[04:36:47] <RogueShadow> cbeust, That is a very good point. I appreciate the input. I can only presume (as you seem to be) experienced in the area and knowledgable about manh companies practicies.
[04:36:48] * Rainier puts a trampoline outside of surial's window.
[04:37:13] <Rainier> ~project lombok
[04:37:14] <javabot> Rainier, what does that even *mean*?
[04:37:18] <Rainier> ~lombok
[04:37:18] <javabot> Rainier, lombok is a compiler plugin that removes boilerplate. It can for example generate getters, setters, equals, and hashCode. It can also take care of resource management for you. Works in eclipse, netbeans, javac, maven, ant, and most other tools, but not IntelliJ IDEA. See http://projectlombok.org/ for a video showing exactly what it can do. Free, Open Source.
[04:37:19] <surial> ~projectlombok
[04:37:19] <javabot> surial, lombok is a compiler plugin that removes boilerplate. It can for example generate getters, setters, equals, and hashCode. It can also take care of resource management for you. Works in eclipse, netbeans, javac, maven, ant, and most other tools, but not IntelliJ IDEA. See http://projectlombok.org/ for a video showing exactly what it can do. Free, Open Source.
[04:37:32] <Rainier> That's just one of his things :)
[04:37:38] <dgreen> lol
[04:37:39] <cbeust> To make it worse, Oracle hasn't exactly been clear on where they want to take NetBeans, especially since it competes with their own IDE.
[04:37:55] <Rainier> cbeust, the one that's way past its prime/time?
[04:38:09] <dgreen> so you know jaxb, xmlbeans
[04:38:12] <RogueShadow> I have heard worrysome rumors about oracle and java in general not being in thier best interest in the future.
[04:38:13] <surial> Rainier: Yah, that one.
[04:38:32] <cbeust> Rainier: no question that JDeveloper is the worst of all fours, but Oracle certainly has some interest in trying to keep pushing it
[04:38:35] <surial> RogueShadow: That's a rather obviously dumb rumour. Oracle _BOUGHT_ sun and they really didn't do it for their hardware division.
[04:38:46] <dgreen> not sure if anyone cares about xml, but i spent the last 3 years making a new xml databinding and webservices framework, its free and open source and part of gosu, a programming language... if anyone is interested http://gosu-lang.org/xml/introxml/index.html
[04:38:48] <Rainier> I agree with that, plus there's also the OpenJDK.
[04:38:52] <paissad> Rainier, System.out.println(
[04:38:52] <paissad> new SimpleDateFormat("HH:mm:ss").format(
[04:38:52] <paissad> new Date(329)));
[04:39:04] <Rainier> paissad, argh. use a pastebin?
[04:39:05] <surial> paissad: Christ. Use pastebon!
[04:39:07] <cbeust> The only reason Oracle bought Sun is to sue Google.
[04:39:29] <paissad> yeap sorry, not more that 2 lines ^^
[04:39:32] <paissad> than*
[04:39:36] <surial> Heh. I doubt it, but they're really running with that. Headlong in a wall hopefully.
[04:39:39] <Rainier> paissad, if you intend to use it often, I'd store a version of the SimpleDateFormat.
[04:39:41] <surial> No more than 1 line.
[04:39:45] <Rainier> rather than creating and calling like that.
[04:39:58] <surial> Ah, just create and call. What's the problem?
[04:40:17] <Rainier> I suppose nothing.
[04:40:38] <Rainier> It doesn't have a warning about efficiency of doing so, unlike things such as XStream :P
[04:40:39] <paissad> Rainier, i show that example, but that does not produces what i expected , ... i have "01:00:00"
[04:40:41] <cheeser> cbeust: you know better than that.
[04:40:42] <cheeser> 8^)=
[04:40:59] <paissad> instead of "00:05:29"
[04:40:59] <surial> cbeust: Has that copyright issue been sorted yet? Last I heard that was a big red herring and effectively a loss for oracle, but, maybe that's got a bit too much wishful thinking mixed in.
[04:41:10] <cbeust> surial: We'll know in a couple of years.
[04:41:12] <cheeser> it's not a copyright case
[04:41:16] <cheeser> primarily at least.
[04:41:19] <surial> paissad: Check out the constructor for Date.
[04:41:35] <surial> cheeser: No, but there was a copyright rider in the primarily patents-based case that needed to be cleared up too.
[04:41:39] <surial> ~~ paissad javadoc Date
[04:41:41] <javabot> paissad: http://is.gd/zmTeb6 [JDK: java.sql.Date]; http://is.gd/iCeC6y [JDK: java.util.Date]
[04:41:42] * cheeser nods.
[04:41:42] <surial> Read and ye shall understand.
[04:41:50] *** quest88 has joined ##java
[04:42:13] * surial really thought new Date(X) would set year and not epoch millis. Whoops.
[04:42:24] <paissad> surial, i do understand ... i just did not pay enough attention, i'm tired, i should go to bed ^^
[04:42:27] <Rainier> They'll eventually settle it like adults. *snort*
[04:42:31] *** teralaser has quit IRC
[04:42:35] <surial> paissad: Nevertheless, it's milliseconds.
[04:42:35] <paissad> stupid question btw
[04:42:46] <Rainier> paissad, so just mult by 1000 :P
[04:42:52] <surial> paissad: So, your date represents 329 milliseconds after new year's, 1970.
[04:42:56] <dgreen> so my idea was, every xml databinding out there makes you choose the choice before filling the choice... i removed the schema-specific portions of logic... so you get a view of what the xml should look like rather than what the schema looks like... which involves a sorting algorithm... does anyone know what i'm talking about? =)
[04:43:18] <surial> dgreen: To be fair, whenever I hear "XML floobargle" I tune right out.
[04:43:22] <Rainier> "choose the choice before filling the choice" ...
[04:43:27] <dgreen> surial: awesome
[04:43:44] <surial> dgreen: No offense intended of course.
[04:43:44] <paissad> surial, actually, i knew .. thanks
[04:43:44] <paissad> as i said, i did not focused on what i was doing
[04:44:01] <surial> paissad: Drink some beer.
[04:44:06] <surial> ~~ paissad ballmer peak
[04:44:06] <javabot> paissad, http://xkcd.com/323/
[04:44:06] <paissad> lol :)
[04:44:15] <Rainier> ~~beer paissad
[04:44:15] <javabot> The user beer is not on ##java
[04:44:18] <surial> Unless you're already quite drunk, in which case you might have overshot.
[04:44:22] <Rainier> ~~paissad beer
[04:44:22] <javabot> hands paissad a tall, cold, dark beer.
[04:44:35] <paissad> you're really funny, lool
[04:44:41] *** eyesUnclouded has quit IRC
[04:44:41] <paissad> i never drink :s
[04:44:50] <surial> Actually, that's Randall Munroe and not me.
[04:44:56] <ianp> how can i reasonably determine how much heap space i should allow on a machine programmatically by looking at the operating systems total memory / free memory / committed vmem and swap size?
[04:45:00] <paissad> i never did, not even once ^^
[04:45:01] <Rainier> I've heard of people who get quite sloshed and write code that's somehow impeccable the next morning.
[04:45:08] <surial> ianp: Is it a dedicated box?
[04:45:09] <paissad> maybe i should, haha
[04:45:13] <ianp> surial: yeah
[04:45:17] <surial> paissad: This is ##java. Not ##teetotallers
[04:45:19] <dgreen> ianp: -Xmx1500m
[04:45:23] <surial> Ianp: Is it windows?
[04:45:29] <ianp> surial: although I plan to allocate something like max*.8 ...
[04:45:31] <ianp> for breathing room
[04:45:42] <ianp> surial: of course not ... ;) but i'd liketo know for windows too
[04:45:55] *** pt108 has left ##java
[04:45:59] <ianp> cause actually i would also like to provision windows servers too
[04:46:06] <surial> ianp: Well, on various windows versions (and with the 18 bajillion 'home office premium whatever' versions, FUCK if I know which ones), you're limited to 3GB max or so. XP certainly.
[04:46:09] <Rainier> I prefer to think of it more from the Douglass Adams perspective: you tend to remember things done while under only when you've re-consumed a similar quantity, such is the reason why you don't remember what you did the next morning and why people are angry at you ...
[04:46:14] <ianp> and what im doing is writing a distributed scheduler
[04:46:16] <ianp> no, i mean...
[04:46:18] <ianp> total OS memory
[04:46:26] <surial> ianp: A thing or two also depends on whether you're on 64-bit mode or not and whether compressedOOPS is on. Particularly if you want to go above ~ 3.5GB.
[04:46:26] <ianp> not for one JVM
[04:46:29] <RogueShadow> haha, now I regret saying how quiet it was!
[04:46:37] <ianp> like, I am going to have estimates for each process's max heap
[04:46:54] <ianp> i need to figure out what's the maximum amount of heap at any time i can give to a sum of JVMs on that box
[04:47:03] <surial> ianp: There's more to memory than just heap. For example, if each thread needs about 256k of stack, and you want 5000 threads, well, do the math.
[04:47:15] <ianp> surial: very true
[04:47:15] <surial> ianp: That's over a gig of stack.
[04:47:19] <ianp> good point
[04:47:40] <ianp> surial: actually many of those processes will be at 10-20G +
[04:47:58] <surial> ianp: Memory load of a JVM is appromixately base load (small) + permgen (50M or so?) + heap (-Xmx and -Xms) + threads * stack (-Xss)
[04:48:12] <ianp> Ah, yes...
[04:48:20] <ianp> good point
[04:48:34] <ianp> i was just going to fudge it since my heap sizes are monstrous
[04:48:35] <surial> ianp: So we're definitely talking about a full 64-bit JVM then. A 32-bit VM can obviously not eat more than 4GB max. COOPS can quadruple that to 16, in theory, but you won't quite get that far.
[04:49:01] <ianp> surial: of course, must be 64 bit (for >3-4G)
[04:49:41] <ianp> i realize that... just trying to think of how to write my algorithm to decide what a box can take at any given time
[04:49:46] <surial> Well, no, COOPS can get you 16GB on a 32-bit VM. ish. Part of it is 64 of course. (Compressed Oops packs up pointers so they're all sequential even though on a normal VM they are all evenly divisible by 4. Effectively a pointer with value 5 is really pointing at memory address 5*4 = 20).
[04:50:10] <ianp> presuming that queued jobs in the cloud will request their own max heap.
[04:50:37] <ianp> really? wow
[04:50:41] <surial> ianp: Any idea how many threads we're looking at, ballpark? If you know, take max memory, drop down ~600MB for overhead, then stack size * absolute max threads down from there, the rest is for the JVM.
[04:51:04] <ianp> surial: Many apps are single threaded, but some are a few threads. so, quite low thread count overall.
[04:51:33] <ianp> yeah, sounds about what I wanted to do
[04:51:36] <surial> ianp: COOPS saves quite a bit of memory, as on a full 64-bit JVM every value is 64-bit (including shorts, bytes, and most notably ints), and all pointers take up 64 bit of memory too. Unfortunately COOPS too bottoms out quite fast - more than 16GB is theoretically impossible and in practice its a bit less than that.
[04:51:39] <ianp> and it just assumes those boxen are dedicated
[04:51:47] <ianp> the easiest way to do it
[04:52:02] <surial> If its a big server app that needs this kind of performance tuning, then, yeah.
[04:52:25] *** BoF has joined ##java
[04:52:27] <surial> Note that -XmxBOATLOADS doesn't imply the JVM will immediately eat up all that memory and keep it to itself. That just means it'll grow into at most that much on an as-needed basis.
[04:52:34] <ianp> it's not really performance tuning, we just need a system to just throw hardware at these massive jobs
[04:52:45] *** dgreen has left ##java
[04:52:49] <ianp> and be able to find a place for em to run
[04:53:01] <ianp> yes, i know that
[04:53:15] <ianp> but still you can't assume that all the vms scheduled on that box won't max it out at the same time
[04:53:18] <ianp> worst case
[04:55:08] *** flippo has joined ##java
[04:56:12] *** chl5011 has joined ##java
[04:56:40] *** mek||malloc has joined ##java
[04:58:07] *** openpercept has joined ##java
[04:59:03] *** phantomcircuit has quit IRC
[05:00:00] *** eyesUnclouded has joined ##java
[05:00:52] *** Cymage has quit IRC
[05:02:10] *** Cymage has joined ##java
[05:02:22] *** bearded_oneder has quit IRC
[05:02:51] *** eyesUnclouded has quit IRC
[05:03:00] <cbeust> surial: Isn't it preferable to set the min bound to the max bound, thought, to avoid freezes due to growths?
[05:03:21] <surial> On a dedicated box running a very long lived process? Yes.
[05:03:25] <ianp> I read about that somewhere in sun's literature
[05:03:52] <ianp> our processes spawn ,load tons of heap, then die
[05:03:58] <surial> ianp: -Xms sets min (i.e. what's immediately claimed on VM start). -Xmx decides how far it'll grow. If they are equal, what you start with is what you get.
[05:04:01] <ianp> phase 2 will be to fix that design
[05:04:12] <ianp> surial: yes, it's like actually allocating the maxheap off the bat
[05:04:19] <ianp> well, it *is*.. right
[05:05:48] *** marens has quit IRC
[05:10:49] *** tigger0jk has quit IRC
[05:11:21] *** CodeWar has joined ##java
[05:11:25] *** CodeWar has left ##java
[05:11:45] *** huntercool has quit IRC
[05:13:09] *** topriddy has quit IRC
[05:13:35] *** xeer has joined ##java
[05:14:16] <xeer> I'm creating an anonymous class for Arrays.sort and eclipse is trying to reduce the arguments to just the Object[]. What would I be providing incorrectly?
[05:15:10] <ojacobson> ~show us
[05:15:10] <javabot> Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems.
[05:15:28] <xeer> ArrayList<T> items; items = ...; Arrays.sort(items.toArray(), new Comparator<T>() { public int compare(T first, T second) { ... } });
[05:16:31] <ojacobson> items.toArray() doesn't return the type you think it does.
[05:16:37] <ojacobson> Also, Collections.sort exists.
[05:17:10] <ojacobson> (Even if you fix the toArray call, that whole stanza would be a no-op as the sorted array would then be thrown away.)
[05:17:44] <xeer> The issue then is with .toArray()
[05:17:48] <cbeust> Second time in 24 hours I see someone tripped by the fact that sort() doesn't return anything
[05:18:06] <xeer> In my example, does it look like I expect sort to return something?
[05:18:16] <ojacobson> No, but the thing that is sorted is then immediately discarded
[05:18:32] <cbeust> xeer: my bad I missed the semi colon
[05:18:49] <cbeust> xeer: another reason why these things are better shown in a pastebin :)
[05:19:32] *** terranova has joined ##java
[05:19:41] *** terranova has quit IRC
[05:20:05] <ojacobson> You probably want to not call toArray at all and to use Collections.sort instead
[05:20:17] *** terranova has joined ##java
[05:21:35] <xeer> You're probably right.
[05:21:41] *** Cymage has quit IRC
[05:21:45] <ojacobson> *grin*
[05:22:12] <ojacobson> If you want to see why your code isn't compiling, rather than why it isn't doing anything useful, though, you'll want to have a look at the docs for ArrayList.toArray() and ArrayList.toArray(T[]).
[05:23:29] *** KarlKFI|work has quit IRC
[05:25:20] <surial> xeer: What cbeust and ojacobson have been telling you. There are two problems here (A) never call toArray(), always call .toArray(new TypeOfArray[0]). Note that you're effectively fucked if TypeOfArray is not reified, i.e. "T" or some such. toArray() is broken. (B) sort sorts in-place, but toArray produces a new array. Unless you store a ref to the result of the toArray call somewhere, you're sorting an array that'll get garbage collected
[05:25:20] <surial> immediately after.
[05:25:47] <surial> The practical solution is very simple: Consider arrays of non-primitive types obsolete. Do not use them at all, stick to collections.
[05:25:52] <surial> i.e. Collections.sort().
[05:26:00] <xeer> <@ojacobson> Also, Collections.sort exists.
[05:26:02] <cbeust> Surial broke the irc line limit
[05:26:08] <xeer> that was all that was needed.
[05:26:17] <surial> :(
[05:26:29] <xeer> But thank you for your long winded explanation
[05:28:56] <ojacobson> Heh. First time in a while someone's actually appreciated my notoriously terse "help" :)
[05:31:26] *** c_axis has quit IRC
[05:37:06] *** rjohnson19 has quit IRC
[05:38:00] *** CodeWar has joined ##java
[05:39:27] <ianp> here's a question.... if i want to manage a bunch of launched processes
[05:39:40] <ianp> is there a nicer way than creating a thread for each one blocking on waitFor()?
[05:39:45] <ianp> Process.waitFor
[05:39:55] <ianp> not to mention the threads to read the input and output
[05:39:58] *** foocraft has joined ##java
[05:39:59] <ianp> 3 threads per spawned process
[05:40:36] <ojacobson> ianp: not right now, unfortunately. select()ing against the streams from child processes isn't portable (mostly, to windows, as I understand it) so the selector glue in the JDK doesn't support it.
[05:40:40] <ojacobson> Welcome to the future.
[05:40:51] <ojacobson> You can postpone the waitFor(), though
[05:40:52] *** tty1 has quit IRC
[05:41:09] <ojacobson> and waitFor() all of your processes, one at a time, in a single thread (possibly even the thread that launched them!)
[05:41:24] <ojacobson> it doesn't actually matter much what order you call waitFor() in, since you'll get to them all eventually
[05:41:37] <ianp> ojacobson: true
[05:42:12] *** GeorgeBrabazon has quit IRC
[05:42:53] *** b3nny has joined ##java
[05:43:06] <ianp> ojacobson: still have to have a thread for the output stream of each though,
[05:43:08] <ianp> right
[05:43:33] <ojacobson> unless you're willing to bet a deadlock on the idea that your child processes will not produce enough output to block
[05:43:40] <ianp> so that's down to 1+N threads (and polling on that 1 thread)
[05:43:41] <cbeust> ianp: CompletionService?
[05:43:41] <ojacobson> (or any output at all, if you never look at stdout :)
[05:43:47] <ojacobson> 1+2N
[05:43:52] <ojacobson> stdout, stderr
[05:43:59] <ianp> ojacobson: not if i redirect stderr to stdout
[05:44:05] <ojacobson> No redirection.
[05:44:07] <ianp> cbeust: i was looking into that a bit ago...
[05:44:12] <ianp> ojacobson: what do you mean ?
[05:44:13] <ojacobson> That's a shell feature, and Runtime.exec doesn't run a shell for you.
[05:44:34] <ianp> ojacobson: it's in the java api.....
[05:44:37] <surial> Doesn't ProcessBuilder have an explicit method to do it?
[05:44:39] <surial> right, that method.
[05:44:47] <ianp> ojacobson: might be new
[05:44:48] <ojacobson> ah, hm. Been a while since I looked over there. :)
[05:44:52] <surial> ~ javadoc ProcessBuidlder
[05:44:52] <javabot> I don't know of any documentation for ProcessBuidlder
[05:44:52] <ianp> :)
[05:44:53] <surial> It's in that.
[05:44:55] <ianp> yeah
[05:44:55] <surial> somewhere.
[05:44:58] <ianp> that's what im using
[05:44:59] <surial> ~ javadoc ProcessBuilder
[05:44:59] <javabot> surial: http://is.gd/iyDGB [JDK: java.lang.ProcessBuilder]
[05:45:00] *** eidolon has quit IRC
[05:45:03] <surial> Now with extra proper spelling.
[05:45:05] <ojacobson> Subprocess stuff in Java is still a disaster area, but that's a step in the right direction
[05:45:05] *** bindaas has quit IRC
[05:45:13] <ianp> indeed
[05:45:32] *** bindaas has joined ##java
[05:46:05] *** moqq has joined ##java
[05:46:07] *** caverdude has joined ##java
[05:46:08] *** Fanook has quit IRC
[05:47:14] *** Clete2 has quit IRC
[05:48:14] <caverdude> hi
[05:49:09] *** magn3ts has quit IRC
[05:52:33] *** nsfx has joined ##java
[05:53:19] <nsfx> Any tips on how to access a static property of class X given a Class<X> object?
[05:56:40] *** opakavic has joined ##java
[05:57:11] <ojacobson> nsfx: "don't" :)
[05:57:36] <ojacobson> If you need virtual dispatch (behaviour that depends on a type), but there's no type appropriate to dispatch on, introduce one
[05:57:47] <ojacobson> it'll be much less fragile than the alternative, here
[05:58:57] *** abhy has joined ##java
[06:03:12] <cbeust> nsfx: reflection
[06:03:36] *** ExtraSpice has joined ##java
[06:11:52] *** homie has joined ##java
[06:12:16] *** AqD has joined ##java
[06:12:43] *** cbeust has quit IRC
[06:13:19] *** cbeust has joined ##java
[06:17:13] *** BoF has quit IRC
[06:21:14] *** neuro_sys has quit IRC
[06:26:01] *** echosystm has joined ##java
[06:27:21] <echosystm> i'm playing around with NIO and ive got a server socket channel here..
[06:27:35] <echosystm> im confused how this considered nonblocking
[06:27:55] <echosystm> when you accept, you block... then when you read from the socket, you block also
[06:29:05] <echosystm> is there something else i have to do to get nonblocking io?
[06:29:34] *** K4mirox has quit IRC
[06:33:27] *** erik__ has joined ##java
[06:35:26] *** CodeWar has quit IRC
[06:38:11] *** guidj0s has quit IRC
[06:44:28] *** BSWolf has quit IRC
[06:46:41] <Rainier> EnumMap is nice, why is EnumSet so fugly?
[06:46:46] *** lf94 has quit IRC
[06:51:55] <Rainier> I guess I can use noneOf(MyEnum.class) then add to it :-/
[06:52:03] <Rainier> That seems to work.
[06:52:07] *** X-Scale has quit IRC
[06:55:40] *** overclucker has joined ##java
[06:56:48] *** Junior has joined ##java
[06:56:51] *** foocraft has quit IRC
[06:58:24] *** epalm has quit IRC
[06:59:07] <overclucker> I am trying to generate sets of random x,y coordinates, and with java.util.Random's Random.nextInt(), there is too much of a pattern, is there a more random way to generate random integers?
[06:59:17] *** c001 has joined ##java
[06:59:31] <c001> is it possible to add a .jsp file to a .war that is already deployed?
[06:59:37] <c001> without having it registered in the web.xml?
[07:00:51] <Rainier> overclucker, it *is* pseudo-random you know, but I'm sure it tries to do a reasonable job of ensuring randomness, though randomness does not guarantee evenly distributed which is probably more what you want ...
[07:01:24] <Rainier> (well, evenly or some other distribution)
[07:03:00] *** pen has joined ##java
[07:04:03] *** Diffraction has joined ##java
[07:04:26] *** L4nce0 has joined ##java
[07:04:45] <L4nce0> hey all, what's the best room for java + webcrawlers?
[07:04:48] <surial> overclucker: new SecureRandom()
[07:05:17] <surial> overclucker: Also, are you quite sure the standard new Random() is showing definite patterns? You might want to pastebin your code. It's very very simple to introduce patterns yourself due to misuse of Random().
[07:05:38] *** platzhirsch has joined ##java
[07:06:45] *** platzhirsch has left ##java
[07:07:14] <Rainier> I was thinking similar, it should be fairly good for something simple like X,Y points by default.
[07:08:59] *** Niamkik has joined ##java
[07:09:18] <Diffraction> how to show elements of an array using joptionshowmssage() in a single window.....code would be appriciated..
[07:09:43] <Diffraction> without concatenating..
[07:09:56] <Rainier> Magic. You're thinking of magic.
[07:10:16] *** bn` has quit IRC
[07:10:24] <Diffraction> ?
[07:10:32] <Rainier> Except in this case, you could spend your entirely life carving your wand and still wouldn't solve your problem the way you want.
[07:11:57] <Rainier> Given the toString value of an array, you can't just feed it to the dialog proxy constructor method and you can't use concatenation to make a String (StringBuilder preferably) out of the elements, so you want magic.
[07:12:25] <Rainier> There is a method on Arrays that would create a String for you, but guess how it does it?
[07:12:39] <Rainier> I'd also guess it won't format the output the way you want either.
[07:12:48] <Rainier> on the Arrays class*
[07:14:23] <L4nce0> here is where I think I'm doing something wrong
[07:14:25] <L4nce0> http://pastebin.com/rpN2UFsu
[07:14:33] <Rainier> You could also take the second star and travel on until morning to Never Never land where things run on happy thoughts ...
[07:14:47] <L4nce0> is there a cleaner way to check this?
[07:15:03] <Rainier> L4nce0, most definitely.
[07:15:08] <Rainier> Use a Set.
[07:15:18] *** BSWolf has joined ##java
[07:15:23] <Rainier> Put all items you want to check against in it, and smash their case.
[07:15:36] <Rainier> Then you can just ask the set if it contains a similarly case-smashed input.
[07:15:47] <L4nce0> oh yeah.. that would work...
[07:15:49] <Rainier> You can store the set somewhere so it needn't be made each time.
[07:15:59] <L4nce0> perfect! thanks!
[07:16:03] <L4nce0> or even just an array list
[07:16:07] <Rainier> happy to help.
[07:16:12] <surial> L4nce0: If they're all 3 letters, it's really trivial: if (!knownTypes.contains(type.toLowerCase().substring(3)) { .... }
[07:16:14] <Rainier> sure, but I assume you won't have dupes, so a Set.
[07:16:45] <surial> L4nce0: Note that equalsIgnoreCase is better than equals(x.toLowerCase()) in that i18n is handled better by it. If the set of types is fixed and its all US-ASCII, don't worry about it.
[07:16:53] <L4nce0> yeah, I'm making a craigslist webcrawler, so there is a few dozen categories. All set as a 3 letter code
[07:17:01] *** glcrazy has joined ##java
[07:17:58] <L4nce0> would making a temp variable, setting it to lower case then checking it be even better?
[07:18:03] *** surial has quit IRC
[07:18:13] <Rainier> I think that's what surial was suggesting
[07:18:53] *** Soliah has quit IRC
[07:18:59] <Rainier> but I don't know, if it was a single String to check against if you had "aaabbb", contains("aab") is valid.
[07:19:05] *** devkhadka has joined ##java
[07:19:07] <Rainier> but I don't know, he quit*
[07:19:24] <Rainier> Anyway, do it the most concise way that makes sense to you.
[07:19:36] <L4nce0> error checking is always good =)
[07:19:48] *** pen has quit IRC
[07:20:24] *** surial has joined ##java
[07:20:32] <L4nce0> I am in a Junior level software engineering class. We just did code converge. I apparently really really love redundant bad value checks..
[07:21:05] <surial> L4nce0: Why the heck would that be better? Effect is exactly the same.
[07:21:42] <surial> checking for bad values early is usually a sign of bad code. Just do whatever needs to be done and rely on exceptions to flag problems.
[07:21:56] <surial> The only exception is when a bad value would NOT cause an exception. In that case, check it, and throw an eception if the value is bad.
[07:22:14] <surial> If you follow this rule you'll never have redundant checks either.
[07:22:46] *** retrodos has quit IRC
[07:22:49] <L4nce0> I wouldn't say that, I mean the bad value checks are all for items a user or a file input. So really it's checking for someone bad user values
[07:23:46] <L4nce0> I'm not checking to see if me tables are correct.
[07:23:49] <L4nce0> my~
[07:23:55] <Diffraction> actually i m new to java....and wanted to make use of "null" argument we give...i thought it will solve the problem...
[07:24:15] <L4nce0> can you say more Diffraction ?
[07:24:38] <L4nce0> ex, what is the problem you are trying to solve, or why you think null is the solution
[07:26:00] <Diffraction> i wanted to print the array elements in a same window using joption pane show message()
[07:26:12] *** echosystm has quit IRC
[07:27:13] *** McMAGIC-- has quit IRC
[07:27:14] <L4nce0> okay, and what's it not doing (though the only GUIs I'm good with are android..)
[07:28:07] *** yoshx has joined ##java
[07:28:27] <Diffraction> well...concatenating the array elements in a string and display the string is a solution...
[07:28:51] <L4nce0> ah I think I know your issue..
[07:29:25] <Diffraction> is any other way of doing it using JOptionpane?
[07:30:00] <L4nce0> first, can you display it just to your concl?
[07:30:33] <L4nce0> that sounds right, let me play with it. ( though this is probably homework so I wont show you my code..)
[07:30:34] <Diffraction> not getting u...u mean command line..?
[07:30:50] <Diffraction> k
[07:30:51] <L4nce0> it's you, not u, and yes you can call it that
[07:31:34] *** Ademan has quit IRC
[07:31:39] <Diffraction> so there is a way right?
[07:31:52] <L4nce0> there are many right ways =)
[07:31:57] <c001> is it possible to have a .war file within a .war file?
[07:32:06] <L4nce0> just avoid the more clever ways...
[07:32:38] <L4nce0> but, first, can you print to your console? Also I'd recommend using eclipse at some point.
[07:33:03] <Rainier> L4nce0, I already mentioned the clever way ... go to NeverNeverLand, think happy thoughts, and it'll all magically be taken care of for him.
[07:33:06] <Diffraction> i use netbeans...yes i m able to priint it in concole..
[07:33:17] <Rainier> He wants to display an array of values without serializing them to something disaplayable first.
[07:33:22] <Rainier> displayable*
[07:33:37] <Diffraction> console*
[07:33:44] <L4nce0> Rainier: I'm talking about his problem.. not mine =P
[07:34:03] <Rainier> L4nce0, I meant I already mentioned that to him.
[07:34:06] <Rainier> arrayObj.toString() is not pretty, it's standard Object-ref output.
[07:34:36] <Rainier> You can use Arrays.toString(arrayObj) to obtain a String, but it imposes its own formatting on the output which you may or may not want and is most likely (I haven't viewed the source) done by some form of concatenation.
[07:34:53] <Rainier> So you either do it yourself, or ask Arrays to do it, but you're not going to get it otherwise.
[07:36:28] *** sebersole has joined ##java
[07:37:09] <L4nce0> yeah, but that way he doesn't learn how to deal with nulls ;) I mean it is all about learning
[07:37:31] <Rainier> I don't see how turning an array into a String has that much to deal with nulls ...
[07:37:40] <Rainier> You could have null values, but other than that ...
[07:37:45] <L4nce0> I don't either, that's what I was trying to get out of him
[07:38:50] *** yoshx has quit IRC
[07:39:20] <Diffraction> L4nce0: thanx.... so cant i use "null" argument that we give in showmeassagedialog() method to repeatedly display the array elements in the parent window itself??
[07:39:51] *** homie has quit IRC
[07:39:52] <Diffraction> i mean we can replace null with something...
[07:40:04] <L4nce0> can you send us your code? Do you mean the argument for the method to display?
[07:40:54] <L4nce0> if so yes, in this case I would normally google the swing function name and see what types that normally go in and what they are used for
[07:41:00] <Rainier> print(new Translator("lang:wha?").translateTo("lang:english", getLastDiffractionMessages()));
[07:42:18] *** homie has joined ##java
[07:42:35] *** topriddy has joined ##java
[07:43:34] *** frangiz has joined ##java
[07:53:04] *** frangiz has quit IRC
[07:56:53] *** opakavic has quit IRC
[07:57:28] *** frangiz has joined ##java
[07:58:11] <Rainier> Aw. I'm probably being stupid, but I wrote myself into a corner of sorts. I have an enum, Edge { NORTH, SOUTH, EAST, ... } and I wanted to pass in a constructor param for each to define their "opposite" Edge, but since I can't reference an Enum before it's defined I can't create the circular defs at setup, but I also don't want to hard-code somewhere NORTH.opposite = SOUTH (pseudo-code). Any ideas on that or just go the easy route
[07:58:11] <Rainier> and code it up?
[08:00:46] <Rainier> hmm, given what the JavaDoc says I could use integers because the ordinal for each is based on declaration position and thus won't change unless I reorder them.
[08:00:50] <Rainier> That seems nice enough.
[08:02:20] *** caverdude has quit IRC
[08:04:00] <Planck_> I'd go for a cyclic order, actually
[08:04:07] <deebo> just add an opposite() method to the enum and return it
[08:04:41] <Planck_> Just in case you later want to have a "turn 90 degrees" as well.
[08:04:54] <Rainier> Planck_, huh?
[08:05:06] <Rainier> deebo, you mean for each enum decl?
[08:05:40] <Planck_> Suppose you're coding a "follow the left-hand wall" maze-solving algorithm on a data structure with such an enum
[08:05:56] <Rainier> It's for a layout manager :P there's no turning.
[08:05:58] *** bn` has joined ##java
[08:06:05] <Planck_> Fair enough
[08:06:07] <deebo> Rainier: i withdraw what i said, im being stupid :)
[08:06:29] <deebo> but if you have north,east,south,west, the opposite is ordinal+2
[08:06:38] *** terranova has quit IRC
[08:06:47] <deebo> just use that
[08:07:16] <Rainier> oh, well, I suppose that makes some sense.
[08:07:57] <Rainier> Though in response to your original statement, you can do per-enum method overrides.
[08:08:01] <Rainier> per-enum-value
[08:08:15] <Rainier> It's just not very compact.
[08:09:07] <deebo> return Test.values()[this.ordinal() + 2];, just add the overflow check and its done :)
[08:09:32] <cbeust> No need for overflow check, use %
[08:09:46] <deebo> well whatever to combat it :)
[08:11:52] *** erik__ has quit IRC
[08:13:43] *** coalado has joined ##java
[08:14:41] *** surial has quit IRC
[08:15:42] *** Niamkik has quit IRC
[08:18:06] *** meling has quit IRC
[08:20:55] *** CodeWar has joined ##java
[08:25:23] *** zhulikas has joined ##java
[08:25:42] <Wizard> hi
[08:26:31] *** Diffraction has quit IRC
[08:29:15] * Rainier .oO( If Wizard found a lizard gizzard inside of a blizzard would it make a good stew? )
[08:29:47] *** nchaimov has quit IRC
[08:30:39] *** NightMiles has quit IRC
[08:30:52] *** nchaimov has joined ##java
[08:31:02] <Wizard> Rainier: it would
[08:31:24] *** NightMiles has joined ##java
[08:31:27] <Wizard> lemme check what stew and gizzard are
[08:31:36] *** DJClean has joined ##java
[08:32:56] *** LouisJB has quit IRC
[08:33:43] <Rainier> Wizard, Knowing what a gizzard is, I'd guess no unless you're into exotic foods.
[08:33:53] <Rainier> but it does rhyme.
[08:34:16] *** jjido has joined ##java
[08:34:17] *** mazzachre has joined ##java
[08:36:38] <Wizard> omg, gizzard: something in bird's stomach?!
[08:37:02] <cbeust> Wizard: I thought it wasn't limited to birds, but yes, that's what it is
[08:37:13] <cbeust> Guts
[08:37:28] *** L4nce0 has quit IRC
[08:38:29] <Wizard> one learns during whole life :)
[08:38:29] <Rainier> yes, it's not limited to birds.
[08:40:11] *** bulltwang has joined ##java
[08:40:36] *** jjido has quit IRC
[08:46:41] *** CodeWar has quit IRC
[08:47:06] <pr3d4t0r> Good morning.
[08:47:12] *** shurane_ has joined ##java
[08:47:31] *** wvdhaute has joined ##java
[08:47:39] *** jjido has joined ##java
[08:48:11] *** Wagoo has quit IRC
[08:54:13] *** Wagoo has joined ##java
[08:54:45] *** topriddy_ has joined ##java
[08:56:22] *** wolfman2000 has quit IRC
[08:56:35] *** topriddy has quit IRC
[08:56:38] *** topriddy_ is now known as topriddy
[09:01:22] *** dframe has joined ##java
[09:06:23] *** topriddy_ has joined ##java
[09:06:35] *** TzilTzal has joined ##java
[09:06:52] *** freeone3000 has joined ##java
[09:07:21] *** durre has joined ##java
[09:07:28] *** topriddy has quit IRC
[09:07:31] *** topriddy_ is now known as topriddy
[09:08:18] *** RLa has joined ##java
[09:08:51] *** mastroDani has joined ##java
[09:09:52] *** bulltwang has quit IRC
[09:10:05] *** cbeust has quit IRC
[09:13:19] *** FrozenKnight has joined ##java
[09:14:54] *** _Jorde has joined ##java
[09:16:07] *** damg has joined ##java
[09:16:46] *** chandan_kumar has quit IRC
[09:18:21] *** topriddy has quit IRC
[09:18:24] *** _bugz_ has joined ##java
[09:21:49] *** jjido has quit IRC
[09:25:35] *** topriddy has joined ##java
[09:26:00] *** topriddy has quit IRC
[09:27:54] *** topriddy has joined ##java
[09:28:44] *** jjido has joined ##java
[09:31:04] *** jogla has joined ##java
[09:32:38] *** Phil-Work has joined ##java
[09:34:06] *** wliao has quit IRC
[09:34:20] *** eerie has quit IRC
[09:35:00] *** wliao has joined ##java
[09:37:29] *** jjido has quit IRC
[09:38:04] *** deebo has quit IRC
[09:38:38] *** respecting has joined ##java
[09:38:51] *** eerie has joined ##java
[09:38:55] *** deebo has joined ##java
[09:39:01] *** abhy has quit IRC
[09:39:36] *** chandan_kumar has joined ##java
[09:39:39] *** mitch0 has quit IRC
[09:41:50] *** b3nny has quit IRC
[09:42:20] <durre> good morning! I was wondering if anyone had any experience in deploying java webapps to a VPS? is there any virtualization software (NEX, virtouzzo, openvz etc) that works extra well or extra bad with java? I heard there was but havent been able to confirm
[09:42:49] *** tewecske has joined ##java
[09:45:12] <Bombe> It all works virtually equally well.
[09:46:03] <respecting> hi i have created a simple HQL query(i'm using JOPA hibernate 3.6) and i have used a specific oracle keyword which is rownum.The problem is that the query executed successfully which does not have a sense for me because i'm afraid it will not work with DB2,Postgres etc..(they don't have rownum).Here is my simple code http://pastebin.com/B0mdBzaw
[09:47:26] *** damg has quit IRC
[09:48:07] <Rainier> respecting, something like this: http://stackoverflow.com/questions/489360/hql-row-identifier-for-pagination might be more applicable.
[09:49:08] <Rainier> In short, that's not something that belongs in the HQL, but as part of the structure returned by the method generating the query resulting from that HQL so Hibernate can properly map what you want to the right concept.
[09:49:15] *** jjido has joined ##java
[09:50:14] <deebo> you can easily paginate with jpa, using a query for it is far from optimal
[09:50:43] <deebo> and if you use hibernate as a JPA provider, dont use it as hibernate :P
[09:52:59] <respecting> yes i know but how can hibernate translate my Hql query in case i'm using DB2 because normally hql must throw an exception in case i'm using some keywords that belongs to HQL
[09:54:26] *** jjido has quit IRC
[09:54:55] <deebo> you dont use HQL
[09:54:56] *** overclucker has left ##java
[09:55:04] <deebo> you use jpa
[09:55:35] <deebo> query.setFirstResult(0), query.setMaxResults(10)
[09:55:35] <freeone3000> That query will fail on DB2, as expected.
[09:55:48] *** Rainier has left ##java
[09:56:33] <freeone3000> Although it's valid SQL syntax in other DBs. 'rownum' will be taken as 'BankAccount.rownum'.
[09:57:49] *** plarsen has quit IRC
[09:59:45] *** chandan_kumar has quit IRC
[10:00:07] *** mitch0 has joined ##java
[10:01:22] *** wliao has quit IRC
[10:02:13] *** wliao has joined ##java
[10:02:47] *** drindt has joined ##java
[10:03:24] *** terranova has joined ##java
[10:03:35] *** eitch0000 has joined ##java
[10:05:10] *** chandan_kumar has joined ##java
[10:06:56] *** mapreduce has joined ##java
[10:10:30] *** whaley_ has joined ##java
[10:14:53] *** gh0st has quit IRC
[10:15:39] *** Pinas has joined ##java
[10:15:54] <Pinas> good morning
[10:16:29] <Pinas> i'd like to ask if there is some kind of a "standard" way on how to process annotations in order to use the data in this annotation for configuration purpos
[10:17:06] * shookees :morning
[10:17:21] <deebo> configuration of what and when?
[10:17:47] <deebo> you can create compile time annotation processors, or just use reflection runtime (if your annotations have retentionpolicy runtime)
[10:18:02] *** devkhadka has quit IRC
[10:18:40] <Pinas> oh configuration of a framework (need to do this for university). When - good question i'd say after compilation
[10:18:43] *** selckin has quit IRC
[10:18:51] <deebo> so runtime?
[10:18:55] <Pinas> jop
[10:19:01] <deebo> just use reflection then
[10:19:33] *** jjido has joined ##java
[10:19:56] <Pinas> ok, but I do need to find the files which use my annotations - so the files which extend my framework. How do i do this ?
[10:20:14] *** selckin has joined ##java
[10:20:46] <Pinas> i thought about annovention (https://code.google.com/p/annovention/) but i am not sure if this is really a good way (i am not that experienced in java)
[10:21:14] <deebo> something like that works
[10:21:26] <Pinas> you mean like annovention ?
[10:21:27] <deebo> but is your task the framework, or to do something with the framework
[10:21:44] <Pinas> a framework and afterwars I need to do something with it
[10:22:18] <deebo> well use a lib like annovention during bootstrap to find annotations and then do whatever you do to configure things
[10:23:24] <deebo> or define something yourself, like a package where you find things with annotations
[10:24:28] *** xeer has quit IRC
[10:25:17] <Pinas> well but if I do so, the hypothetical user of my framework (wich will propably never exist) would have to write the path to all his files which deal with my framework into this package (or copy all the files)
[10:25:23] *** devkhadka has joined ##java
[10:26:49] *** selckin has quit IRC
[10:28:12] <Pinas> or can I order the user to put all classes, that deal with my framework, in a special named package ?
[10:29:17] *** psst has joined ##java
[10:29:28] *** sebrock has joined ##java
[10:33:14] *** devkhadka has quit IRC
[10:34:50] *** tty1 has joined ##java
[10:42:15] *** chandan_kumar has quit IRC
[10:43:16] *** neuro_sys has joined ##java
[10:43:43] *** fr0ggler has joined ##java
[10:46:43] *** tty1 has quit IRC
[10:48:12] <deebo> Pinas: or just let the user tell where the classes are
[10:49:02] <deebo> like in spring you can scan for beans by giving a path
[10:50:55] <Pinas> ok this sound easier than searching for classes everywhere. My last question. How can the user tell me where to find the classes with annotations ??
[10:51:34] *** tty1 has joined ##java
[10:51:42] <Pinas> a config file is not allowed :)
[10:51:58] <deebo> you have a framework with no configuration files allowed?
[10:53:05] <Pinas> give me a second i'll tell you the exact task (the neccessary part)
[10:53:29] <Pinas> give me a second i'll tell you the exact task (the neccessary part)
[10:53:34] <Pinas> Use annotations to con gure your services. Your framework should be con gurable with annotations
[10:53:34] <Pinas> as far as possible/reasonable.
[10:53:49] <Pinas> damn copy&paste
[10:54:29] *** rhonabwy has quit IRC
[10:55:59] <mapreduce> I don't know why people want to configure via annotations, instead of actual code.
[10:56:15] <mapreduce> E.g., you can't change annotations at runtime, generate them programmatically.
[10:56:46] <mapreduce> Perhaps it's the lack of first-class methods, but then C# people do the same (but call them attributes) and C# has delegates.
[10:58:31] *** rhonabwy has joined ##java
[10:59:53] *** jonkri has joined ##java
[11:00:13] *** rhonabwy has quit IRC
[11:00:16] <Pinas> mapreduce i don't want to configure via annotations I have to - if i could choose i would not even use java :)
[11:01:17] *** PigFlu has quit IRC
[11:02:31] <freeone3000> If you don't know where the classes are, you'll have to scan every class in the classpath.
[11:03:09] *** Blub\0 has quit IRC
[11:04:23] <Pinas> or I could use a simple config file which tells me where to find the classes ?
[11:05:34] *** svm_invictvs- has quit IRC
[11:06:01] *** topriddy has quit IRC
[11:06:02] *** svm_invictvs has quit IRC
[11:06:08] *** bulltwang has joined ##java
[11:07:03] *** mek||malloc has quit IRC
[11:07:14] *** infid has quit IRC
[11:07:32] *** infid has joined ##java
[11:08:27] *** Bhavesh_A_P has joined ##java
[11:08:32] *** topriddy has joined ##java
[11:08:35] *** Bhavesh_A_P has left ##java
[11:08:39] *** Bhavesh_A_P has joined ##java
[11:08:42] *** Bhavesh_A_P has left ##java
[11:08:56] *** mek||malloc has joined ##java
[11:09:14] *** rhonabwy has joined ##java
[11:09:36] *** rhonabwy has quit IRC
[11:12:33] *** bulltwang has quit IRC
[11:15:44] *** selckin has joined ##java
[11:18:20] *** teralaser has joined ##java
[11:20:07] <Wizard> hi
[11:20:18] <ztj> no
[11:20:20] <Wizard> does ~ works in file path in java?
[11:20:24] <Wizard> :S
[11:20:37] <ztj> there is a system property equivalent though
[11:20:38] <ztj> I think user.dir
[11:20:43] <ztj> maybe user.home
[11:20:46] * ztj can't remember
[11:20:59] <ztj> ~system properties
[11:20:59] <javabot> ztj, system properties is http://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html , a list of them can be found at http://java.sun.com/javase/6/docs/api/java/lang/System.html#getProperties()
[11:21:01] *** devkhadka has joined ##java
[11:21:08] <Wizard> yes, i know it works
[11:21:19] <Wizard> but what about ~? :)
[11:21:22] <ztj> no
[11:21:28] <Wizard> i guess i have to try it
[11:21:29] <ztj> but you could easily replace it
[11:21:37] <fr0ggler> Wizard, no it won't. it's a shell shortcut
[11:21:51] <Wizard> yeah, but a common thing and works in many apps
[11:22:03] <ztj> you'll get over it, you have no choice
[11:22:09] <fr0ggler> Wizard, so? you asked if it would work, and we said no.
[11:22:17] <Wizard> yes, thank you
[11:22:29] *** topriddy has quit IRC
[11:22:32] <Wizard> i would replace it
[11:22:40] *** bitshuffler has joined ##java
[11:22:40] <Wizard> just as ztj said
[11:22:53] <ztj> just remember not to replace \~ :)
[11:23:45] * Wizard wonders what's that
[11:24:18] <ztj> an escaped ~
[11:24:23] *** topriddy has joined ##java
[11:24:23] *** infid has quit IRC
[11:24:24] <ztj> if you're emulating shell features
[11:24:45] <ztj> or you could just not do silly things like that, users should not expect shell expansion in non-shell interfaces
[11:25:07] <Wizard> heh
[11:25:22] <ztj> I mean, if you're going to expand ~ why not $HOME ? and so on
[11:25:35] <Wizard> of course they do, i'm a user and i do
[11:25:38] <ztj> also you SHOULD expand \\~
[11:25:45] <ztj> but also replace \\ with \
[11:25:52] <ztj> You're not a user
[11:25:59] <ztj> or you wouldn't be in here asking this
[11:26:07] *** infid has joined ##java
[11:26:32] <ztj> people who make software are the very worst at knowing what people who just use it expect
[11:26:40] <ztj> a sad reality, to be sure
[11:26:45] <Wizard> ok, i've already had my answer, so i guess EOT (no offence)
[11:26:56] <ztj> Eat my ass (no offence)
[11:27:01] <fr0ggler> urgh
[11:27:10] <Wizard> :S
[11:27:28] <ztj> ;)
[11:27:31] <deebo> hes a wizard, watch out
[11:27:37] <ztj> so how about that earthquake?
[11:27:45] <Wizard> what earthquake?
[11:27:48] <fr0ggler> yeah madness huh. just watching some footage
[11:27:52] <fr0ggler> Sendai, Japan
[11:27:57] <fr0ggler> 8.9
[11:28:02] <deebo> cthulhu fell out of bed in r'lyeh
[11:28:08] <ztj> well it wasn't in sendai
[11:28:09] <Wizard> lol
[11:28:11] <neuro_sys> lol
[11:28:22] <ztj> it was like 150km away from there but still, very big, and a tsunami
[11:28:31] <fr0ggler> ztj, http://en.wikipedia.org/wiki/2011_Sendai_earthquake_and_tsunami
[11:29:16] <ztj> fr0ggler: yes I know I've been following it in detail longer than that wikipedia page has existed :)
[11:29:18] <deebo> al jazeera has a live feed (video)
[11:29:19] <Wizard> if gandalf had wikipedia he would predict saruman's treason :S
[11:29:21] <deebo> looks pretty freaky
[11:30:03] <ztj> deebo: indeed, especially the parts where the debris in the tsunami was on fire it's like... "Oh don't worry about these fires the tsunami will put it out... OH MY GOD THE TSUNAMI IS ON FIRE!" heh
[11:30:09] <fr0ggler> hehe
[11:30:22] *** PigFlu has joined ##java
[11:30:51] <fr0ggler> i feel sorry for all those atolls on alert where the wavefront is likely to be higher than their landmass :S
[11:31:14] <mapreduce> There's a toon army?!
[11:31:26] <fr0ggler> yarse
[11:31:28] *** chandan_kumar has joined ##java
[11:31:40] <fr0ggler> huuuuuuge earthquake badness!
[11:31:43] *** McMAGIC-- has joined ##java
[11:31:57] *** chandan_kumar has quit IRC
[11:32:07] *** chandan_kumar has joined ##java
[11:32:32] <ztj> in a few hours we'll start hearing about all the people living on beaches in Manila and such getting hit by it, I'm sure
[11:34:08] *** dieck has joined ##java
[11:34:11] <mapreduce> I've never liked manga anyway.
[11:34:55] <dieck> hi there. this may be a dumb question, but since .getYear() is deprecated in java.(util|sql).Date, how do I get the year?
[11:35:06] <ztj> Calendar API
[11:35:15] <ztj> or get and use joda-time, if you don't hate yourself
[11:35:33] <ztj> ~Calendar
[11:35:33] <javabot> ztj, what does that even *mean*?
[11:35:38] * ztj sighs
[11:35:41] <ztj> ~javadoc Calendar
[11:35:41] <javabot> ztj: http://is.gd/Xo0B35 [JDK: java.util.Calendar]
[11:36:19] *** jtheuer has joined ##java
[11:36:42] <dieck> ok, I'll have a look, thanks
[11:37:01] <ztj> these newscasters don't seem to know what a tsunami is (Hint, it's not one huge wave)
[11:38:47] <fr0ggler> you expect journalists to do research on their topic? and there is was thinking that all that sensationalist talk was valid factual evidence :)
[11:38:55] <fr0ggler> s/is/I/
[11:39:25] <fr0ggler> although I suppose you can't call a newscaster a journalist
[11:39:40] <Bombe> German next television reported that the tsunami hit at a very inconvenient time, between 14 and 15 o’clock.
[11:39:41] <deebo> has fox news told about this gods wrath on the heathen japs yet
[11:39:42] <ztj> heh no, but even the al jazeera guys knew this much heh
[11:39:50] <Bombe> It should have waited until the evening!
[11:39:51] <ztj> deebo: only a matter of time
[11:40:03] <Bombe> s/next/news/
[11:40:05] *** rhonabwy has joined ##java
[11:40:13] <deebo> maybe bill oreilly will reveal its all obamas fault
[11:40:32] <ztj> I blame the iPad 2
[11:40:59] <fr0ggler> some twats will say it's all man's climate changing ways. "waves are so much bigger now than they used to be!"
[11:41:21] <fr0ggler> and we'll get more taxation on CO2, which is the lamest greenhouse gas ever
[11:41:56] <ztj> You'd have to be an epic idiot to blame an earthquake on climate change, so it will likely be a FOX correspondent
[11:42:03] <fr0ggler> heh exactly :)
[11:42:14] <ztj> (one of the ones they pay to be incompetent while pretending to be "liberal")
[11:42:32] <mapreduce> You have too many children, and they produce CO2! Here is your tax bill.
[11:42:33] <ztj> you know, like that Colmes guy
[11:42:48] <fr0ggler> ztj, unfortunately not. I are British.
[11:42:51] <mapreduce> Then the Republicans come in, get all confused and start taxing CO2 consumers instead.
[11:42:59] <mapreduce> (i.e., plants)
[11:43:02] <ztj> mapreduce: change "children" to "cows" and "CO2" to "Methane" and you're stepping into reality
[11:43:10] <ztj> heh
[11:43:49] <fr0ggler> CO2 credits is the biggest tax swindle ever
[11:44:45] <Pinas> any idea if i can get the parameters of an annotation with annovention ??
[11:45:58] <mapreduce> ~annovention
[11:45:58] <javabot> mapreduce, what does that even *mean*?
[11:46:37] <mapreduce> I think I should occasionally step outside the comfort of javabot for my edumcation.
[11:47:23] <Pinas> sorry mapreduce: https://code.google.com/p/annovention/
[11:47:25] <fr0ggler> can't spring discover annotations without doing any classloading?
[11:47:38] <Pinas> jea but I am not allowed to use spring
[11:47:43] <fr0ggler> "allowed"?
[11:47:53] <Pinas> university task :)
[11:48:05] <mapreduce> OOP is written POO in Spanish. I don't think I'll ever get used to that.
[11:48:06] <fr0ggler> so you're allowed to use one 3rd party library, but not another?
[11:48:10] <fr0ggler> mapreduce, hahah
[11:48:27] <Pinas> well afaik spring is a whole ramework
[11:48:33] <Pinas> s/ramework/framework/
[11:48:35] *** [[thufir]] has joined ##java
[11:48:42] <fr0ggler> mapreduce, there's a family of grasses called "pooids"
[11:48:47] <fr0ggler> always makes me laugh
[11:49:02] <mapreduce> Why, do they tickle?
[11:49:36] <mapreduce> There's a family of grasses called the Johnsons, but we sorted them out.
[11:49:37] <fr0ggler> no.. it's go poo in the na.... ah nevermind
[11:49:46] <fr0ggler> got*
[11:50:08] *** wliao has quit IRC
[11:50:39] <mapreduce> I suppose 'grass' as a verb might be UK-specific.
[11:50:41] <mapreduce> English English.
[11:51:27] *** thpar has joined ##java
[11:51:52] <fr0ggler> Pinas, a framework is just a collection of libraries (if that). spring-core is one such library that can make bean management a whole lot easier. you don't have to grab and use the whole framework.
[11:52:31] <Pinas> jea I know, but our Assistent Prof told us that we are not allowed to use any spring stuff
[11:52:38] *** asfdd has joined ##java
[11:53:01] <asfdd> from command line how do i pass named parameters to my main method?
[11:53:12] <asfdd> i tried -Dmyvar test after the classpath
[11:53:15] *** LouisJB has joined ##java
[11:53:16] <asfdd> but didn't seem to work
[11:59:08] *** Ruudjah has joined ##java
[11:59:57] <Ruudjah> I have a current codebase which can probably be shrinked at some parts using Guice. I read/watched Guice now for a few hours, I just don't know how/where to start.
[12:00:13] <Ruudjah> Anyone a pointer for me?
[12:00:43] <mapreduce> null
[12:02:51] *** Fuco has joined ##java
[12:05:07] <Ruudjah> } catch (NPE ex) { throw new JavaChannelEmptyException(); }
[12:05:52] <dreamreal> Ruudjah: what do you mean by "shrinked by using guice?"
[12:05:55] <freeone3000> asfdd: How do you plan on getting these so-called "named parameters"?
[12:06:34] *** bulltwang has joined ##java
[12:06:35] <Ruudjah> dreamreal: removing boilerplate code
[12:06:43] *** epure_ has quit IRC
[12:06:52] <Ruudjah> factories as most notable
[12:07:00] <dreamreal> Ruudjah: so read the guice docs?
[12:07:05] <Ruudjah> yes
[12:07:27] *** Sliker has joined ##java
[12:07:54] <Ruudjah> they're quite clear. But right now, I think I'm suffering on infobesitas on this topic and feel overwhelmed. "Where to start".
[12:07:56] *** obiwahn has joined ##java
[12:08:09] *** camcorder has joined ##java
[12:08:11] <camcorder> hi
[12:08:16] <dreamreal> the beginning, I'd think. Is it really important that the codebase become smaller?
[12:08:18] *** evermean has joined ##java
[12:08:54] <Ruudjah> the main reason I'd like to use it because it improves code quality
[12:08:56] <camcorder> is using List<String> instead of String[] is an overhead?
[12:09:02] <Ruudjah> no
[12:09:09] <dreamreal> everything's an overhead. It depends on what you do with it.
[12:09:28] <evermean> Hey I have a problem with an RMI code example
[12:09:31] <camcorder> dreamreal, indeed just a dynamic array
[12:09:37] <asfdd> as a systemProperty freeone3000
[12:09:48] <dreamreal> camcorder: a dynamic array?
[12:09:48] <evermean> damn i'll be right back
[12:09:56] <camcorder> dreamreal, variable sized array
[12:10:01] <asfdd> normally we start the app with a jnlp, the arguments we specify there are also added to System.properties
[12:10:06] <Ruudjah> camcorder: List<T> is almost always preferable over []
[12:10:07] <asfdd> aswell as passed to the main method
[12:10:08] <dreamreal> camcorder: heh, then String[] would be far more expensive that List<T>
[12:10:18] <dreamreal> so, uh, "no"
[12:10:25] <asfdd> i guess the proper question is, how do i add a system property via command line :P
[12:10:28] <camcorder> ok great
[12:10:41] <dreamreal> "Is this $50 thing more expensive that the $5000 thing?"
[12:10:43] <freeone3000> asfdd: That would, indeed, be -Dargname="value"
[12:10:49] *** monk14 has quit IRC
[12:10:51] <asfdd> hmm better try some more
[12:10:58] *** MikeJansen has quit IRC
[12:11:15] <camcorder> dreamreal, which one of them is $5000
[12:11:20] <dreamreal> the String[]
[12:11:23] <Candle> ~~ camcorder optimisation
[12:11:23] <javabot> camcorder, Code for clarity and simplicity FIRST. Only optimize if you find a performance problem using a profiler. See http://is.gd/d9LX for more information.
[12:11:35] <camcorder> dreamreal, the thing is I might change my code to have fixed sized array
[12:11:41] <dreamreal> as soon as you say "variable-sized" you basically say "anyone who uses [] for this is a moron"
[12:11:51] <freeone3000> A fixed-size ArrayList behaves identically to a fixed-size array.
[12:12:00] <dreamreal> camcorder: well: here's a quick optimization tip in Java: don't.
[12:12:13] <dreamreal> camcorder: if you actually discover a problem, then think about optimizing.
[12:12:39] <camcorder> freeone3000, really, that's interesting since it's not obvious
[12:12:45] *** dieck has left ##java
[12:12:46] <asfdd> doesn't seem to work, i try to set the property blob with a base64 encoded string, i do this via -Dblob="data", but it doesn't appear in the system.properties
[12:13:00] <dreamreal> camcorder: Well, I don't know why "ArrayList" wouldn't sound like it used an array somehow
[12:13:03] *** topriddy has quit IRC
[12:13:06] *** homie has quit IRC
[12:13:12] <asfdd> is the ordering from command line important? ie does it have to be before or after classpat
[12:13:13] <asfdd> h
[12:13:23] <camcorder> dreamreal, ever coded in C?
[12:13:30] <ztj> asfdd: it must come before the classname
[12:13:40] <freeone3000> asfdd: All arguments before the classname are arguments to `java`, everything after is arguments to your program.
[12:13:43] <dreamreal> camcorder: um. yes.
[12:13:52] <Candle> asfdd: java -Dfoo=bar my.package.MainClass
[12:14:56] <camcorder> dreamreal, then you might thing [] looks like using no classes/objects or whatever, but anything you do with *new* is
[12:15:04] <camcorder> s/thing/think
[12:15:14] <dreamreal> camcorder: oh wait, you said C, not C++.
[12:15:34] <freeone3000> camcorder: In Java, String[] is an Object.
[12:15:35] <dreamreal> I've done a hell of a lot of C++, too, but then again, this is why Java has no operator overloading
[12:15:36] <camcorder> dreamreal, since [] notation comes from C
[12:15:37] <asfdd> ty
[12:15:39] <asfdd> that worked =)
[12:15:42] * dreamreal sighs
[12:16:06] <Ruudjah> dreamreal: this is why Java has no operator overloading --> what?
[12:16:09] <freeone3000> It's amazing how little Java behaves like C.
[12:16:11] <Ruudjah> *why
[12:16:13] <dreamreal> camcorder: okay. Look: Collections are almost always better than arrays. Not always. In the cases where they're not better, you'll know. Move along.
[12:16:24] <dreamreal> Ruudjah: because morons overload stuff such that the language no longer becomes simple
[12:16:51] <Ruudjah> looking to perl6 i tend to agree
[12:17:25] <Ruudjah> and .add or .multiply is just more expressive
[12:17:56] <camcorder> dreamreal, out of topic, but why it makes you so happy to call people 'moron'?
[12:18:06] <camcorder> dreamreal, do you feel more clever or something?
[12:18:13] <mapreduce> It brings them up to his level.
[12:18:20] <dreamreal> camcorder: If you think it makes me happy to call people morons, you don't know me very well at all.
[12:18:40] <dreamreal> Did I call you a moron, or is this a general "stand up against the man" type feeling?
[12:18:54] <dreamreal> oh, I bet you're a great fan of operator overloading
[12:19:05] <Ruudjah> camcorder: I can totally understand dreamreal's thing, because he's here always when I am giving good answers. He has prolly seen a lot in java world.
[12:19:11] <freeone3000> It made C++ syntax what it is today.
[12:19:29] <Candle> Don't worry, he calls everyone a moron when they fail to grasp a concept after 5 pages of IRC.
[12:19:31] <camcorder> dreamreal, no it's just sickening to see no code of conduct in this channel
[12:19:31] <Ruudjah> *I am* -> *dreamreal is*
[12:19:48] <dreamreal> Candle: I don't think I've called anyone HERE a moron directly.
[12:20:02] <dreamreal> not in recent memory. I certainly use the term, but abstractly, and not personally.
[12:20:20] <dreamreal> then again, people get offended easily because they're *****s.
[12:20:31] <camcorder> Candle, well not answering is always an option, and if you ask me, better than offensive behavior.
[12:20:49] <Candle> ~ smart questions
[12:20:49] <javabot> Not getting the kind of responses you'd like? Read this: http://www.mikeash.com/getting_answers.html
[12:20:52] <dreamreal> camcorder: well, here's one very true thing: I really don't care about you
[12:20:53] <camcorder> dreamreal, well I'm not talking directly to you
[12:20:56] <Candle> ^ those work very well.
[12:21:00] <Ruudjah> "offensive"?
[12:21:03] <dreamreal> camcorder: yet you did ask me
[12:21:04] *** xiliax has joined ##java
[12:21:20] <dreamreal> Ruudjah: apparently the use of the term "moron" in general is offensive.
[12:21:37] <camcorder> dreamreal, well it was just strange that you unnecessarily called *someone* moron
[12:21:53] <camcorder> dreamreal, that's not how people talk in Real Life, and I don't see why it would be much different in here
[12:22:01] <dreamreal> camcorder: ah, and I have no right to express my opinion abotu how people misuse operators?
[12:22:07] <dreamreal> camcorder: maybe it's how I talk in real life?
[12:22:12] <Ruudjah> iirc afaik that _is_ how people talk irl.
[12:22:13] <camcorder> dreamreal, really?
[12:22:24] *** chl5011 has left ##java
[12:22:28] *** aLeSD has joined ##java
[12:22:29] <aLeSD> hi all
[12:22:30] <dreamreal> camcorder: maybe it is, maybe it isn't.
[12:22:56] <dreamreal> IRL, I actually stay pretty quiet. But then again, I don't lie to people. If I think something is stupid, I say so.
[12:23:03] <aLeSD> dreamreal, may I use a JNI class as a normal java class ?
[12:23:19] <dreamreal> aLeSD: no.
[12:23:33] <aLeSD> dreamreal: what do u mean ?
[12:23:46] <dreamreal> aLeSD: no, you can't use a JNI class as a normal java class.
[12:23:50] <aLeSD> I am having an exception when I extend from it
[12:24:06] <dreamreal> well, a class that uses native code can certainly be a normal java class.
[12:24:33] <aLeSD> no problem with extends from them
[12:24:41] <aLeSD> ok
[12:24:43] <aLeSD> thanks
[12:25:32] <Ruudjah> dreamreal, camcorder: http://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html?1
[12:26:02] <camcorder> dreamreal, well then I need to remind you, you can't measure IQ of people in no way (psychology has not developed enough to do that) and all your judgment about intelligence of people is subjective. And like all subjective things, it's wrong.
[12:27:24] <dreamreal> camcorder: oh, I'm sorry. You must be one of those people who takes everything literally, and assumes the use of a term that has specific meaning in one context but has no such specific meaning in another is ALWAYS intended literally and not colloquially.
[12:28:17] <dreamreal> I had no intention of offending your sensibilities, nor was I meaning for you to be offended on behalf of stupid behavior everywhere. My apologies.
[12:28:22] *** terranova has quit IRC
[12:28:33] <ztj> camcorder: what a strange non-sequitur, calling subjective things "wrong"
[12:28:49] <evermean> Hi I have a Problem with an RMI Example
[12:29:16] <ztj> RMI is a problem
[12:29:21] <evermean> I'd like to call a remote method from my client
[12:29:33] <evermean> but everytime i do
[12:29:59] <evermean> i get this
[12:30:11] <evermean> Client exception: java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.lang.ClassNotFoundException: Adder (no security manager: RMI class loader disabled) ....
[12:30:27] <evermean> I am not quite sure where to look for the problem
[12:30:49] <dreamreal> Adder isn't available somewhere.
[12:31:01] <evermean> Could it be that the security manager doesn't allow me to do this operation?
[12:31:12] <dreamreal> no.
[12:31:19] <ztj> evermean: is Adder on your client's classpath?
[12:31:21] <dreamreal> Adder isn't available somewhere it's supposed to be.
[12:31:23] *** riotz has joined ##java
[12:31:27] <evermean> oh ok
[12:32:08] <ztj> it's disabled remote classloading because you're not sandboxing it, I imagine there's an override for that but it doesn't work very well anyway, so make sure your remote classes are also available on the local CP and match up
[12:32:19] <evermean> but the tutorial (...which is quite bad anyway) states that the classes don't need to be available in Java 6
[12:32:34] <evermean> don't know if thats right or not
[12:32:38] <ztj> evermean: just go ahead and give it a try eh?
[12:32:48] <ztj> then go back to figuring out how to make it work with remote classloading
[12:33:35] <evermean> alright i'll give it a try and let you know if it works
[12:33:45] <evermean> thanks a lot! ;)
[12:33:51] <obiwahn> http://stackoverflow.com/questions/3823122/special-things-to-do-when-using-rmi-plugins
[12:33:59] <ztj> good luck, I meant what I said when I said RMI is a problem :)
[12:34:09] * ztj wonders if they ever fixed the stupid spaces in path bug
[12:34:15] *** topriddy has joined ##java
[12:35:26] *** gerts has joined ##java
[12:35:44] *** chandan_kumar has quit IRC
[12:36:31] *** obiwahn has quit IRC
[12:37:29] *** Luc1fel has joined ##java
[12:40:32] *** vonZeppelin has joined ##java
[12:40:45] *** aLeSD has quit IRC
[12:41:08] <vonZeppelin> Hello! Does anybody here have an experience working with FreeHEP VectorGraphics package?
[12:43:49] <fr0ggler> ~ask
[12:43:49] <javabot> The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
[12:43:52] <fr0ggler> ~tech support
[12:43:52] <javabot> Hello, ##java is not a technical support channel for your Java apps or virtual machines, it is a development enthusiast channel which prefers to receive questions and discussion on the topic of programming with the Java language. Please consider seeking help with the vendor of your software if you can't figure out how to use it.
[12:44:01] <fr0ggler> vonZeppelin, bear both of those in mind :)
[12:44:26] *** obiwahn has joined ##java
[12:44:58] <Planck_> Thanks for asking, vonZeppelin. I have no experience with it at all, in fact your question was the first I had ever heard of it.
[12:48:28] *** jogla has quit IRC
[12:48:35] *** jjido has quit IRC
[12:48:38] *** jogla has joined ##java
[12:49:08] *** jjido has joined ##java
[12:52:03] *** homie has joined ##java
[12:52:12] <vonZeppelin> Planck_: It is never too late to learn
[12:52:25] <dreamreal> vonZeppelin: hahaha
[12:52:28] <dreamreal> nice retort :)
[12:52:54] <dreamreal> I don't think it'll get Planck_ to ... you know, gain any experience with it
[12:53:01] *** gelignite has joined ##java
[12:54:48] *** devkhadka has quit IRC
[12:55:37] *** jjido has quit IRC
[12:56:56] <dreamreal> plus, you still haven't actually asked a question about it
[12:57:13] *** jjido has joined ##java
[12:58:30] <vonZeppelin> dreamreal: My question is about converting an EMF image to raster image by means of Java :)
[12:58:58] *** obiwahn has left ##java
[12:59:10] <vonZeppelin> FreeHEP is the only open source lib I know which can do this. But I have some troubles with specific file
[12:59:57] <vonZeppelin> So if somebody had heavily used it, his/her experience could be much appreciated
[13:00:36] <dreamreal> vonZeppelin: but see, now there's something that can actually be addressed. For example, if it's NOT the only open source lib, maybe someone else can give you a pointer.
[13:00:40] <dreamreal> I certainly cannot.
[13:01:10] *** gerts has quit IRC
[13:01:32] <vonZeppelin> I can't google an alternative, only commercial Aspose.Metafiles
[13:01:46] <vonZeppelin> And that's all
[13:02:33] <dreamreal> I can dig it.
[13:03:34] <vonZeppelin> dreamreal: Thanks for your help
[13:04:10] <ztj> vonZeppelin: have you looked into Batik?
[13:04:16] <dreamreal> sorry, man.
[13:04:21] *** matsebc has quit IRC
[13:04:48] <ztj> it can read WMF, maybe EMF? it can also output to PNG/JPG
[13:05:23] <vonZeppelin> ztj: Just barely. Yep, it supports WMF, but not EMF
[13:05:52] *** matsebc has joined ##java
[13:07:08] <Planck_> Can't say I've ever needed EMF (I've barely heard of it)
[13:07:54] <cheeser> great music, though.
[13:08:24] <ztj> Planck_: that's... unbelievable
[13:08:26] <vonZeppelin> cheeser: lol
[13:08:49] *** Cymage has joined ##java
[13:09:59] <dreamreal> ztj: well, *MF sounds vaguely familiar to me too but I couldn't tell you offhand what characteristics the extensions imply
[13:10:39] <ztj> dreamreal: I don't need you to. You seem confused.
[13:10:53] *** Xeli has joined ##java
[13:11:19] <dreamreal> I was identifying with Planck_'s unfamiliarity
[13:11:48] <ztj> Oh... You missed a joke.
[13:12:25] <ztj> Search you tube for "emf unbelievable"
[13:13:02] *** Diffraction has joined ##java
[13:14:11] <selckin> just embrase the imagemagick
[13:14:28] <whaley_> and with that, ##java has officially Jumped the Shark
[13:14:42] *** jjido has quit IRC
[13:14:50] *** jjido has joined ##java
[13:14:54] *** jogla_ has joined ##java
[13:15:00] <cheeser> that phrase has jumped the shark.
[13:15:05] <cheeser> 8^)=
[13:15:27] <whaley_> how meta.
[13:15:53] *** whaley_ has quit IRC
[13:16:54] *** [[thufir]] has quit IRC
[13:17:02] <vonZeppelin> selckin: ImageMagick supports EMF only on Win, I'm trying to find pure Java / cross-platform solution
[13:17:31] <selckin> if imagemagick can't do it, just give up
[13:17:45] <ztj> Pay money
[13:17:53] <ztj> Problem solved.
[13:17:53] *** maxorator has joined ##java
[13:18:57] *** jogla has quit IRC
[13:18:58] *** jogla_ is now known as jogla
[13:19:29] <vonZeppelin> FreeHEP has almost fitted, I can't convert EMFs only from one source, so I'm tryin' to find whether I missed something
[13:20:28] <ztj> Can't read FreeHEP without mentally appending CAT
[13:21:28] *** Diffraction has quit IRC
[13:21:56] <vonZeppelin> The channel should be renamed to Java minded music lovers :)
[13:22:23] *** mescalinum has joined ##java
[13:23:39] <ztj> Heh
[13:23:46] <ztj> Maybe
[13:23:59] *** fredim has joined ##java
[13:29:12] *** linkstack has joined ##java
[13:29:28] *** LinGmnZ has joined ##java
[13:29:35] *** jogla has quit IRC
[13:29:45] *** jjido has quit IRC
[13:31:05] *** kba has quit IRC
[13:31:24] *** jjido has joined ##java
[13:33:23] *** jonkri has quit IRC
[13:33:45] *** sebersole has quit IRC
[13:35:44] *** bitshuffler has quit IRC
[13:35:47] *** jjido has quit IRC
[13:36:06] *** LinGmnZ has quit IRC
[13:36:17] *** jjido has joined ##java
[13:38:55] *** pipeep has quit IRC
[13:39:38] *** pipeep has joined ##java
[13:40:51] <Pinas> can someone tell me, how to call the getMethods() method form a class, from which I only have the name stored in a string variable ?
[13:40:59] <Pinas> s/from/on/
[13:41:08] *** L-----D has quit IRC
[13:41:09] <dreamreal> Pinas: Class.forName() loads the Class, then there you go
[13:41:27] <dreamreal> it's like pie, but involving no puns or circles.
[13:42:31] <cheeser> ~~ Pinas reflection
[13:42:31] <javabot> Pinas, reflection is a set of APIs that allow programs to interrogate classes for field and method information. See http://download.oracle.com/javase/tutorial/reflect/index.html
[13:45:17] <Pinas> merci :)
[13:48:09] *** matsebc has quit IRC
[13:48:15] <gener1c> these are my in-order pointer updating methods for an avl tree http://pastie.org/1659387 , i added the del to my remove method and the add to my insert method
[13:48:57] <gener1c> but for some reason its changes the pointers in an odd way
[13:49:11] <gener1c> when inserting all seems fine
[13:49:23] <gener1c> when removing its ok as well with the first one removed
[13:49:42] <gener1c> but then it goes berserk
[13:49:54] <gener1c> i have been dwelling on this for hours
[13:50:00] *** pipeep has quit IRC
[13:50:01] <gener1c> days* noow
[13:50:23] <dreamreal> gener1c: this is java, no pointers!
[13:50:41] <gener1c> oop pointers
[13:50:50] <gener1c> not c pointers
[13:50:57] <dreamreal> gener1c: plus: a debugger should show you what's happening :)
[13:51:09] <gener1c> i dont know how to use a debugger
[13:51:14] <gener1c> it debug manually
[13:51:15] *** jjido has quit IRC
[13:51:19] <dreamreal> gener1c: time to learn
[13:51:33] <dreamreal> it would have taken you an hour to learn a debugger, instead of the days you've wasted with manual debugging
[13:51:38] <dreamreal> lastly: test case.
[13:51:53] <gener1c> well
[13:52:33] <gener1c> the methods seem right am i correct?
[13:52:37] <gener1c> its something else
[13:52:48] <gener1c> like where and when im invoking them
[13:52:56] *** jjido has joined ##java
[13:53:49] <gener1c> i tried looking for a mistake and i cant find it
[13:54:00] <Planck_> The mistake is not using a debugger.
[13:54:15] <gener1c> yeah well a debugger wont show me the state of my nodes
[13:54:21] <gener1c> it will just take me line by line
[13:54:25] <Planck_> Yes it will, that's the whole point.
[13:54:39] <gener1c> nice
[13:55:54] <dreamreal> heh
[13:56:09] <dreamreal> "a debugger will SOOOO not do stuff like help me debug, that's why it's called a debugger"
[13:56:33] <gener1c> it cant be that good
[13:56:48] *** drindt has quit IRC
[13:56:48] *** igorklem has quit IRC
[13:58:07] <dreamreal> "I've got this nail I need to get into this wood, man, why on earth would I ever consider using a hammer for THAT"
[13:58:25] <dreamreal> gener1c: well, last year in 2001 they came up with all kinds of neat ideas for debuggers.
[13:58:41] <dreamreal> They can actually inspect your "data" "structures" and show you "what" is "happening"
[13:59:08] <Planck_> The simpler solution is to hit the nail with the wood until it goes in.
[13:59:27] *** jjido has quit IRC
[13:59:36] <Planck_> That way you don't have to learn new tools, and don't waste space in your toolbox.
[14:00:05] *** djbpython has joined ##java
[14:00:13] <dreamreal> actually they've been able to inspect data structures since 1986, but who cares, details are overrated
[14:01:13] <dreamreal> and yet again: test case
[14:01:37] *** Softdroid has joined ##java
[14:02:46] *** Softdroid has left ##java
[14:02:55] *** odinsbane has joined ##java
[14:03:06] *** Softdroid has joined ##java
[14:03:12] *** pen has joined ##java
[14:03:14] <selckin> wow that's like after i was born, so young
[14:03:31] * dreamreal now feels REALLY old
[14:03:43] *** Softdroid has left ##java
[14:04:07] *** msieradzki has joined ##java
[14:07:21] *** Softdroid has joined ##java
[14:07:38] *** LinkRage has joined ##java
[14:08:27] *** linkstack has quit IRC
[14:09:54] *** BSWolf has quit IRC
[14:11:11] *** jjido has joined ##java
[14:12:16] *** RLa has quit IRC
[14:13:06] *** pen has quit IRC
[14:15:44] *** mek||malloc has left ##java
[14:20:08] *** glcrazy has quit IRC
[14:20:13] *** mordu has quit IRC
[14:20:14] *** wh1t3 has quit IRC
[14:20:14] *** pfrog has joined ##java
[14:20:14] <pfrog> can javafx somehow stream from http?
[14:20:19] <cheeser> sure
[14:20:24] <cheeser> it's just java
[14:20:46] *** robbyoconnor has quit IRC
[14:21:39] <pfrog> if its an applet won't that require the user to click through some dialogs though?
[14:21:39] <pfrog> basically I want a fast streaming plotter
[14:21:39] <pfrog> javafx + java + streaming http seems to be a nice way to do it
[14:21:39] <pfrog> I tried just plain js and svg, it requires a ton of memory and cpu
[14:21:51] <dreamreal> pfrog: JNLP
[14:21:59] <cheeser> ~applets
[14:21:59] <javabot> Check the topic, read http://javachannel.net/wiki/pmwiki.php/FAQ/Applets - Basically, we don't support them here. Try the sun forums at http://tinyurl.com/2q2hog; consider the new Windows/OS X/Linux 32/64bit JNLP-compatible "Plugin2" from Java 6u10 (http://java.sun.com/javase/6/webnotes/6u10/plugin2/index.html)
[14:22:11] <pfrog> honest opinion on whether my new route might work or not would be cool :-)
[14:22:13] *** zhulikas has quit IRC
[14:22:25] <cheeser> use jnlp
[14:22:27] <cheeser> ~jws
[14:22:28] <javabot> jws aka javaws aka webstart aka jnlp (Java Network Launching Protocol) is a web-based java app deployment mechanism that is better than applets because it removes browser incompatibility hell. You can run any app as normal, via its main() entry point. For tech guide see http://bit.ly/bQqkI9 and for product overview see http://bit.ly/aYUQKq (javaws is free and included with java).
[14:22:37] <pfrog> I see, web start
[14:22:38] *** LinkRage has quit IRC
[14:22:49] <pfrog> nice
[14:24:12] *** jjido has quit IRC
[14:25:35] <pfrog> if thats the case maybe I can just use livegraph itself then
[14:25:45] <sveajobb> how would I detect if any input was made available on my pipe (mkfifo) from within my java app? I thought of using FileChannel along with my ordinary selector, but it doesn't look like that is a valid approach, any pointers?
[14:26:04] *** coalado1 has joined ##java
[14:27:07] <Pinas> ?hm if I only have the name of a class e.g Testfile can I somehow obtain the Packagename (in order to use this class in Class.forName() ????
[14:27:08] *** evermean has quit IRC
[14:27:10] *** vonZeppelin has left ##java
[14:27:22] <Wizard> hmm, intellij has pretty neat and responsive gui
[14:27:36] <Wizard> i wonder what libs do they use
[14:27:42] <dreamreal> Wizard: swing.
[14:27:46] <dreamreal> jgoodies, too, I believe
[14:28:53] *** tilerendering has joined ##java
[14:29:05] *** coalado has quit IRC
[14:30:44] <paulweb515> Pinas: where did you get Testfile from? have that provide the package as well
[14:31:29] <Pinas> I get the String Testfile from annovention http://annovention.googlecode.com/
[14:32:32] *** [[thufir]] has joined ##java
[14:33:04] <paulweb515> Pinas: I don't see the word Testfile anywhere on that page
[14:33:59] <Pinas> no Testfile is a file that I created
[14:34:10] *** hyppias has joined ##java
[14:34:16] <Pinas> annovention searches for classes which contain specific annotation
[14:34:30] <Pinas> and then stores the name of this classes
[14:34:36] <paulweb515> Pinas: then you know what the package is ...
[14:34:53] *** hyppias has joined ##java
[14:34:59] <Pinas> actually I just figured out that i am till in the default package
[14:35:06] <Pinas> s/till/still/
[14:35:21] <paulweb515> Pinas: yes, and in general reflection will provide the package as well
[14:35:25] <paulweb515> ~~ Pinas javadoc Class
[14:35:26] <javabot> Pinas: http://is.gd/jIXeo [JDK: java.lang.Class]
[14:35:29] <dreamreal> hah, but you're not ... you know not to USE the default package, right?
[14:35:46] *** frangiz has quit IRC
[14:35:51] <hyppias> what do I do to an xsd file to get XJC/JAXB/JAXB Basics generate a toString method ?
[14:36:24] <Pinas> jea dreamreal I know that I should not use the default package :)
[14:37:36] <Xeli> Is a public method in a nested class with is synchronized, synchronized with the inner class or the 'outer' class?
[14:37:48] *** plarsen has joined ##java
[14:38:00] *** PigFlu has quit IRC
[14:38:04] <Xeli> after writing it down it seems kinda obvious it's probably the inner class.. >,<
[14:39:06] *** fredim has quit IRC
[14:39:28] *** stimpie has joined ##java
[14:40:14] <stimpie> Could someone tell the 'cost' of a System.currentTimeMillis() call? Will it result in a system call?
[14:41:03] <dreamreal> stimpie: it's a context change. It calls ctime() under the covers, possibly time().
[14:41:28] <dreamreal> you're the second person in two days that I've seen being concerned about the system impact of System.currentTimeMillis().
[14:42:07] *** frangiz has joined ##java
[14:43:25] <stimpie> I suspect its a frequently asked question, although google is not filled with answers.
[14:43:51] *** jjido has joined ##java
[14:43:57] <dreamreal> why would it be a frequently asked question, though? getting the current milliseconds from the epoch is ... like... by requirement not a performance hit
[14:44:26] *** arborist has joined ##java
[14:44:43] *** EricInBNE has joined ##java
[14:44:52] *** gener1c has quit IRC
[14:45:04] <stimpie> since the doc says: "the value depends on the underlying operating system" which could mean it results in a syscall
[14:45:11] <mapreduce> Maybe it waits until the number of milliseconds is a prime number.
[14:45:14] <dreamreal> and it does!
[14:45:15] <stimpie> lol
[14:45:23] <dreamreal> but is that system call an expensive one?
[14:45:42] <dreamreal> Do you think it cranks up a shell and then consumes the output of /bin/date or something?
[14:46:14] <fr0ggler> it means your benchmark will say 8ms instead of 7ms!
[14:46:23] <fr0ggler> the humanity!
[14:46:31] <dreamreal> fr0ggler: if it has that kind of impact, you really need to get off your 100MHz processor
[14:46:39] * fr0ggler pedals faster
[14:47:47] *** djbpython has quit IRC
[14:47:56] *** MikeJansen has joined ##java
[14:48:02] <stimpie> I my case it might be of impact and I have the option of adjusting my design to limit the use
[14:49:41] <dreamreal> well, I do have to say, any time you have 800K calls to System.currentTimeMillis() at the same time, well, you should expect some performance
[14:50:20] <stimpie> and the result of most calls would be exactly the same
[14:50:53] <dreamreal> indeed.
[14:51:58] *** l2trace99 has joined ##java
[14:52:15] <dreamreal> there's also nanoTime() which doesn't protect you from granularity but may give you finer resolution.
[14:53:02] <Xeli> Could anyone help me with this problem: http://ideone.com/gXtdw I want to make onClick() at line 9 threadsafe
[14:53:02] *** plarsen has quit IRC
[14:53:11] *** ech0s7 has joined ##java
[14:53:14] *** alex88 has joined ##java
[14:53:46] *** matsebc has joined ##java
[14:55:21] <paulweb515> Xeli: are you using Swing/AWT?
[14:55:33] <paulweb515> Xeli: or conversely, what's calling onClick
[14:56:05] <Xeli> paulweb515, no it's Android. The main UI thread is calling onClick, and foo isbeing called by either my gameThread or the UIThread
[14:56:10] <ech0s7> i have a design question: If i have an {abstract class A} that has an association with another {class B}. So inside class A i have a reference to an instance of B. My quesion is: if i extends class A with a concrete {class concreteA} what is the best way to access to instance of B? make reference protected or put a method like getB() inside {abstract class A} ?
[14:56:34] <paulweb515> If you've already synced foo(), what's the problem?
[14:56:50] <dreamreal> ech0s7: I don't think it matters
[14:57:04] <dreamreal> ech0s7: getB() is probably wisest, but... *shrug*
[14:57:16] <Xeli> paulweb515, onClick does not call foo() but does other 'stuff'
[14:57:19] *** jjido has quit IRC
[14:57:40] *** jjido has joined ##java
[14:57:55] <Xeli> so while the gameThread might be executing foo() i don't want to UI thread calling onClick()
[14:58:14] <paulweb515> Xeli: then you would have to pick the same object and sync on that
[14:58:32] <odinsbane> Xeli: what do you want to happen when the UI tries to call on
[14:58:36] *** ghutzriop has joined ##java
[14:58:51] <odinsbane> onClick but gameThread is executing foo()?
[14:58:59] <paulweb515> Xeli: you can simply create an object instance and use that in both places, or if you're just going to use the parent instance, sync on Parent.this in your inner
[14:59:18] <Xeli> paulweb515, like i did below? it just seem nice to me..
[14:59:22] *** terranova has joined ##java
[14:59:26] <Xeli> odinsbane: just block untill foo() is done
[14:59:30] *** terranova has quit IRC
[14:59:53] <Xeli> oh Parent.this could do the trick..
[15:00:02] *** terranova has joined ##java
[15:01:46] *** bulltwang has quit IRC
[15:02:26] *** frangiz has quit IRC
[15:02:34] <paulweb515> Xeli: well, it's the same thing you have, just without an extra field
[15:03:12] *** ghutzriop has quit IRC
[15:03:38] *** respecting has quit IRC
[15:04:12] <Xeli> paulweb515: true.. maybe im overcomplication things, anyway i'll do it this way. Thanks ;)
[15:07:40] <Wizard> dreamreal: jgoodies indeed have this theme, thanks!
[15:08:24] <gartt> ClassA and ClassB inherit from Superclass. How do you instantiate ClassA and ClassB though the same Superclass object?: If you instatantiate and cast Superclass down to ClassA, you can't then cast Superclass down to ClassB to use because ClassA and ClassB aren't compatible types
[15:08:53] <odinsbane> gartt how about a factory method?
[15:09:42] <Pinas> ?hm I have an variable of the Annotation, can I cast this somehow in a Annotation of my desired typ (in order to get the parameters) ???
[15:10:39] *** jjido has quit IRC
[15:10:56] <sveajobb> how do I perform a fopen(file, "r+"); in java? I need to open a pipe for read+write so that it doesn't block
[15:11:07] <cheeser> ~io
[15:11:07] <javabot> For information on handling input/output in java see http://download.oracle.com/javase/tutorial/essential/io/
[15:11:08] <cheeser> ~nio
[15:11:08] <javabot> cheeser, nio is the New I/O framework, which supports (among other things) non-blocking I/O and memory-mapped files. It's relatively hard to use though. See http://is.gd/k13w [sun.com] and http://is.gd/k13Q [pdf file at oswego dot edu] for more info, and ask me about ~xnio, ~netty, ~rnio, ~mina, and ~grizzly.
[15:11:28] *** ab500 has quit IRC
[15:11:49] *** BSWolf has joined ##java
[15:12:41] *** frangiz has joined ##java
[15:12:44] <gartt> odinsbane: Thanks
[15:13:16] <sveajobb> cheeser, thank you for the links, although I've been on those pages for hours now and can't really find the thing I'm looking for, if you could just namedrop a specific class so I could do some more digging around that specific class I'd be happy
[15:13:28] <cheeser> FileChannel perhaps.
[15:13:48] <paulweb515> Pinas: do you know your annotation?
[15:13:51] *** epalm has joined ##java
[15:14:19] <Pinas> paulweb515 - yes
[15:15:53] *** ab500 has joined ##java
[15:16:24] <sveajobb> cheeser, the problem is that just doing new InputStream("file"); will block forever so will new OutputStream("file"); I want new InputOutputStream("file"); I've found that in java 1.7 there are some stuff you can do with the Path class, but I'm on java 1.6
[15:16:27] *** topriddy_ has joined ##java
[15:16:41] <cheeser> new InputStream() shouldn't block (that long)
[15:17:00] <cheeser> grizzly 2.0 has some async Streams, iirc
[15:17:00] * dreamreal eyes RandomAccessFile
[15:17:15] <sveajobb> cheeser, well I'm opening a named pipe (created by unix tool mkfifo)
[15:17:17] *** ghutzriop has joined ##java
[15:17:42] <paulweb515> Pinas: you have an Annotation class?
[15:17:54] <sveajobb> I just wrote a small c-app, it blocks if I do fopen("file", "r"); but if I do fopen("file", "r+"); (read+write) it works instantly
[15:18:06] <Pinas> paulweb515 - yes
[15:18:43] <Pinas> i need the parametes stored in the Annotation Variable (got it via getAnnotations)
[15:18:52] *** jjido has joined ##java
[15:18:55] *** riotz has quit IRC
[15:19:17] <paulweb515> Pinas: I've seen code like: Annotation annotation = ...; if (annotation.annotationType().equals(clazz)) return clazz.cast(annotation); .. where clazz is something like Named.class
[15:19:34] *** topriddy has quit IRC
[15:19:35] *** topriddy_ is now known as topriddy
[15:20:25] *** BSWolf has quit IRC
[15:20:29] <Pinas> ok i'll try it thx paulweb515
[15:21:04] *** lmatteis has joined ##java
[15:21:06] <lmatteis> hi
[15:21:16] <paulweb515> maybe that's overly complicated and you just need Named a = (Named)annotation; ?
[15:21:19] <lmatteis> in my jsp i can do stuff like ${nickname} to output attributes from my response
[15:21:37] <lmatteis> where can i find documentation on this? like id like to do if statements and other logical operations on this data
[15:21:51] *** Matuku has joined ##java
[15:21:59] <Wizard> you don't want to place logic in jsp
[15:22:00] <Wizard> :>
[15:22:18] <Wizard> ~jstl
[15:22:18] <javabot> Wizard, jstl is JavaServer Pages Standard Tag Library, http://java.sun.com/products/jsp/jstl/
[15:22:41] <Wizard> i hope it is what you need
[15:22:56] <lmatteis> Wizard: i know - it's basic logic though. like i'm passing the username of a user (a plain string) to my jsp - and id like to at least check if the username is null or not so that I can show the "logout" text instead of "login"
[15:23:42] <lmatteis> how else would you do this without basic logic operations in my template?
[15:24:27] <Wizard> nah, i'm not much into jsp, there was something like filter..
[15:24:37] *** horte has joined ##java
[15:24:46] <Wizard> could somebody more experienced answer that question? :>
[15:25:26] <dreamreal> lmatteis: <c:if>
[15:25:29] <alex88> if i have to run the same thread n times (each with different arguments) and have at least m threads running in the same time what should i use?
[15:25:41] <dreamreal> or test or something like that. JSTL makes it very easy to test.
[15:26:14] *** Caleb-- has joined ##java
[15:26:37] *** jdolan has joined ##java
[15:29:20] *** BSWolf has joined ##java
[15:29:24] *** EricInBNE has quit IRC
[15:29:59] *** FireSlash has joined ##java
[15:30:08] *** Sambler has joined ##java
[15:30:22] *** zemanel has quit IRC
[15:32:45] *** tissue has quit IRC
[15:33:53] *** sebersole has joined ##java
[15:34:01] *** jjido has quit IRC
[15:34:07] *** _Jorde has quit IRC
[15:35:16] *** switch has joined ##java
[15:35:30] *** jesmon has joined ##java
[15:35:31] *** jjido has joined ##java
[15:35:53] *** gtrak has joined ##java
[15:36:05] *** Johannes13 has joined ##java
[15:36:10] *** frangiz has quit IRC
[15:36:24] *** glcrazy has joined ##java
[15:36:52] *** frangiz has joined ##java
[15:39:03] *** djbpython has joined ##java
[15:39:34] *** gcristian has joined ##java
[15:40:07] *** VJTachyon has joined ##java
[15:40:10] <pfrog> I'm not even doing any serious plotting with javafx and its slower than svg + js
[15:40:50] <pfrog> you'd think without having to deal with a xml document as a middle man javafx would kick ass, apparently that hope is dashed
[15:42:12] *** matsebc has quit IRC
[15:44:43] *** jjido has quit IRC
[15:44:44] <cheeser> why would one think that?
[15:44:56] *** habbekratz has joined ##java
[15:44:56] <cheeser> oh, *without*
[15:44:57] <cheeser> 8^)=
[15:45:34] *** alex88 has quit IRC
[15:47:16] <habbekratz> I've been googling around trying to find out what sso solution is best compatible with spring but I can't seem to find articles more recent than januari 2010. Does anybody have some experience in this?
[15:47:42] *** terranova has quit IRC
[15:47:45] <gtrak> spring security?
[15:47:59] <habbekratz> thats not sso right??
[15:48:08] <gtrak> single-sign on?
[15:48:12] <habbekratz> yes
[15:48:20] <gtrak> it can do whatever you want it to
[15:49:00] *** sbalmos has joined ##java
[15:49:14] *** eyesUnclouded has joined ##java
[15:50:15] *** monaDeveloper has joined ##java
[15:50:19] <monaDeveloper> hello
[15:50:20] <gtrak> hmm, actually, spring security is hands off on that kind of stuff, it has a PreAuthentication scenario where you can plug in something else, maybe make your own filter
[15:50:52] <monaDeveloper> I'm trying to install jboss on mandriva but I can't find it on the package manager
[15:50:54] <gtrak> habbekratz, have a look at http://j.mp/crcQcy
[15:51:23] *** chandan_kumar has joined ##java
[15:52:49] *** jjido has joined ##java
[15:55:01] <bobbytek2> I have a need to convert an in memory list to an InputStream where the data is in csv format (mysql LOAD DATA LOCAL INFILE jdbc interface requirement)
[15:55:41] <bobbytek2> What would be the best approach optimizing for memory / speed ?
[15:55:48] *** blackswan has left ##java
[15:56:49] <bobbytek2> If I convert to string in memory, and then wrap the bytes in a ByteArrayInputStream, I essentially have the original list, the string, and the byte array in memory all at the same time
[15:57:53] <bobbytek2> If I use a file, I will slow down processing for small list sizes
[15:58:10] <habbekratz> gtrak thanks
[15:58:10] *** sebersole has quit IRC
[15:58:14] <bobbytek2> Is there an elegant solution for this, or should I just always use a file?
[15:59:33] <bobbytek2> Apache commons io has a "DeferredFileOutputStream" that I thought might be useful here, but I am open to other suggestions
[16:00:05] *** saml has joined ##java
[16:00:19] <odinsbane> bobbytek2: what if you make your own inputstream, and create an appropriate read method.
[16:02:52] <bobbytek2> odinsbane, well, one thing I was thinking was using StringReader and then wrapping that in an InputStream
[16:03:05] <bobbytek2> However, there is no Reader to InputStream adapter in the jdk
[16:04:17] *** frangiz has quit IRC
[16:05:31] *** TzilTzal has quit IRC
[16:06:45] <ech0s7> i'm looking for a xml writer portable on android/symbian anyone have any idea ?
[16:08:58] *** daark has joined ##java
[16:09:11] *** frangiz has joined ##java
[16:11:25] *** franzks has joined ##java
[16:11:57] <franzks> hello, in http://pastebin.com/ptcFkc2n lines 59 and 65, why doesnt the newline work?
[16:12:40] <cheeser> ~doesn't work
[16:12:40] <javabot> cheeser, 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)
[16:13:18] <franzks> well it doesnt work, it is not newlining where it is should supposed to
[16:13:19] <odinsbane> franzks: what do you mean 'doesn't work'. In windows/notepad a new line is '\r\n'.
[16:13:27] <franzks> ahhhh
[16:13:32] <franzks> thanks, ill try it
[16:14:10] <franzks> it works!
[16:14:14] <franzks> thanks odinsbane
[16:14:20] <sbalmos> ~next
[16:14:20] <javabot> Another satisfied customer. Next!
[16:14:23] *** zemanel has joined ##java
[16:14:26] *** mastroDani has quit IRC
[16:14:43] *** jjido has quit IRC
[16:15:13] <RogueShadow> Yeah not yet, I have thousands of pages to read before there's much need to actually ask a question.
[16:17:22] *** franzks has quit IRC
[16:19:46] *** homie has quit IRC
[16:20:58] *** dinesh___ has joined ##java
[16:21:05] *** dandre has quit IRC
[16:21:18] <dinesh___> hi all, is there an easy way to load a File into a String, for a given text encoding?
[16:22:42] *** bitshuffler has joined ##java
[16:22:54] <FauxFaux> No(t without Guava).
[16:23:06] *** monaDeveloper has quit IRC
[16:23:08] *** zatan has joined ##java
[16:23:23] <saml> why not?
[16:23:27] <saml> isn't it just file io?
[16:23:34] <saml> ~io
[16:23:34] <javabot> For information on handling input/output in java see http://download.oracle.com/javase/tutorial/essential/io/
[16:24:26] <FauxFaux> That's not easy, or, at least, certainly nowhere near as easy as CharStreams.toString(new FileReader(f, Charsets.UTF8)));
[16:25:07] <saml> what do you mean by easy?
[16:25:09] <saml> shorter?
[16:27:13] <FauxFaux> No finally blocks to get right (yes, I'm aware that you and I find these kind of things easy).
[16:27:13] *** jjido has joined ##java
[16:27:48] *** dcope has quit IRC
[16:28:51] <FauxFaux> Actually, I guessy ou have to close that filereader. ¬_¬ Nevermind.
[16:32:30] *** Caleb-- has quit IRC
[16:34:00] *** caverdude has joined ##java
[16:34:40] *** riotz has joined ##java
[16:35:42] *** sebersole has joined ##java
[16:38:18] *** b3nny has joined ##java
[16:39:33] *** homie has joined ##java
[16:39:56] *** mosgjig has joined ##java
[16:40:34] *** freeone3000 has quit IRC
[16:40:34] *** jjido has quit IRC
[16:40:35] <mosgjig> i have a jpa question, is this an appropriate spot for it?
[16:42:47] *** surial has joined ##java
[16:43:14] <Pinas> If I use annotations how do i usually handle the configuration data ? Do i parse all annotantions before I do something else in the programm or do I try to obtain the wich are relevant for a specific method when I use the method first ???
[16:43:19] *** jim has quit IRC
[16:43:30] *** Sambler has quit IRC
[16:43:48] <Pinas> *obtain the information
[16:44:37] *** gracenotes has quit IRC
[16:44:43] *** io2 has joined ##java
[16:44:53] <saml> <c:set var="x" value="<%= x %>" scope="request"/> ${x.path} is not same as <%= x.getPath() %>
[16:45:05] <saml> it looks like ${x.path} is cached somewhere
[16:45:14] *** Speed` has joined ##java
[16:45:22] *** Gracenotes_ has joined ##java
[16:45:48] *** Gracenotes_ is now known as Gracenotes
[16:49:58] *** Bombstone has joined ##java
[16:50:59] *** Error404NotFound has joined ##java
[16:51:39] *** matsebc has joined ##java
[16:52:40] *** Versuchen has joined ##java
[16:56:27] *** jjido has joined ##java
[16:56:46] *** White_Cat has quit IRC
[16:56:47] *** Softdroid has quit IRC
[16:56:59] *** chl5011 has joined ##java
[16:58:07] *** dframe has quit IRC
[16:58:16] *** eitch0000 has quit IRC
[16:59:02] *** cbeust has joined ##java
[16:59:04] *** durre has quit IRC
[16:59:12] *** realtime_ has joined ##java
[17:02:41] *** habbekratz has quit IRC
[17:04:05] *** White_Cat has joined ##java
[17:04:11] <mosgjig> Object A has a oneToMany relation to Object B... When i merge a brand new object A that has brand new objects B, jpa tries to save object B but is unable due to object A's ID being null. Why is it persisitng out of order? I'm using jpa annotations with hibernate driver.
[17:06:24] *** chl5011 has quit IRC
[17:07:02] *** chandan_kumar has quit IRC
[17:10:06] *** thpar has quit IRC
[17:10:09] <ech0s7> why i get error at line 14: http://pastebin.com/ghNjT0eC ?
[17:10:41] *** bindaas has left ##java
[17:10:43] <FauxFaux> I don't know, why do you get an error at line 14?
[17:10:51] *** wvdhaute has quit IRC
[17:11:17] <ech0s7> compiler say The method write(capture#9-of ?) in the type Mapper<capture#9-of ?> is not applicable for the arguments (T)
[17:11:23] <ech0s7> why not ?
[17:12:06] *** surial has quit IRC
[17:12:50] *** lmatteis has quit IRC
[17:14:11] *** sphenxes has joined ##java
[17:14:38] *** everythingWorks has joined ##java
[17:14:53] <everythingWorks> After using float[] shoud i reset them to null?
[17:15:12] <dreamreal> flaot f=null; // error
[17:15:24] *** teralaser has quit IRC
[17:15:36] <everythingWorks> float[] != float
[17:15:42] *** eyesUnclouded has quit IRC
[17:15:43] <cheeser> "no such symbol flaot"
[17:15:44] <everythingWorks> flaot in your case.. what ever it is;)
[17:16:24] <dreamreal> well, yeah
[17:16:28] *** jbwiv_ has joined ##java
[17:16:34] *** Nazcafan has joined ##java
[17:16:37] <cheeser> whatever flaots your baot
[17:16:39] <Nazcafan> !books
[17:16:49] <dreamreal> !goaway
[17:17:51] <fr0ggler> ~~Nazcafan books
[17:17:51] <javabot> Nazcafan, Download these two beginners' bibles free of charge: 1) Sun Java Tutorial at http://java.sun.com/docs/books/tutorial 2) Bruce Eckel's "Thinking in Java" at http://www.mindview.net/Books/TIJ
[17:18:09] <Nazcafan> hello, I am a decent C++ programmer and I was taught Java during my introductory course to OO, something like 7 years ago, which book would you recommend for a refresher and catch up?
[17:18:20] <cheeser> ~tij
[17:18:20] <javabot> cheeser, tij is Thinking in Java, by Bruce Eckel. See http://www.mindview.net/Books/TIJ4 - the free 3rd edition is missing information about Java 5 and 6.
[17:20:31] *** daark has quit IRC
[17:21:01] *** h0x5f3759df has joined ##java
[17:21:02] <jbwiv_> anyone here used wavemaker at all?
[17:21:54] *** everythingWorks has left ##java
[17:23:39] *** bojo has joined ##java
[17:25:09] <Nazcafan> cheeser is the printed 3d edition missing that information?
[17:25:16] <dreamreal> Nazcafan: yes
[17:26:17] *** riotz has quit IRC
[17:26:37] <Nazcafan> if I can afford it, would you recommend the 4th edition?
[17:26:57] <dreamreal> I don't actually care for TIJ
[17:27:00] <dreamreal> personally
[17:27:24] <Nazcafan> dreamreal, so what do you care about/recommend?
[17:27:40] <dreamreal> the java tutorial is usually enough
[17:27:43] <dreamreal> core java
[17:27:45] *** rnigam has joined ##java
[17:28:59] <jbwiv_> core java is very good
[17:29:11] <jbwiv_> covers the entire landscape
[17:29:12] *** the_intel has joined ##java
[17:29:14] <jbwiv_> or most
[17:30:30] *** EvilPenguin has joined ##java
[17:31:16] *** epalm has quit IRC
[17:31:18] *** matsebc has quit IRC
[17:31:34] *** dk_schrute has joined ##java
[17:31:42] *** dangertools has quit IRC
[17:32:12] <Nazcafan> jbiw, thank you, I'll bookmark that
[17:32:18] *** Matic`Makovec has joined ##java
[17:32:31] *** sha1sum has joined ##java
[17:32:40] <rnigam> anyone have experience with DOM XML parsing using Java?
[17:32:48] * dreamreal snrks
[17:33:02] <dreamreal> did you have a question that wasn't answerable with "yes" or "no?"
[17:33:08] <FauxFaux> ~~ rnigam ask
[17:33:08] <javabot> rnigam, The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
[17:33:24] <rnigam> Any good links or resources with regards to DOM XML Parsing
[17:33:32] <rnigam> using Java.
[17:33:56] <dreamreal> what are you trying to do, exactly?
[17:34:29] <rnigam> Let me use pastebin and ask the exact question !
[17:34:30] <sha1sum> Hey all. I have a List serialized into a file, and every time I write it out to the file I want the old List replaced. I'm not really too familiar with outputstreams and whatnot, so I was wondering if I write out a FileOutputStream, will it replace the previous contents like I'm wanting or is there something else I should be doing?
[17:34:58] *** MikeJansen has quit IRC
[17:35:02] <whaley> ~~ sha1sum tias
[17:35:02] <javabot> sha1sum, Try it and see. You learn much more by experimentation than by asking without having even tried.
[17:35:13] <whaley> sha1sum: and use a sha checksum to verify it works :)
[17:35:19] <sha1sum> haha
[17:35:21] *** MikeJansen has joined ##java
[17:36:10] *** mazzachre has quit IRC
[17:36:45] *** Nazcafan has quit IRC
[17:37:39] *** sveajobb has quit IRC
[17:37:42] *** topriddy has quit IRC
[17:37:43] *** k_89 has joined ##java
[17:39:04] *** matsebc has joined ##java
[17:40:02] <rnigam> Hi all so I have this: http://pastebin.com/4SyDSBHA xml file I am trying to parse. I was able to parse them easily until the child nodes begun having id tag on them. <staff id =2> and so on.. Please tell me how can I handle the id tag in Dom parser. If you want me to I can paste the code for the xml without element type id associated.
[17:40:45] *** stimpie has quit IRC
[17:40:57] <sbalmos> XPath //*[not(@id)]
[17:41:00] <dreamreal> that's not a tag, that's an attribute
[17:41:02] <saml> hey, when would jcr be useful?
[17:41:07] <sbalmos> saml: Never!
[17:41:12] <dreamreal> saml: when you have a lot of content to manage?
[17:41:54] <saml> why not use sql or nosql?
[17:41:54] <saml> or files?
[17:41:54] <dreamreal> JCR is classifiable as nosql
[17:41:54] <sbalmos> so is a filesystem
[17:41:54] <dreamreal> and JCR abstracts the filesystem away
[17:41:54] *** chandan_kumar has joined ##java
[17:42:05] <dreamreal> plus adds fulltext search and xpath
[17:42:16] *** dangertools has joined ##java
[17:42:24] *** topriddy has joined ##java
[17:42:24] <saml> is sql bad? in your experience does data structure changes frequently ?
[17:42:27] <rnigam> sbalmos: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "id". this is the error I am getting and using getElementsByTagName method from the nodelist created
[17:42:30] <saml> forcing you to change table
[17:42:42] <dreamreal> saml: depends on the environment. SQL is bad because relational databases are slow.
[17:42:59] <saml> jcr is slow. it's not web scale
[17:43:09] <dreamreal> saml: okay, never mind.
[17:43:17] <whaley> oh dear
[17:43:33] *** teralaser has joined ##java
[17:43:48] <sbalmos> rnigam: I answered the original question. If you have code you're screwing around with, pastebin that.
[17:43:58] <sbalmos> This channel is not going to guess what you're doing
[17:43:59] <dreamreal> BTW, folks, just in case you're actually interested in real data instead of straw men: Infoq used a standard jackrabbit installation early in its lifecycle, and they were slashdotted. They did NOT have content caching in place, yet withstood the slashdotting easily.
[17:44:23] *** gremmachook has joined ##java
[17:44:25] <dreamreal> so take "it's not web scale" with a giant grain of sal.
[17:44:27] <sbalmos> real data's for weenies
[17:44:39] <sbalmos> I won't believe it until FOX says so
[17:45:18] <rnigam> sbalmos:http://pastebin.com/dGqPcWEu
[17:45:21] <dreamreal> in general, adding CDN to JCR is a great way to slow it down dramatically, but if you use schemaless types it's fast as hell for almost everything.
[17:45:24] *** jogla has joined ##java
[17:45:57] <whaley> dreamreal: uhm... why would a CDN of any kind slow it down?
[17:46:14] <dreamreal> whaley: the validation stuff adds a lot of overhead to the datastore.
[17:46:49] *** topriddy has quit IRC
[17:46:56] <dreamreal> this is why neuscheler's guide to content management says to avoid schemas; in practice, it hurts performance more than you gain in "validation."
[17:46:58] <whaley> but the "caching" on the CDN would make up for that in the grand scheme of things
[17:47:13] <dreamreal> whaley: it's not the caching that hurts it, it's the actual coercing
[17:47:43] *** dinesh___ has quit IRC
[17:47:44] <dreamreal> I haven't done analysis on WHY it hurts performance - I've only seen that it's true. And Dave's recommendations tend to reinforce that impression.
[17:47:49] *** epalm has joined ##java
[17:48:12] <k_89> hi... can u guys suggest some good books/tutorials/practice projects to learn java. Till now i have just programmed data structures in java(queues, trees, graphs, dfs/bfs etc) and worked with text files and all. I am currently a freelance web dev(in php, moving to django) with a degree in physics. Don't want to get a corpo job but it would be nice to be able enuf to get some contract/freelance work from companies some times
[17:48:38] *** Pinas has quit IRC
[17:49:48] <saml> using jsp, I have a main.jsp template.. then I want derived1.jpg to use main.jsp but replace some parts. how do I do it?
[17:50:12] <sbalmos> Photoshop
[17:50:49] *** the_intel has left ##java
[17:51:19] <saml> i mean jpg
[17:51:21] <saml> jsp
[17:51:28] *** Gather has quit IRC
[17:51:31] <dreamreal> hahaha
[17:52:18] *** matsebc has quit IRC
[17:53:08] *** Matic`Makovec has quit IRC
[17:53:57] <whaley> dreamreal: yeah, I'd trust him for such things - even if his product made my life as an operations type hell :)
[17:54:07] <whaley> *operations-type worker
[17:54:32] <rnigam> Guys here is the code I am trying to use to parse a simple xml file :http://pastebin.com/dGqPcWEu that returns an error: org.xml.sax.SAXParseException: Open quote is expected for attribute "{1}" associated with an element type "id". Here's a link to the xml: http://pastebin.com/4SyDSBHA. Sbalmos: asked me to use Xpath , is that the only solution? Can't this be done using DOM?
[17:54:53] *** Niamkik has joined ##java
[17:54:57] <dreamreal> whaley: did you see the thing on TSS this week about content management?
[17:55:06] <whaley> dreamreal: negative
[17:55:15] *** pen has joined ##java
[17:55:27] <dreamreal> whaley: http://www.theserverside.com/news/thread.tss?thread_id=62037
[17:55:43] <whaley> who wrote this... it is terrible
[17:55:48] <k_89> in short, good books to learn medium to advanced level programming in java
[17:55:51] <k_89> ?\
[17:56:10] <whaley> </tongueincheek>
[17:56:19] <dreamreal> whaley: yeah, that guy is a FSCKING MORON
[17:56:38] <whaley> dreamreal: i haven't paid much attention to the cms space since I stopped working the job where we used CQ
[17:56:44] *** Sambler has joined ##java
[17:56:50] <dreamreal> *nod*
[17:56:56] <whaley> k_89: Effective Java, JCIP I suppose
[17:57:06] <dreamreal> whaley: check privmsg
[17:59:22] *** Sambler has quit IRC
[18:00:01] *** jjido has quit IRC
[18:00:10] *** gremmachook has quit IRC
[18:00:30] *** Luc1fel has quit IRC
[18:02:33] *** sphenxes has quit IRC
[18:02:56] *** BSWolf has quit IRC
[18:03:19] *** ech0s7 has quit IRC
[18:03:50] *** surial has joined ##java
[18:04:06] *** surial has quit IRC
[18:04:19] <k_89> whaley : thnx
[18:06:09] *** jjido has joined ##java
[18:06:37] *** tilerendering has quit IRC
[18:06:56] *** jtheuer has quit IRC
[18:07:25] *** cythrawll has joined ##java
[18:07:26] *** notcyth has joined ##java
[18:07:39] *** notcyth has quit IRC
[18:08:37] *** k_89 has quit IRC
[18:12:16] *** Kamaran has joined ##java
[18:12:32] *** Rayne has joined ##java
[18:13:30] <whaley> ~ssh
[18:13:30] <javabot> whaley, what does that even *mean*?
[18:13:35] <whaley> grrr
[18:14:18] <whaley> I thought there used to be an ssh factoid that returned jsch and something else. I'm trying to remember what the something else is.
[18:14:54] *** m_W has joined ##java
[18:15:45] <Gracenotes> javabot's online search interface, whatever happened to that..
[18:15:46] <javabot> What makes you think I am online search interface, whatever happened to that.?
[18:17:46] *** zemanel has quit IRC
[18:17:46] *** yoshx has joined ##java
[18:18:11] *** Ivellina has joined ##java
[18:19:15] *** surial has joined ##java
[18:23:19] *** PigFlu has joined ##java
[18:24:35] *** km has joined ##java
[18:26:41] *** cbeust has quit IRC
[18:27:41] *** jjido has quit IRC
[18:28:37] *** epure_ has joined ##java
[18:30:23] *** mapreduce has quit IRC
[18:31:43] *** sproingie has joined ##java
[18:32:20] *** EvilPenguin has quit IRC
[18:32:36] *** km has quit IRC
[18:33:16] *** EvilPenguin has joined ##java
[18:33:37] *** yoshx has quit IRC
[18:33:59] *** camcorder has quit IRC
[18:34:09] *** alex88 has joined ##java
[18:34:25] <alex88> how do i print a long number near a string with system.out.println?
[18:34:43] <dreamreal> "near?"
[18:34:51] *** EoF has joined ##java
[18:34:56] <alex88> "this is result" + long
[18:35:21] <alex88> i've tried with system.out.format but i get exception Conversion = 'l'
[18:35:43] <dreamreal> well, System.out.println("this is a long" + longValue) would work
[18:35:52] <dreamreal> as would System.out.printf("%d", longValue)
[18:35:57] *** openpercept has quit IRC
[18:37:19] <alex88> dreamreal: true, thank you
[18:39:07] *** phantomcircuit has joined ##java
[18:44:12] *** fr0ggler has quit IRC
[18:45:06] *** kriko has joined ##java
[18:47:28] *** BSWolf has joined ##java
[18:48:00] *** tewecske has quit IRC
[18:48:07] *** somedude has joined ##java
[18:49:41] *** cbeust has joined ##java
[18:50:16] *** lilalinux has quit IRC
[18:52:53] *** andares has joined ##java
[18:53:03] *** timmmah has joined ##java
[18:53:12] <andares> hey, can I use annotations to have some kind of code get invoked at run-time?
[18:53:59] <dreamreal> sure
[18:54:07] <dreamreal> just look for the annotations at runtime
[18:54:32] *** bojo has quit IRC
[18:54:47] *** lilalinux has joined ##java
[18:54:50] <cbeust> andares: Yes but you'll need some of your own code to be run for that, annotations in themselves don't run anything
[18:54:57] *** horte has quit IRC
[18:55:17] <sproingie> annotations just tag things, the only time they can run any code is during annotation processing while compiling
[18:55:44] <sproingie> but you can always scan classes for the tag
[18:55:53] <andares> cbeust: yeah, but I can define a run-time annotation whose method is executed during startup?
[18:56:03] <andares> oh.
[18:56:15] <andares> hm, maybe I can use them during compile time to generate a bindings file or something.
[18:56:17] <sproingie> the only thing "run time" about annotations is retention, i.e. that "tag" doesn't get thrown away
[18:56:38] <cbeust> andares: for your compile time question, yes you can do that, look up APT (annotation processor tool)
[18:58:50] <andares> man, this looks complicated. I have to write an external jar to do it?
[18:59:37] *** EoF has quit IRC
[18:59:47] <sproingie> annotation processing is tricky
[19:00:03] <sproingie> apt should be redundant now tho, 1.6 has it built in
[19:00:28] *** BSWolf has quit IRC
[19:02:16] *** coalado1 has quit IRC
[19:02:17] *** forneus has quit IRC
[19:03:22] *** LouisJB has quit IRC
[19:05:03] *** BSWolf has joined ##java
[19:05:24] *** queequeg1 has joined ##java
[19:11:54] *** andares has quit IRC
[19:12:10] *** somedude has quit IRC
[19:16:24] *** queequeg1 has left ##java
[19:16:34] <saml> hey, in jsp I have ${templateVar.header} I want to have default version of it. how can I do that?
[19:17:21] *** cbrock has joined ##java
[19:18:10] <kuber> typing 'man date' is one of joys of unix.
[19:23:43] *** tigger0jk has joined ##java
[19:31:19] *** dlam has joined ##java
[19:32:18] *** matsebc has joined ##java
[19:34:50] <cbeust> Typing man is always an exercise in frustration. Why these man pages never start by showing a few examples in the first paragraph is beyond me, that's usually all people need.
[19:35:08] <dreamreal> It's because Apple didn't show them the way first.
[19:35:57] <jbwiv_> anyone here used wavemaker at all?
[19:36:02] *** LouisJB has joined ##java
[19:36:03] <kuber> cbeust: yeah. good man pages have an examples section at the bottom
[19:36:07] <dreamreal> ~poll
[19:36:07] <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.
[19:38:42] <dreamreal> kuber: examples at the bottom are pretty much only the bandage for the wound. Ideally they'd START OFF with the most common uses of the commands.
[19:39:32] <kuber> honestly i prefer having a syntax summary at the beginning
[19:39:35] *** bindaas has joined ##java
[19:39:46] <kuber> and option list
[19:40:00] <dreamreal> I think there's room for "usually this command will look like this" and then the options can follow.
[19:40:30] <kuber> manpages are manuals -- not 'ls for dummies'
[19:40:52] <dreamreal> kuber: yet who needs the man pages most? Dummies.
[19:41:09] <kuber> no, people who cant remember every command line switch for grep ;)
[19:41:16] <dreamreal> if you say so.
[19:41:20] <kuber> that's why I use them anyway
[19:41:28] <kuber> and I consult a manpage at least daily
[19:41:28] <dreamreal> maybe you're a dummy, too :)
[19:41:46] <kuber> I'm quite humble about my memory :)
[19:42:53] *** no_mind has joined ##java
[19:43:22] *** matsebc has quit IRC
[19:43:29] *** jogla has quit IRC
[19:44:01] *** jjido has joined ##java
[19:44:33] *** monk12 has joined ##java
[19:45:30] <no_mind> how do I fix this http://pastebin.com/WKnKBSX1
[19:46:15] *** pen has quit IRC
[19:46:30] *** Xeli has quit IRC
[19:46:37] <kuber> you could cast to String or parametrize your HashMap
[19:46:39] <cbeust> no_mind: Add generic types to params
[19:46:50] <cbeust> What is params a map of ?
[19:47:03] <no_mind> HashMap
[19:47:09] <cbeust> a hash map of what?
[19:47:14] <no_mind> Strings
[19:47:18] <cbeust> and...?
[19:47:28] <no_mind> Strings
[19:47:29] <monk12> hellol all, quick question. I have a 3rd party applet that is different for linux/max/windows. I'd like to detect the operating system and display send up correct params for the applet... I know you can find out O.S. of the user from javascript, can you do same in java(i realize browser can be spoofed)? my only option i can think of now is use Javascript to figure out what browser user has beforehand, set that in a session var, and display applet when page req
[19:47:29] <monk12> uested (or do all of that serverside stuff via ajax, and dynamically create the applet via jquery etc).
[19:47:32] <kuber> HashMap<String, String>
[19:47:40] <cbeust> no_mind: then declare it as such in the signature of writeContent()
[19:47:51] <no_mind> ok
[19:47:51] <kuber> no_mind: the compiler has no way to know what is in your HashMap unless you tell it.
[19:48:01] <cheeser> ~~ monk12 javadoc HttpServletRequest
[19:48:01] <javabot> monk12: http://is.gd/jSEi [JEE: javax.servlet.http.HttpServletRequest]
[19:48:27] <cbeust> no_mind: by the way your IDE should be able to help you with that, hope you're using one (Eclipse or IDEA)
[19:48:49] <no_mind> cbeust, I am on vi
[19:49:17] <cbeust> no_mind: I suggest upgrading to Eclipse or IDEA when you get a chance, it will save you a lot of headaches
[19:51:23] <monk12> cheeser, so are you saying servlets have access to something like a getRequestOS()?
[19:52:38] *** svm_invictvs has joined ##java
[19:52:46] <svm_invictvs> Sou|cutter: taking the nerdery to facebook, heh
[19:53:01] <monk12> (Im guessing no, and seems like answering another aspect of my question ... Sorry, I'm not understanding what aspect though.)
[19:53:27] <svm_invictvs> How does Java's hash map behave when it comes to collisions?
[19:53:45] <no_mind> i am getting this error message " [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details.". How do I pass the mentioned switch to ant ?
[19:53:52] *** irn has joined ##java
[19:54:14] *** switch is now known as [switch]
[19:54:59] <dreamreal> no_mind: first off, stop using ant.
[19:55:09] <dreamreal> svm_invictvs: what do you mean by "how does it behave?"
[19:55:23] <no_mind> dreamreal, no other option... android uses ant
[19:56:03] <cbeust> no_mind: Actually Android also supports Eclipse, which would, again, save you a lot of these headaches
[19:56:06] <svm_invictvs> dreamreal: I know you can play with the load factor and what not, but I was never clear as to how that affected the behavior.
[19:56:57] <dreamreal> svm_invictvs: http://www.docjar.com/html/api/java/util/HashMap.java.html
[19:57:02] *** h0x5f3759df has quit IRC
[19:57:18] <svm_invictvs> heh
[19:57:19] *** chandan_kumar has quit IRC
[19:57:23] <no_mind> cbeust, well right now i cant afford the headache of setting up eclipse... plus its better to know how to fix things from command line
[19:58:51] *** jjido has quit IRC
[19:59:08] <dreamreal> no_mind: http://ant.apache.org/manual/Tasks/javac.html, see the compilerarg description after the parameter list
[20:00:27] <cbeust> no_mind: That's true to a certain extent, you do need to learn the basics. Once you are familiar with building, compiling and running your Java programs, upgrade to Eclipse.
[20:01:37] <svm_invictvs> O.o
[20:02:09] <svm_invictvs> Or idea or netbeans
[20:02:42] <cbeust> svm_invictvs: For Android, Eclipse is the only sane choice, really
[20:02:47] <cheeser> monk12: i'm saying they have info about the eclient
[20:02:47] <svm_invictvs> Oh
[20:02:54] <svm_invictvs> cbeust: True dat.
[20:03:11] <dreamreal> yeah, proof that google is evil after all.
[20:03:27] <svm_invictvs> All Fucked Up: World Tour 2011. Egypt, Lybia, and now Japan.
[20:03:43] <dreamreal> You left off America and France.
[20:03:50] *** otac0n has joined ##java
[20:04:33] <svm_invictvs> heh
[20:04:40] <svm_invictvs> What's happened in france?
[20:04:47] *** BSWolf has quit IRC
[20:04:47] *** BSWolf2 has joined ##java
[20:04:50] <dreamreal> it's FRANCE.
[20:05:02] *** jogla has joined ##java
[20:05:03] <dreamreal> I mean, what more do you want to happen to them? Cheese-eating surrender monkeys!
[20:05:06] * dreamreal hides
[20:05:42] <monk12> haha, oh gosh America. I wish Obama would just get fed up and create a 3rd party where all moderates who are willing to compromise can join and deprive both parties of voting in a giant block to gaurentee bills demise. The Compromisers party haha.
[20:05:43] *** BSWolf2 is now known as BSWolf
[20:05:44] * dreamreal puts away the french jokes to prevent getting banned :)
[20:05:59] <dreamreal> monk12: sadly, obama wouldn't likely be a member of that party himself :(
[20:06:05] *** McMAGIC-- has quit IRC
[20:06:06] *** chandan_kumar has joined ##java
[20:07:21] *** surial has quit IRC
[20:07:34] *** jogla has quit IRC
[20:08:47] <LtHummus> monk12: the problem with the compromise party is that it lacks passion
[20:09:03] *** ghutzriop has quit IRC
[20:09:17] <dreamreal> we shoudl force everyone to join it.
[20:09:19] *** no_mind has quit IRC
[20:10:27] <monk12> i dunno, i think he's a nice guy and tries to compromise. Healthcare didn't include the government option like Republicans wanted and was basically combo of 90's republican counteroffer to Clinton's plan and Romney's plan which 80% of their state population approved of and included individual mandate. they have lowest 3% uninsured state right now i think.
[20:10:41] *** Cymage has quit IRC
[20:10:58] *** vdv has quit IRC
[20:10:59] <sbalmos> ~interesting
[20:11:00] <javabot> this is all very interesting (not really) but please take it somewhere else.
[20:11:04] *** Sliker has quit IRC
[20:11:05] <monk12> gotcha.
[20:11:44] <monk12> haha, back to code (pm me if you want LtHummus n dreamreal if want to discuss :) ). thanks cheeser. didn't know if server could access that specific info. i'll take a look.
[20:12:20] *** [[thufir]] has quit IRC
[20:14:01] *** Sliker has joined ##java
[20:16:13] *** Kamaran has quit IRC
[20:19:27] *** ernimril has joined ##java
[20:19:39] <otac0n> Has anyone here used Simian before?
[20:19:43] *** everythingWorks has joined ##java
[20:19:52] <everythingWorks> why should i access static variables in a static way?
[20:20:02] <otac0n> ...?
[20:20:15] <everythingWorks> an example:
[20:20:35] <everythingWorks> public class blub { static int x; }
[20:20:41] <cbeust> everythingWorks: to make it even more clear that they are static
[20:21:01] <everythingWorks> blub myBlub = new blub(); now i should access x via blub.x, NOT via myBlub.x
[20:21:03] <everythingWorks> why that?
[20:21:28] <everythingWorks> thats all? :D
[20:21:32] <cbeust> So people who read your code will get a better idea of how it works
[20:22:03] <cbeust> Doing so might also make you realize that the instance is not necessary
[20:22:46] <cbeust> (your IDE will flag it as dead code)
[20:22:50] <everythingWorks> ok if your just instantiating for accessing static members than that wont help you anymore.. hihi
[20:22:59] <otac0n> Well, also, the 'x' in your example has nothing to do with the instance of `blub`/
[20:23:13] <otac0n> (other than that they are in the same container class)
[20:23:17] <everythingWorks> just an easy example, that is sure
[20:25:13] *** webczat has joined ##java
[20:25:28] <webczat> Hey, why java does not support PEM encoded keys? is that actually needed?
[20:26:40] *** everythingWorks has left ##java
[20:27:12] *** platzhirsch has joined ##java
[20:27:44] <dmlloyd> it does, webczat
[20:27:49] <dmlloyd> at least the APIs are able to
[20:27:57] *** LouisJB has quit IRC
[20:28:12] <webczat> I didn't see functions for it.
[20:28:30] *** BeholdMyGlory has joined ##java
[20:29:21] <dmlloyd> it's always non-obvious but you should be able to import it via a KeyFactory or KeyGenerator
[20:29:50] <webczat> yeah, but i'm not able to do it
[20:30:04] <webczat> it can read pkcs7 encoded private keys
[20:30:23] <dmlloyd> you need to base64-decode it yourself
[20:30:31] *** theseb has joined ##java
[20:30:39] <theseb> how "execute" a jnlp file?
[20:30:45] *** aless67 has joined ##java
[20:30:46] <aless67> hi
[20:30:46] <theseb> on linux?
[20:30:48] *** cbeust has quit IRC
[20:30:52] <dmlloyd> but then you should be able to import that via a key factory
[20:30:53] <theseb> i tried "java myfile.jnlp"
[20:30:55] <theseb> no go
[20:30:57] <aless67> i cant use astah, i cant use jude, what can i use for UML ?
[20:31:07] <dmlloyd> javaws, theseb
[20:31:22] <aless67> dmlloyd, are u answering me?
[20:31:38] <dmlloyd> no, aless67
[20:31:38] <realtime_> ~aolbonics
[20:31:38] <javabot> aolbonics is using unnecessary abbreviations such as 'u', 'r', 'ur', 'thx', etc. Using this kind of abbreviation is annoying and pointless. You have a full keyboard and presumably a full brain. Please use both. If you want intelligent answers, the least you can do is speak intelligently.
[20:31:51] <dmlloyd> I wouldn't use UML if you paid me to
[20:31:52] <webczat> dmlloyd: but things like certificates can be base64 and they are supported.
[20:31:55] <dmlloyd> it's useless crap
[20:31:55] <aless67> nobody can answer this simply question?
[20:32:29] <theseb> dmlloyd: thanks! it worked!
[20:32:35] *** Tashtego has joined ##java
[20:32:36] <dreamreal> aless67: nobody cares about UML any more
[20:32:46] <webczat> what uml is?
[20:32:49] <dmlloyd> I didn't care about UML when everyone cared about UML
[20:33:00] *** Cymage has joined ##java
[20:33:02] <dmlloyd> webczat: useless markup language
[20:33:34] <webczat> Can java do base64?
[20:33:54] <dreamreal> yes.
[20:33:55] <webczat> I saw crypto, digest, asymetric crypto, but not base64
[20:34:19] <webczat> Where?
[20:34:22] *** horte has joined ##java
[20:34:35] <dreamreal> webczat: you do realize that these are just algorithms, right? And algorithms can be coded?
[20:34:53] *** chandan_kumar has quit IRC
[20:35:02] *** yoshx has joined ##java
[20:35:37] <webczat> Also, is the preferred way to provide keys for like... ssl/tls for java programs by using a keystore, or by manually providing them like in all non-java programs? about algorithms: if things like digest/etc are supported, why not base64?
[20:36:14] <aless67> dreamreal, why?
[20:36:31] *** everythingWorks has joined ##java
[20:36:39] <everythingWorks> cant i assign this?
[20:37:22] *** otac0n has left ##java
[20:37:33] <everythingWorks> like: class blub{ blub() {}; x(int i) { if(i==2) { this = new blub(); }} ?
[20:37:50] <webczat> no
[20:37:55] <everythingWorks> omg!
[20:38:24] <dreamreal> hahaha
[20:38:25] <dreamreal> really?
[20:38:28] *** riotz has joined ##java
[20:38:35] <dreamreal> (not to you, webczat... to everythingWorks)
[20:39:13] <webczat> I realized that :p
[20:39:21] <everythingWorks> I need to do something like this: http://codepad.org/l2RIHaws
[20:39:32] <everythingWorks> i have to call another ctor...
[20:39:51] <webczat> in the same object?
[20:40:25] <everythingWorks> yes
[20:40:32] <Bombstone> but what you just translated to java is nowhere related
[20:40:56] <webczat> so you can do this like this (yourparam1,param2);
[20:41:03] *** realtime_ has quit IRC
[20:41:26] <everythingWorks> the thing is.. " this.x = x;" is a very complex code
[20:41:32] *** smerz has joined ##java
[20:41:36] *** Kuifje111 has joined ##java
[20:41:41] <everythingWorks> Now i have to write the same complex code in the ctor above with int a,b and c
[20:41:49] <everythingWorks> The problem is the maintenance now..
[20:41:53] *** Rissien has joined ##java
[20:41:54] <Bombstone> no it's not. it's just differentiating a class member variable x from the method argument x
[20:46:28] *** platzhirsch has left ##java
[20:46:46] *** LouisJB has joined ##java
[20:47:16] *** sebersole has quit IRC
[20:47:40] <webczat> not sure how do you use dhparams while doing ssl
[20:47:55] *** eyesUnclouded has joined ##java
[20:48:04] *** Matic`Makovec has joined ##java
[20:48:37] *** eidolon has joined ##java
[20:49:56] *** everythingWorks has left ##java
[20:50:31] *** BSWolf has quit IRC
[20:51:16] <gtrak> so I'm trying to use a property to load some extra spring configuration at deploy-time, like this <import resource="extra/{$configuration.extra}.xml"/>, but it's not expanding the property, any ideas?
[20:51:26] <eidolon> this is odd. is this a recent change in maven?
[20:51:28] <eidolon> [WARNING] 'distributionManagement.repository.id' must not contain any of these characters \/:"<>|?* but found : @ line 267, column 11
[20:51:38] <eidolon> cuz i haven't touched that line in ages. the id is hostname:local
[20:52:09] <webczat> I know you can generate a dh key or params but can you use dh in ssl?
[20:52:59] <gtrak> ah, I see it's a bug that they WONTFIX
[20:53:00] *** starcoder has quit IRC
[20:53:32] *** EvilPenguin has quit IRC
[20:54:06] *** jjido has joined ##java
[20:55:08] *** starcoder has joined ##java
[20:55:33] *** Nikelandjelo has joined ##java
[20:57:18] *** c_axis has joined ##java
[20:59:09] *** Cymage has quit IRC
[20:59:10] *** horte has quit IRC
[20:59:43] *** horte has joined ##java
[20:59:52] *** puff has quit IRC
[21:01:03] *** BSWolf2 has joined ##java
[21:01:18] *** Cymage has joined ##java
[21:02:01] *** BSWolf2 is now known as BSWolf
[21:02:42] *** horte has quit IRC
[21:04:29] *** Matic`Makovec has quit IRC
[21:04:31] *** f_kafka has joined ##java
[21:05:03] <f_kafka> hey, uhmm could somone help me please to understand this example? : cent ++; | cent = cent + 1
[21:05:17] <f_kafka> like.. whats the thing with doing cent++ ... what is it useful for
[21:05:35] <eidolon> note to self. having a maven pom that explicitely mixes spring pieces from 2.5 with pieces from 3.0.5.RELEASE? bad.
[21:05:50] <eidolon> cent++ just incremenets the int 'cent' by one.
[21:05:53] <eidolon> it's a c-ism
[21:06:08] <f_kafka> yea im pretty new to the whole CS world
[21:06:12] <f_kafka> just started in uni
[21:06:18] *** eyesUnclouded has quit IRC
[21:06:22] *** meoblast001 has joined ##java
[21:06:29] <eidolon> no problem.
[21:06:29] <f_kafka> why is incremenenting is important
[21:06:33] <f_kafka> like what is it useful?
[21:06:37] *** Swiftwork has joined ##java
[21:06:55] <eidolon> it's just a shortcut foraying 'cent=cent+1;
[21:07:01] <eidolon> for. saying.
[21:07:05] *** Pinas has joined ##java
[21:07:06] <Pinas> hello
[21:07:23] <f_kafka> can u give me an example of something else using this
[21:07:28] <f_kafka> ?
[21:07:32] *** b3nny has quit IRC
[21:07:39] <Swiftwork> Hey, is there a program that can open a class file and force write bytecode lines, then save?
[21:07:39] <moqq> f_kafka: your Java book probably has lots of them ;)
[21:07:40] *** Matic`Makovec has joined ##java
[21:07:41] <eidolon> um. anything that has to increase a variable by one?
[21:07:41] <Pinas> is there a possibility to allow the use of an annotation just once ?
[21:07:50] *** mistik1_ has joined ##java
[21:07:52] <f_kafka> great!
[21:07:59] <f_kafka> i guess thats the most specific answer i've heard
[21:08:02] <f_kafka> thx.
[21:08:04] <Swiftwork> tried jbe but throws exceptions
[21:08:04] <webczat> Hey, how to do dhparams key agreement with ssl?
[21:08:06] <eidolon> ~next
[21:08:07] <javabot> Another satisfied customer. Next!
[21:08:10] *** Matic`Makovec has quit IRC
[21:08:18] <f_kafka> hrhr
[21:08:39] *** jesmon has quit IRC
[21:08:57] *** tigger0jk has quit IRC
[21:09:39] <eidolon> OMG. A clear error message from spring!
[21:09:42] * eidolon falls over dead.
[21:10:37] *** mistik1 has quit IRC
[21:10:38] *** mistik1_ is now known as mistik1
[21:12:29] <Pinas> is there a possibility to allow the use of an annotation just once ?
[21:13:03] <dreamreal> what does that mean?
[21:14:00] *** magn3ts has joined ##java
[21:14:35] <Pinas> my message ?
[21:15:15] <moqq> Pinas: yeah, what does that mean?
[21:15:28] *** zemanel has joined ##java
[21:16:19] <eidolon> hrrm… I have p:persistence-xml-location="classpath:persistence.xml" - the xml file is in WEB-INF/persistence.xml - but it's not finding it. am i missing a syntax somewhere?
[21:16:32] <eidolon> (as in, i'm getting a 'file not found: persistence.xml" error message)
[21:16:57] <dreamreal> eidolon: isn't it supposed to be in the classpath, then?
[21:17:03] <Pinas> well i defined some own annotations, and I want to allow the usage of a annotation just one (@annotationname just once)
[21:17:07] <dreamreal> because WEB-INF/ is NOT in the classpath.
[21:17:10] <eidolon> yeah, owait, WEB-INF isn't on the classpath… right
[21:17:12] <eidolon> mmkay.
[21:17:53] <eidolon> oddly, that's where my applicationContext is - that's not on the classpath either?
[21:17:58] <eidolon> sorry - spring is -really- confusing to me sometimes.
[21:19:18] <eidolon> aha.
[21:19:36] *** Bombstone has quit IRC
[21:19:37] <eidolon> moved it in where my struts, log4j, and properties files are, and it loaded. on to the next error.
[21:20:33] *** deSilva has joined ##java
[21:20:39] *** Bombstone has joined ##java
[21:21:30] *** surial has joined ##java
[21:26:10] *** zatan has quit IRC
[21:26:24] <eidolon> ung. more dependencies. slf4j is the new hibernate logger? 'whee'
[21:26:58] <dreamreal> it's a good move, though
[21:27:28] <eidolon> "meh." :)
[21:27:38] <eidolon> one more dependency i need to glom into pom.xml
[21:29:28] *** whaley has quit IRC
[21:29:38] <dreamreal> although it gets rid of some others
[21:30:25] <eidolon> well, except i use commons-logging on a bunch of other things… so i have to bring in slf4j for hibernate, and leave commons in for the rest of the code, or convert the rest of the code to that.
[21:34:41] <dreamreal> well, if you ask me - and you haven't - I'd say it'd be worth it
[21:35:08] <eidolon> :)
[21:35:35] *** vdv has joined ##java
[21:35:46] <eidolon> i'm currently shifting away frmo hand-coded pojos to JPA entities and generic DAOs. That's a major refactoring. the logger is WAY low on the priority list atm.
[21:37:39] <dmlloyd> jcl-over-slf4j.jar, eidolon
[21:37:45] <dmlloyd> then you have one less thing to worry about
[21:38:44] * eidolon nods
[21:45:03] *** jonrafkind has joined ##java
[21:46:04] *** FrozenKnight has quit IRC
[21:46:24] *** chetan- has left ##java
[21:47:34] *** jjido has quit IRC
[21:48:33] <jonrafkind> I have swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel set but the resulting UI is still pretty ugly (doesn't look like gtk), is there a way to get native gtk widgets in jdk6?
[21:50:06] *** monk12 has quit IRC
[21:50:16] *** mbreslin has joined ##java
[21:51:27] *** pgib has joined ##java
[21:51:56] <pgib> so.. is there any recommended reading material regarding JEE6? Particularly CDI and friends?
[21:56:15] *** eidolon has quit IRC
[21:56:36] *** horte has joined ##java
[21:56:57] *** wolfman2000 has joined ##java
[21:57:42] <svm_invictvs> ~javaee
[21:57:42] <javabot> for information and tutorials on JavaEE see http://java.sun.com/javaee/6/docs/tutorial/doc/
[21:57:46] *** Kamaran has joined ##java
[21:58:50] *** alexandernst has quit IRC
[22:01:08] <pgib> and I wish their JAX-RS example wasn't so narrow. I'd really like to know what a more complete REST api looks like. They have the RSVP example, but it is pretty tiny
[22:02:09] *** alexandernst has joined ##java
[22:03:54] *** zChris has joined ##java
[22:04:51] *** irn has quit IRC
[22:04:54] *** b3nny has joined ##java
[22:05:59] <f_kafka> got a question
[22:06:03] <f_kafka> for example, Math.sqrt
[22:06:07] *** Johannes13 has quit IRC
[22:06:13] <f_kafka> is sqrt a method from the type Math?
[22:06:24] <f_kafka> or is Math a class and sqrt is a method?
[22:06:25] <dreamreal> what do you think?
[22:06:31] *** BoF has joined ##java
[22:06:46] <pgib> can it be both? ;)
[22:06:51] <f_kafka> im asking...
[22:07:03] <f_kafka> can u give me an example of a Class which isnt a type as well?
[22:07:04] <pgib> depends on "type" I don't think that has a clear definition in Java
[22:07:08] * dreamreal sighs. What do you THINK it is? That would tell us how much you need to learn.
[22:07:10] <f_kafka> oki
[22:07:11] *** tilerendering has joined ##java
[22:07:30] <f_kafka> well, i think Math is a class and also a type
[22:07:56] <zChris> hehe a question in /me, that was the first time :P
[22:07:56] <pgib> Math is definitely a class. But, that method is not a typical method member
[22:07:56] <f_kafka> like java gives us simple types such as boolean, int, double...
[22:08:17] <pgib> they call those 'primitives' I believe
[22:08:34] <f_kafka> but also we can define new types using classes
[22:08:43] <f_kafka> like if we make class C, we can make objects from the type C
[22:09:01] <pgib> well, objects of class C.
[22:09:11] <dreamreal> f_kafka: a class can have instance methods or static methods.
[22:09:38] <pgib> but, if you want to use the word 'type' then I would consider both primitives and Classes as types
[22:09:53] <dreamreal> sqrt is a static method of class Math. Math is definitely a type, although there'd be no point in instantiating it (and I'm not sure you CAN instantiate it offhand.)
[22:09:54] <pgib> and a value/object cannot be both a primitive and a class
[22:09:55] <f_kafka> oki..
[22:10:09] <rnigam> hello, I recently started working with Java. I have loads of complex xml's that I want to perform post processing on. Mostly extracting a part of xml and getting the information of a person based on their id and other attribute values associated with their tag. I want you all to suggest me a best way to adopt doing it. I have been going thru XSLT, Xquery, DOM, SAX with Xpath and all sorts of
[22:10:09] <rnigam> things. Please suggest which one is better so that I can get my head down and work with it.
[22:10:38] <zChris> An object is a type of a class :P
[22:10:39] <pgib> dreamreal, Math has a private ctor, so no.
[22:10:49] <dreamreal> pgib: *nod*
[22:10:50] <pgib> object is an instance of a class.
[22:11:02] *** _controller has joined ##java
[22:11:08] <pgib> multiple objects of the same class does not infer multiple types
[22:11:21] <_controller> would a problem with a mysql jdbc be better suited here or in #mysql?
[22:11:37] <pgib> depends on which side of JDBC it is on ;)
[22:11:51] <_controller> com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.Connection was implicitly closed by the driver.
[22:12:04] <dreamreal> _controller: well, that's definitely on your end
[22:12:13] <_controller> so....#java?
[22:12:16] <dreamreal> yep
[22:12:26] <dreamreal> stop doing stuff that closes the connection before you're done with it
[22:12:40] <_controller> i dont do anything
[22:12:48] <_controller> that only happens after ive ran my program for a little over a day
[22:13:06] <dreamreal> well, you're doing SOMETHING.
[22:13:24] <dreamreal> Otherwise you're ... you're doing something. Even if your program runs in an infinite loop you're doing SOMETHING.
[22:13:52] <_controller> ok...so can i have help with what im apparently doing?
[22:13:55] <pgib> _controller, have you looked at your mysql server log for details?
[22:14:01] <dreamreal> I dunno, what are you doing
[22:14:01] <_controller> no pgib
[22:14:08] <pgib> might say connection closed unexpectedly, transaction timed out, etc...
[22:14:17] <pgib> (due to a problem on your end)
[22:14:18] <_controller> will check pgib
[22:14:19] <_controller> sex
[22:14:21] <_controller> sec*
[22:14:21] <_controller> lol
[22:14:30] <pgib> Sure, sex sounds great
[22:14:32] <gtrak> i think you had it right the first time
[22:15:00] *** horte has quit IRC
[22:15:08] *** horte has joined ##java
[22:15:20] *** jonrafkind has left ##java
[22:15:34] *** Raystorm has joined ##java
[22:15:34] <dreamreal> pgib: any bets that his connection is just open for too long?
[22:15:52] <_controller> ya, im kind of thinking that
[22:16:04] <_controller> because ive ran it multiple times but never for this long
[22:16:21] <dreamreal> a connection pool would probably fix you right up, since it can validate connections before giving them to your code to use
[22:16:52] <pgib> well, don't leave your connections open so long. if you really must run a tx that lasts that long, you'll need to increase the timeouts on your server
[22:17:07] <RogueShadow> my inexperienced mine suggests asking why do you have to keep the connection open the entire time?
[22:17:22] <_controller> rogueshadow, because mysql queries are going through the entire time :)
[22:17:34] <dreamreal> one query or a set of them?
[22:17:34] <pgib> I don't use mysql, but they may have a different driver class that has built in connection pooling (if you don't want to use an EE server or apache pool)
[22:17:43] <_controller> dreamreal many
[22:17:44] <pgib> (I know Postgres has a driver with built-in pooling at least)
[22:17:47] *** f_kafka has left ##java
[22:17:48] <_controller> the connection is accessed by different threads
[22:17:57] <dreamreal> then jeez. put in a connection pool.
[22:17:58] <pgib> ugh
[22:18:05] <pgib> yeah, use a damn connection pool
[22:18:12] <_controller> any good libs?
[22:18:12] <dreamreal> acquire a connection from the pool, close it. Repeat. Repeat a BUNCH.
[22:18:17] <dreamreal> dbcp is fine
[22:18:24] *** yoshx has quit IRC
[22:18:24] <_controller> close it EVERY time?
[22:18:30] <dreamreal> _controller: yes
[22:18:37] <_controller> wouldn't that be...inefficient?
[22:18:42] <dreamreal> the connection pool wraps close() so it doesn't actually close the connection.
[22:18:48] <pgib> a connection pool provides a virtual connection
[22:18:56] <dreamreal> But if you acquire it from the pool every time, you will get back a valid connection.
[22:19:06] *** siyb has joined ##java
[22:19:08] <pgib> so.. it will reuse a physical connection multiple times, but give you what seems like a fresh connection
[22:19:09] <_controller> but still, wouldn't it be heaps slower
[22:19:10] <dreamreal> (Often, the same connection. But if it dies? the pool will create a new one and hand you THAT.)
[22:19:14] <dreamreal> _controller: um. no.
[22:19:14] <_controller> oh pgib
[22:19:17] <_controller> that makes sense
[22:19:35] <_controller> ok so close "connection" after each set of queries?
[22:19:35] <dreamreal> damn it, *I* told you! :)
[22:19:47] <dreamreal> _controller: in every connected sequence, sure
[22:19:54] <pgib> connection-per-request is a reasonable strategy
[22:19:59] <dreamreal> get connection, do a transaction, close connection
[22:20:04] <pgib> connection-per-business-operation that is
[22:20:07] <_controller> ok, sounds good
[22:20:09] <_controller> ps also
[22:20:14] <siyb> is there a way to get input from the keyboard directly, without needing focus on a window (intercept keyboard input?) in java
[22:20:19] <_controller> i found a leak in the mysql jdbc
[22:20:26] <_controller> if you dont close statements explicitly
[22:20:29] <_controller> resources will leak
[22:20:37] <_controller> they dont get implicitly closed by the gc
[22:20:39] <_controller> for some reasons
[22:20:43] <_controller> reason*
[22:21:06] *** sha1sum has quit IRC
[22:21:14] <_controller> siyb: not without jni
[22:21:30] *** cbeust has joined ##java
[22:21:45] <siyb> _controller: thanks, thought so
[22:22:36] <_controller> pgib, dreamreal: so you guys think the mysql server closed the connection after being alive for so long?
[22:22:56] <_controller> because on #mysql they tell me mysqld doesn't do this..it only closes idle connections
[22:23:58] *** horte has quit IRC
[22:26:12] *** tilerendering has quit IRC
[22:28:44] *** bitshuffler has quit IRC
[22:29:56] <pgib> and was your connection idle?
[22:31:32] *** tigger0jk has joined ##java
[22:32:04] <_controller> no pgib
[22:32:06] *** horte has joined ##java
[22:32:11] <_controller> i have logs that prove this
[22:32:30] *** aless67 has quit IRC
[22:32:59] *** tty1 has quit IRC
[22:33:23] *** Luc1fel has joined ##java
[22:34:06] *** tty1 has joined ##java
[22:34:19] *** c_axis has quit IRC
[22:34:42] *** Lectus has joined ##java
[22:35:50] *** sebrock has quit IRC
[22:37:09] *** deadbeef has joined ##java
[22:37:36] *** genesiss has joined ##java
[22:37:56] <deadbeef> hello guys excuseme, i've a class A<XType> { .. }; can i do a "XType x = new XType()" inside one of A's methods ?
[22:38:03] *** pertl has joined ##java
[22:38:07] *** Prot has joined ##java
[22:38:14] <deadbeef> and is there any way to do anything like that?
[22:38:22] <deadbeef> i mean, what's the best pattern in those cases
[22:39:37] <sbalmos> ~~ deadbeef generics
[22:39:37] <javabot> deadbeef, For a tutorial on generics, please see http://javachannel.net/wiki/pmwiki.php/Main/Generics
[22:40:36] <deadbeef> nice reference, bookmarked
[22:41:07] *** Junior has quit IRC
[22:42:49] *** bitshuffler has joined ##java
[22:44:29] <deadbeef> i still can't find an answer there btw
[22:45:41] <deadbeef> http://stackoverflow.com/questions/75175/create-instance-of-generic-type-in-java
[22:45:47] <deadbeef> factory pattern, here we go
[22:45:52] <deadbeef> thanks anyway for the link
[22:46:22] *** Caleb-- has joined ##java
[22:46:42] <Caleb--> hey, if i'm passed a 2d array in a function, how can i define a new array of the same size?
[22:47:03] <Caleb--> that is, is there a way to find out the size of the "rows"
[22:47:04] <Caleb--> ?
[22:47:11] *** infid has quit IRC
[22:48:00] *** Wicked has quit IRC
[22:48:15] <odinsbane> Caleb--: yes, you might be able to get it from your_array[0].length.
[22:48:23] <Caleb--> i see
[22:48:28] <Caleb--> so only by accessing it
[22:48:52] <Caleb--> array.length will return the amount of "rows", right?
[22:49:00] *** infid has joined ##java
[22:49:01] *** Gryphon_ has quit IRC
[22:49:07] <odinsbane> Yes
[22:49:30] <Caleb--> well, i have this homework assignment in which i have to complete some image processing class
[22:49:37] <odinsbane> double[][] is actually a Object[] where each object is a double[]
[22:49:53] <Caleb--> and in each function i'm passed a 2d array of the image data, and i need to return a new 2d array after i've performed some operation
[22:49:58] <Caleb--> like invert, or convert to b/w
[22:50:23] *** tigger0jk has quit IRC
[22:50:47] <Caleb--> i'm not sure what would be the best way to create the new array. do i just copy the imageData array, or do i allocate it manually with new?
[22:50:55] *** Tashtego has quit IRC
[22:51:02] <Caleb--> right now i've used the "new" method
[22:51:25] <odinsbane> I don't know how you would 'just copy it,' most likely you need to use new.
[22:51:36] <Caleb--> odinsbane, Arrays.copyOF
[22:51:38] <Caleb--> Of*
[22:51:42] *** hyppias has quit IRC
[22:51:55] <Caleb--> would that work for 2d arrays?
[22:52:00] <Caleb--> or would that copy references
[22:52:25] <odinsbane> Caleb--: judging by what I said earlier, it will not work how you want. Unless you do that for each row.
[22:52:34] <Caleb--> i see
[22:53:46] *** teefal has joined ##java
[22:54:22] *** odinsbane has quit IRC
[22:54:29] *** Wicked has joined ##java
[22:55:18] *** pertl has left ##java
[22:55:29] *** mosgjig has left ##java
[22:55:58] *** ralnaemi has left ##java
[22:56:30] *** caverdude has quit IRC
[22:58:06] *** Fisiu has joined ##java
[22:58:43] *** phantomcircuit has quit IRC
[22:59:34] *** alex88 has quit IRC
[23:00:24] *** McMAGIC-- has joined ##java
[23:04:33] *** Fisiu has quit IRC
[23:05:45] <pgib> question, if I want to run the WARs in my EAR on separate ports, is there a way to do this without needing to separate the WARs from the EAR?
[23:06:15] *** topriddy has joined ##java
[23:06:47] <dreamreal> pgib: which container?
[23:07:15] <pgib> GFv3.1
[23:07:43] <pgib> goal is to remove our Apache frontend proxy, but I need multiple ports to support vhosts properly
[23:07:49] *** [[thufir]] has joined ##java
[23:07:58] *** webczat has quit IRC
[23:09:54] *** _controller has quit IRC
[23:10:00] *** robbyoconnor has joined ##java
[23:10:09] *** pertl has joined ##java
[23:11:52] *** epalm has quit IRC
[23:12:21] <dreamreal> you can set up different http connectors on various ports, and hook up routing on those connectors to different wars
[23:13:46] <sbalmos> dreamreal: I think the crux is that those WARs are all part of an EAR
[23:14:03] <dreamreal> sbalmos: I don't think that matters. They're still contexts.
[23:14:25] *** Mooniac has joined ##java
[23:14:57] <pgib> hmm, but I wonder if the EAR will deploy if the context on each WAR is the same ("/")
[23:16:13] *** matsebc has joined ##java
[23:17:51] *** alexhofbauer has joined ##java
[23:18:04] <alexhofbauer> Hi!
[23:18:36] *** horte has quit IRC
[23:19:23] *** cbrock has quit IRC
[23:19:37] <alexhofbauer> I've got a question regarding "SQL connections": Should I close them after each query or keep them alive? From a multiuser/multiclient point of view closing should be the preferred thing to do, right?
[23:19:57] <pgib> alexandernst, are you _controller?
[23:20:15] <alexandernst> pgib: no
[23:20:24] <pgib> ok, someone was just asking the same question
[23:21:01] <pgib> well for one thing. connection-per-query would probably involve lots of extra overhead, especially if a function takes many queries to complete
[23:21:40] <pgib> connection-per-query also makes it impossible to do a transaction acrosss multiple statements (well, that is the only way a transaction is useful anyways)
[23:21:48] *** sbalmos has quit IRC
[23:23:30] *** White_Cat has quit IRC
[23:23:50] <pgib> crap. I installed the javaee tutorials onto my glassfish. now I can't deploy my app!! yayayayaya
[23:24:15] <pgib> no stacktrace or anything - just a single SEVERE with no help
[23:24:45] <alexhofbauer> Ok, so let's say I've want two or three max "parallel" connections to a DB server (using Semaphores?). Should I just release the connection (and "put it back") or close it?
[23:25:10] <pgib> using semaphores? to block until a connection is free??
[23:25:21] <alexhofbauer> yes
[23:25:24] <pgib> anyways, it sounds like you are reinventing the wheel. I'd just use a connection pool
[23:25:43] <pgib> connection pool provides you with virtual connections that you can just open and close for each request
[23:26:04] <alexhofbauer> pgib: If I knew that existed :)
[23:26:07] <pgib> connection pool handles reusing physical connections. re-establishing dropped connections. and proper growth and stuff
[23:26:15] *** timmmah has quit IRC
[23:26:17] <pgib> if you are using a EE container, they have them built in
[23:26:24] <pgib> otherwise, you can use the apache connection pool
[23:28:10] *** Caleb-- has quit IRC
[23:28:28] <pgib> I am about to shoot myself
[23:28:44] <pgib> why in the hell does installing javaee docs onto glassfish all of a sudden make my jersey app break?
[23:29:32] <pgib> http://pastie.org/1661327
[23:30:51] *** Pinas has quit IRC
[23:31:56] <flodin> can you offer me a guideline on whether to use
[23:32:02] <flodin> new BufferedReader(new InputStreamReader(is))
[23:32:06] *** Develman has joined ##java
[23:32:09] <flodin> or
[23:32:13] *** Nikelandjelo has quit IRC
[23:32:14] <flodin> new InputStreamReader(new BufferedInputStream(is))
[23:32:20] *** rjohnson19 has joined ##java
[23:35:42] *** cbrock has joined ##java
[23:36:29] *** ccidral has joined ##java
[23:38:54] <ernimril> flodin: you should specify the character set with that
[23:39:13] <flodin> right
[23:39:35] <flodin> my question though concerns whether I should buffer at the lower or the higher level
[23:40:02] *** [switch] has quit IRC
[23:40:20] <ernimril> flodin: InputStreamReader has some buffering built in, I am not sure how big it is though
[23:40:40] <ernimril> flodin: unpack the source and check, if it is too small, then buffer at the lower level
[23:41:20] <flodin> k
[23:41:34] *** bitshuffler has quit IRC
[23:42:31] *** Wyzard has quit IRC
[23:44:10] *** c_axis has joined ##java
[23:44:20] *** Swiftwork has quit IRC
[23:49:36] *** pgib has quit IRC
[23:49:59] *** Develman has quit IRC
[23:51:21] *** b3nny has quit IRC
[23:53:10] *** [switch] has joined ##java
[23:53:33] *** FireSlash has quit IRC
[23:56:50] *** Speed` has quit IRC
[23:57:34] *** gtrak has quit IRC
top

   March 11, 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 | >