Switch to DuckDuckGo Search
   March 8, 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:13] <wyvern`> http://youtrack.jetbrains.net/issue/IDEA-65722
[00:00:18] <wyvern`> fixed but not released yet
[00:00:22] <Sou|cutter> Cher: agreed
[00:01:24] *** _yitz has left ##java
[00:01:57] *** amichair has quit IRC
[00:01:59] <tjsnell> I say use an IDE, I don't care which one, always paid for my team members if they wanted IDEA but they had a choice
[00:01:59] *** pantokrator has joined ##java
[00:02:11] <Sou|cutter> Eclipse's perspectives weird me out, personally
[00:02:22] <Sou|cutter> I just don't understand how it's a useful paradigm
[00:02:34] <Sou|cutter> tjsnell: yeah, same here
[00:02:35] <tjsnell> ditto, some swear by them though
[00:02:36] <Kristen207> Eclipse's CTRL+F is the best thing ever invented
[00:02:49] <Kristen207> So much better than BlueJ
[00:02:59] <Sou|cutter> heh, BlueJ is garbage :)
[00:03:10] <Sou|cutter> ~bluej
[00:03:10] <javabot> Sou|cutter, what does that even *mean*?
[00:03:21] <Sou|cutter> that's funny
[00:03:26] <Kristen207> And the interfact implentation with the ability to add blank methods is pretty nice too
[00:03:35] <tjsnell> Find and Replace?
[00:03:49] <Kristen207> *interface
[00:04:07] <Kristen207> Only problem with Eclipse is it doesn't think for you.
[00:04:09] <Kristen207> ;;
[00:04:14] <Sou|cutter> that's what idea is for
[00:04:18] <Sou|cutter> :)
[00:04:23] <tjsnell> the non thinking man's IDE
[00:04:24] <wyvern`> I don't even program anymore, I just keep hitting alt-enter
[00:04:39] <Kristen207> XD
[00:04:46] <tjsnell> wyvern`: not in 10.x :)
[00:04:47] <Sou|cutter> Kristen207: why the ;;'s btw? second time you've done that
[00:04:58] <Kristen207> Oh, it's a cying face
[00:05:04] <Kristen207> The . is the eye
[00:05:08] <Kristen207> The , is the tear
[00:05:13] <Kristen207> A less intense T_T
[00:05:16] *** lmatteis has joined ##java
[00:05:22] <lmatteis> hi
[00:05:23] <Kristen207> But more than a :'(
[00:05:24] <Sou|cutter> ah, I haven't seen that before
[00:05:29] <lmatteis> how does Play! framework hot deploy a webapp?
[00:05:37] <Kristen207> Probably too asian a smilie
[00:05:47] *** bitshuffler has quit IRC
[00:05:54] <wyvern`> lmatteis, dunno. I would guess classloader tricks
[00:06:12] <wyvern`> tjsnell, eh? I'm running 10
[00:06:30] *** mashedo has quit IRC
[00:06:41] *** zemanel has quit IRC
[00:06:52] <tjsnell> you don't have auto-invoke complettion on?
[00:06:54] *** yxz97 has left ##java
[00:07:08] *** zemanel has joined ##java
[00:07:23] <wyvern`> oh, i meant the fix-problems shortcut
[00:07:30] *** yitz_ has joined ##java
[00:07:39] *** zemanel has quit IRC
[00:08:01] <tjsnell> oh
[00:08:02] <tjsnell> bonk
[00:08:03] <tjsnell> yeah
[00:08:12] *** zatan has quit IRC
[00:08:27] <tjsnell> I was so happy the day I discovered that shortcut
[00:08:48] <xingped> Question: Can anyone explain to me how to use or include an external jar in a compiled/exported jar file from Eclipse?
[00:08:56] <new2net> Autoformat... you mean write everything on 1 line using cat > ClassName.java (my teacher teared up a little when I did that + it compiled)
[00:08:58] <tjsnell> eclipse still needs solid maven support :(
[00:09:03] <cheeser> xingped: #eclipse can
[00:09:12] <Kristen207> To draw shapes on a GUI and not have them disappear with each invocation of repaint(), I need to remake each shape with the repaint invocation, right?
[00:09:21] <wyvern`> tjsnell, it's changed the way i program
[00:09:30] <new2net> xingped File -> import -> from external jar -> "browse" click the .jar -> click finish
[00:09:39] <xingped> cheeser: okay, i'll try there.
[00:09:41] <lahwran> how do I change the garbage collector?
[00:09:47] <tjsnell> yeah, I let the IDE in general do a tone
[00:09:58] <xingped> new2net: no, i'm trying to figure out how to include an external jar with the jar i export from eclipse.
[00:10:22] *** kebomix has left ##java
[00:10:29] *** bangolio has quit IRC
[00:12:02] <Sou|cutter> lahwran: did you try googling?
[00:13:10] <Sou|cutter> ~~ lahwran google garbage collection tuning
[00:13:10] <javabot> lahwran, http://letmegooglethatforyou.com/?q=garbage+collection+tuning
[00:13:21] *** nibbless has quit IRC
[00:13:22] <tjsnell> maybe add java in there :)
[00:13:36] <tjsnell> to avoid all the smalltalk hits!
[00:13:49] <Sou|cutter> not necessary in this case
[00:13:57] <Sou|cutter> with those keywords anyway
[00:14:50] *** xianny has quit IRC
[00:14:59] *** xianny has joined ##java
[00:15:23] <lmatteis> wyvern`: little more details on that?
[00:15:35] <cbeust> tjsnell: I like to think that these days, I code mostly with quick fixes
[00:15:44] <cbeust> By that I mean Eclipse's quick fixes
[00:15:52] <tjsnell> yep
[00:15:56] <cbeust> write something, ctrl-1, write, ctrl-1, write, ctrl-1
[00:16:02] <tjsnell> a competent dev in an IDE is fun to watch
[00:16:05] <cbeust> I never declare variables, create signatures, import packages
[00:16:17] <tjsnell> heh
[00:16:18] <tjsnell> ditto
[00:16:28] <cbeust> implement interfaces, etc... all done by Eclipse, I just supply what the IDE really can't guess for me
[00:16:29] <wyvern`> lmatteis, on what?
[00:16:49] <tjsnell> my if's now are all one line no braces if it's one statement cause I know the ide will multiline it with braces for me
[00:18:09] <new2net> does writing my code on paper then scanning it in with OCR + compile count as an IDE? I have a "run as junit test" button on my scanner.
[00:19:00] *** rciovati has quit IRC
[00:20:46] *** yitz_ has left ##java
[00:21:10] *** echosystm has joined ##java
[00:21:26] <echosystm> whats a good library for quickly doing assertions for database content + query results?
[00:21:39] <echosystm> dbunit seems to really overcomplicate everything
[00:22:12] <wyvern`> i wrote a library for loading test data into a db, but that's not really what you're after it sounds like
[00:22:20] *** lmatteis has quit IRC
[00:22:22] <echosystm> i want to just be able to do things like run a query and have it check the values against a Map<String, Object> or List<Map<String, Object>>
[00:22:31] <echosystm> does that make sense?
[00:22:57] <wyvern`> jdbi might be of use for getting basic collections out of a query
[00:23:12] <Cher> Automated content engines can be so stupid. My blog article about make (i.e. GNUMake vs. omake) is listed alongside with make-up products :-D
[00:23:24] *** r0bby has joined ##java
[00:23:52] <mapreduce> Because you're worth it.
[00:24:33] *** Cymage has quit IRC
[00:25:11] *** Fuco has quit IRC
[00:26:35] *** ^Mike has joined ##java
[00:26:57] <^Mike> Is there a utility to automatically clean up java code?
[00:27:08] *** Cymage has joined ##java
[00:27:23] <new2net> an intern.
[00:27:24] *** homie has quit IRC
[00:27:34] *** sebersole has quit IRC
[00:28:24] <echosystm> anyone know of a db testing framework other than dbunit?
[00:28:36] <new2net> ~google "code formatter" java
[00:28:36] <javabot> http://letmegooglethatforyou.com/?q=%22code+formatter%22+java
[00:28:49] <Cher> ^Mike: More than one. Try googling for "Java Beautifier", and you'll get results like Jalopy. Plus: all IDEs and editors worth mentioning have built-in beautifiers. Some have more features, some less.
[00:29:09] <^Mike> new2net: but I /am/ the intern! :D
[00:29:36] *** davidmogar has joined ##java
[00:29:39] <davidmogar> hello
[00:29:54] <wyvern`> echosystm, http://code.google.com/p/jfixture/ can help getting data from files into a db, but not the other part
[00:30:10] <echosystm> i dont want to get data from files into the db
[00:30:14] <echosystm> the db already has the data i need
[00:30:28] <echosystm> i specifically dont want to have to write xml for every single test
[00:30:29] *** jdolan_ has joined ##java
[00:30:36] <echosystm> thats why i dont want to use dbunit
[00:30:46] <wyvern`> in that case, dunno. It's not hard to write methods to turn a ResultSet into a map or list, though
[00:30:50] <new2net> echosystm, most old timers (dba) tell me they like to use stored procedures for that type of testing. That way the db can be tested independently from the application layer.
[00:30:56] <wyvern`> well sure, xml as a means for specifying tables sucks
[00:31:12] *** jjido has quit IRC
[00:31:18] <wyvern`> yeah but stored procedures are more dbms specific and kind of a pain :/
[00:31:23] <echosystm> new2net: i'm not testing the database itself
[00:31:44] <echosystm> im testing that my restful resources are doing the right thing on the database
[00:32:07] <davidmogar> I'm trying to use urlconnection and setRequestProperty("Cookie" to download a page and post a text . The problen is that I can download without problems, but I can't post nothing because the site says that I must login before. What can I do?
[00:32:15] <echosystm> so i'm sending http requests to the server and testing that the database contains the right data
[00:33:25] *** caverdude has quit IRC
[00:34:02] *** chachan has joined ##java
[00:34:02] *** riotz has joined ##java
[00:34:10] *** VJTachyon has quit IRC
[00:34:31] <wyvern`> davidmogar, use apache httpclient
[00:35:14] <davidmogar> wyvern`: what is apache httpclient?
[00:35:21] <Sou|cutter> ~httpclient
[00:35:21] <javabot> Sou|cutter, httpclient is a deprecated http client package for Java by Jakarta. It can be found at http://hc.apache.org/httpclient-3.x/index.html - note that it has dependencies like commons-codec, commons-logging, and possibly the other 18,000 jakarta dependencies that tend to accompany any single jakarta lib. Otherwise, great stuff. See ~httpcomponents for more current stuff.
[00:35:35] <Sou|cutter> ~httpcomponents
[00:35:35] <wyvern`> ~httpcomponents
[00:35:35] <javabot> Sou|cutter, httpcomponents is a HTTP client package for Java by Apache (thus, free and open source). It can be found at http://hc.apache.org/ and is easier to use than java's own java.net.URLConnection stuff. Its an update of the old httpclient, in case that rings a bell for you.
[00:35:36] <javabot> wyvern`, httpcomponents is a HTTP client package for Java by Apache (thus, free and open source). It can be found at http://hc.apache.org/ and is easier to use than java's own java.net.URLConnection stuff. Its an update of the old httpclient, in case that rings a bell for you.
[00:35:42] <Sou|cutter> :P
[00:35:44] <wyvern`> poor javabot, never a moment's rest
[00:35:48] <wyvern`> ~botsnack
[00:35:48] * javabot burps loudly enough to wake the neighbours up
[00:36:12] <wyvern`> plus, httpcomponents 4.1 finally has easy gzip support
[00:38:24] <Sou|cutter> I thnk that's orthogonal to the problem at hand anyway
[00:38:36] *** Railgun has quit IRC
[00:38:47] *** theNatd has joined ##java
[00:39:01] <wyvern`> True, but nice to have.
[00:39:03] *** theNatd has left ##java
[00:39:10] *** JohnnyDavidson has joined ##java
[00:41:10] <davidmogar> wyvern`: Its a little dense xD
[00:41:47] <wyvern`> true, but it gives you a *lot* more control
[00:41:54] *** kaemo has joined ##java
[00:42:38] *** theNatd has joined ##java
[00:42:45] <davidmogar> wyvern`: maybe too control. This is only for a mission (HTS)
[00:43:49] *** ojacobson has joined ##java
[00:44:34] <davidmogar> wyvern`: I only need to grab a text from the web, decode it, and then submit it. With urlconnection I can download and then decode it, but when I have to submit it...
[00:44:58] <wyvern`> :shrug: httpcomponents can do it. If you don't want to use it, feel free to fight with URLConnection.
[00:45:03] *** Glavata has joined ##java
[00:45:44] *** youdonotexist has quit IRC
[00:45:52] *** theNatd has left ##java
[00:46:26] <davidmogar> I'll take a look to httpcomponents, but, one question, Why dosen't work? If I can get while authenticated, why can't post nothing?
[00:46:48] <ojacobson> URLConnection isn't really meant to be a general purpose HTTP library
[00:46:57] <ojacobson> That it supports POST *at all* is a minor miracle
[00:48:11] <davidmogar> ojacobson: xD ok xD
[00:48:34] <ojacobson> Its primary purpose in life is downloading resources
[00:48:49] <ojacobson> which is why it shares an API with all of the other resource sources the JVM supports (files, JAR contents, and so on)
[00:49:19] *** RenatoSilva has joined ##java
[00:49:26] <chachan> Hi guys, I want to access to "this" object inside a callback function, is there a work around for this?: http://fpaste.org/vvJv/
[00:50:26] <ojacobson> Outer.this (i.e., Example.this)
[00:50:33] *** modernbob has quit IRC
[00:50:55] *** riotz has quit IRC
[00:54:20] *** Tiktalik has quit IRC
[00:55:27] <chachan> ojacobson, cool!
[00:55:57] *** RenatoSilva has left ##java
[00:56:34] *** new2net is now known as N2N
[00:56:59] *** wolfman2000 has joined ##java
[00:57:21] *** fisted_ has joined ##java
[00:58:52] *** modernbob has joined ##java
[00:58:57] *** balou has quit IRC
[00:59:05] *** ldh has quit IRC
[01:00:27] *** fisted has quit IRC
[01:01:24] *** kaemo has quit IRC
[01:01:57] *** cbeust has quit IRC
[01:04:54] *** lisak has joined ##java
[01:05:33] *** ninja_sense has quit IRC
[01:05:58] <lisak> hey, duplicate imports are removed before it gets to compiler right ?
[01:06:23] <lisak> so it is no issue for jsp as well
[01:06:44] <ojacobson> If your JSPs need imports, you have a larger problem
[01:06:47] <ojacobson> i.e., code in your JSPs
[01:07:34] <lisak> ojacobson, so why jsp were designed that way :)
[01:07:42] <ojacobson> Ignorance and good intentions
[01:07:58] *** lesce has joined ##java
[01:08:09] <ojacobson> It turns out the PHP/(classic) ASP style of dropping code right into your template files leads to an unmaintainable mess pretty quickly, in practice
[01:08:35] <ojacobson> treating JSP as a dumb template language and doing most of your heavy lifting in a controller (servlet or some framework controller) prior to rendering the result via JSP works out better
[01:08:37] <lisak> in robust apps it is not only about DTOs
[01:09:51] <lisak> but the issue is that you have a jsp that consists of a few jsp fragments. .. you usually server this page as a whole
[01:10:04] <lisak> but some of the fragments can be served by ajax
[01:10:05] *** PelleTut has quit IRC
[01:10:19] <ojacobson> I object to your choice of pronouns
[01:10:21] *** N2N has quit IRC
[01:10:26] <ojacobson> "I" certainly do not have that issue :)
[01:10:34] <lisak> so that the imported stuff cannot be included at one place for all fragments
[01:10:43] <ojacobson> Sure it can, a couple of ways
[01:10:43] *** nucc1 has joined ##java
[01:10:49] <lisak> but in each also in each fragment that gets served by ajax
[01:11:32] <lisak> we use "you" like that in my language :-)
[01:11:49] <lisak> an alternative is "one has a jsp"
[01:11:58] <ojacobson> "I have", I suspect.
[01:11:58] <lisak> it sounds even worse :)
[01:12:07] <ojacobson> Commit to your position
[01:12:18] <lisak> but to generalize the problem
[01:12:51] <ojacobson> Reusable content: static includes, dynamic includes (which involve making a second, internal request within the container), tag files - in increasing order of sophistication, basically
[01:12:51] *** EvilPenguin has quit IRC
[01:12:56] *** Alkhi has quit IRC
[01:13:16] *** jjido has joined ##java
[01:14:34] <White_Cat> for public class Coor { public int x; }
[01:14:40] <White_Cat> can I access that x directly?
[01:14:54] <ojacobson> White_Cat: what happened when you tried?
[01:15:06] *** ^Mike has left ##java
[01:15:09] <White_Cat> like if I have a Coor MyCor; Can I just do MyCor.x
[01:15:19] <White_Cat> it gives an error and I am not sure if I have messed up the syntax
[01:15:37] <White_Cat> it cannot find the symbol evidently
[01:15:47] <ojacobson> ~show us
[01:15:47] <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.
[01:16:26] <White_Cat> ok
[01:17:34] <White_Cat> http://pastebin.com/kKMW7med
[01:17:39] *** pist0l-fish has joined ##java
[01:17:58] <White_Cat> SeeAround () gives errors
[01:18:34] <White_Cat> .x is underlined and it says "Cant find symbol"
[01:19:14] <pist0l-fish> i am attempting to create a jar file (e.g. my_jar.jar), and the sources i'm compiling from use several libraries that i have as jar files (e.g. some_lib.jar). is there a way for me to put some_lib.jar in the my_jar.jar as to be able to deploy a jar file without any dependencies that the user has to be aware of?
[01:20:26] <echosystm> is anyone here familiar with dbunit ?
[01:23:20] *** jesmon has quit IRC
[01:23:29] <White_Cat> ojacobson do you see what I am doing wrong?
[01:25:18] *** kingping has joined ##java
[01:25:28] <kingping> Hey
[01:25:36] *** xelister has joined ##java
[01:25:52] <xelister> how best to embbed JRE isntallation with installer of my java program?
[01:25:59] <xelister> targeted mostly for windows
[01:26:01] <kingping> Is ArrayList's size() O(1) ?
[01:26:23] *** nixness has quit IRC
[01:26:59] *** nixness has joined ##java
[01:27:29] *** amichair has joined ##java
[01:28:00] *** freeone3000 has joined ##java
[01:28:39] <White_Cat> array should be size 10 I think
[01:28:48] *** nchaimov has joined ##java
[01:28:59] <White_Cat> I havent sized it, not sure if I am suposed to. it doesnt complain about that though
[01:29:35] <Fanook> kingping: i think that's what the docs say, yes
[01:29:49] *** TheTrash has quit IRC
[01:30:06] *** amichair has quit IRC
[01:31:10] *** Versuchen has quit IRC
[01:31:48] *** KarlKFI|work has quit IRC
[01:32:11] <kingping> Fanook: But "constant time" in "The size, isEmpty, get, set, iterator, and listIterator operations run in constant time." means that getting an ArrayList size will always, for example, be 0.3 milliseconds on my box irrespectively of the size, be it 3 elements or 3333 ?
[01:32:28] <kingping> (rougly)
[01:32:33] <kingping> *roughly
[01:33:00] <ojacobson> It means that the execution time is not affected by the number of elements in the array. It doesn't preclude other variables, like changes in JIT behaviour over the life of your program or fluctuations in the machine's load
[01:33:03] <Fanook> it means the runtime of those methods do not depend on the number of elements in the collection
[01:33:36] *** psst has quit IRC
[01:34:18] <White_Cat> yeah thats what I was told as well... I generally code in c++ so java is a bit strange for me in many ways. Not being forced to bother with array sizes is indeed a refreshing nice feature I really like.
[01:34:42] <White_Cat> if only I had somehting like struct like in c++
[01:34:53] <echosystm> is jdbi very popular?
[01:34:54] <White_Cat> thats rhe entire point of my Coor class
[01:35:03] <echosystm> documentation seems virtually nonexistent
[01:35:09] <pist0l-fish> kingping: this is because ArrayList keeps track of the number of elements in it (i.e. there is probably an integer in the class definition that is incremented on add and decremented on remove) so the size method probably looks like public void size() { return size; }. imagine if you did not keep track of the size though, you would have to traverse whatever underlying structure ArrayList defines to count the elements
[01:35:13] *** osrec has quit IRC
[01:35:36] <kingping> Ok, is it reasonable to use size() in while(..) condition, or it's better to use counter while I'm growing the list, so that on every iteration it equals the ArrayList size.
[01:35:53] <pist0l-fish> kingping: neither. use an iterator
[01:35:53] <freeone3000> White_Cat: The only difference between struct and class in C++ is that struct defaults to public and class defaults to private.
[01:36:07] <kingping> pist0l-fish: Indeed, that what I was thinking about.
[01:36:23] <pist0l-fish> kingping: it is almost always better to assume that the underlying iterator will have been written as efficiently as possible
[01:36:38] <White_Cat> yeah but classes needs a different file which is slightly annoying but its ok
[01:36:48] <pist0l-fish> kingping: for many data structures, it is impossible to write an efficient iterator yourself without access to some of the data structures private members
[01:36:56] <White_Cat> what exactly am I doing wrong, that eludes me
[01:37:00] <Fanook> kingping: be aware that normal iterators will fail if you modify their underlying collection. Make sure to use a ListIterator and modify the collection through that iterator so as not to invalidate it
[01:37:19] <tnzr> kingping: are you always adding to the end of the ArrayList?
[01:37:27] <tnzr> or do you have to insert into the middle sometimes
[01:37:36] *** barq has joined ##java
[01:38:13] <kingping> pist0l-fish: I have twisted condition in while(): while (iter.hasNext() && indexes.size() <= free_slots) { ... }, and I want to check if the ArrayList I'm growing doesn't get oversized (indexes.size() <= free_slots).
[01:38:41] <kingping> tnzr: I do (or I'm doing?)
[01:38:46] <pist0l-fish> kingping: see what Fanook said
[01:38:52] <Fanook> kingping: there's no such thing as an "oversized" list. it will grow as needed to fit the number of items
[01:39:26] *** dj_pi has joined ##java
[01:39:33] <kingping> Fanook: :-) Sorry for my English. I meant that I want the list being growed to fit some maximal size.
[01:39:52] <tnzr> if you know the maximum size ahead of time, why not use an array? :)
[01:40:26] *** Bombstone has quit IRC
[01:40:30] <kingping> I would then not use break; or what imperative languages programmers use to get out of the loop.
[01:40:37] <ojacobson> Huh. So what's the story with custom actions (<foo:bar />) not being allowed within <jsp:attribute>?
[01:40:38] *** shaunren has quit IRC
[01:40:39] <Fanook> in that case, you'd probably be better off creating your own list implementation and override the methods to obey that max size. You could still use an ArrayList internally
[01:40:53] <ojacobson> Google is surprisingly quiet about motivations for this kind of limit
[01:40:59] <pist0l-fish> tnzr: the only time you would not want to do that is if your actual size could vary greatly between 0 and the maximum size and would still require that the vm reserve memory for the collection in chunks
[01:41:15] <pist0l-fish> kingping: if memory is not an issue, what tnzr said is your best bet
[01:41:27] <tnzr> pist0l-fish: true
[01:41:31] <Fanook> arrays have their own problems, of course
[01:41:45] <kingping> Okay, thanks chaps, I'm going to combine all the knowledge and decide what's best.
[01:41:47] <ojacobson> There's a fixed-size list type
[01:41:57] <ojacobson> it's the list type returned by Arrays.asList(T[])
[01:42:07] <Fanook> ooh, good catch
[01:42:21] *** Matic`Makovec has quit IRC
[01:42:30] <ojacobson> It's a bit tricky to populate it, but listIterator will work
[01:42:37] <ojacobson> (I mean, aside from the initial contents)
[01:43:46] <cheeser> hrm.
[01:45:25] *** cocoloa has quit IRC
[01:46:10] *** cbeust has joined ##java
[01:46:20] *** arborist has quit IRC
[01:49:58] <ojacobson> htm?
[01:50:33] *** cool123 has joined ##java
[01:51:03] *** pist0l-fish has quit IRC
[01:52:55] *** zamN has joined ##java
[01:53:25] *** davidmogar has quit IRC
[01:53:29] *** Bombstone has joined ##java
[01:53:29] *** supercosmonaut has joined ##java
[01:53:58] *** jerkface03 has quit IRC
[01:54:48] <Fanook> the list returned by .asList() is somewhat non-mutable
[01:55:04] <ojacobson> Fanook: Non-resizable, last I recall
[01:55:10] <ojacobson> no .add, no .remove
[01:55:13] <Fanook> right
[01:55:21] <ojacobson> Fixed .size()
[01:55:25] <ojacobson> they're a very odd beast :)
[01:56:07] <Fanook> which considering they're a "bridge" between lists and arrays puts them in very odd territory
[01:56:22] *** Phil-Work has quit IRC
[01:56:38] *** tieTYT has joined ##java
[01:56:49] *** Phil-Work has joined ##java
[01:57:10] <tieTYT> has anyone ever used Dozer before? Dozer is not mapping my lists automatically even though the getter/setter/fields have the same name and they have the same element type (String). Seems like this should work automatically
[01:58:10] *** DJClean has quit IRC
[01:58:25] <ojacobson> Why does that name ring a bell
[01:58:32] <tieTYT> http://dozer.sourceforge.net/documentation/collectionandarraymapping.html
[01:58:48] <kingping> I think just plain variable is the best solution. While it's C-ish, I don't mess in OOP, java and all thess things, which waste my time.
[01:58:59] <Cher> For me the name rings a bell, of course! I've seen Fraggles.
[01:59:38] <kingping> (variable as a counter used in while to check if ArrayList's size fits in max number of elements)
[01:59:38] *** cythrawll has quit IRC
[01:59:43] *** Caffeine has quit IRC
[02:00:04] <tieTYT> i see the problem, retarded jaxws doesn't generate gettors
[02:00:06] <tieTYT> getters
[02:00:08] *** ab500 has quit IRC
[02:00:45] *** ab500 has joined ##java
[02:01:26] *** kingping has quit IRC
[02:07:00] <White_Cat> err
[02:07:04] <White_Cat> :/
[02:09:53] *** Phil-Work has quit IRC
[02:10:25] *** Phil-Work has joined ##java
[02:12:15] <White_Cat> I get "cannot find symbol" for .x's and .y's at http://pastebin.com/kKMW7med
[02:12:22] <White_Cat> what am I doing wrong? :(
[02:12:41] *** XeruX has joined ##java
[02:13:01] <XeruX> I'm updating a JPanel while program is running, how can I make the changes visible?
[02:13:04] <XeruX> Tried invalidate()
[02:13:25] <Fanook> revalidate the JPanel and then repaint it
[02:13:26] <XeruX> what I'm in fact doing is to replace a JPanel reference to a new JPanel, as in, replacing the old JPanel with a new one.. :s
[02:13:52] *** tigger0jk has quit IRC
[02:13:55] *** gelignite has quit IRC
[02:14:01] <Fanook> XeruX: you may want to consider using CardLayout
[02:14:35] <XeruX> Fanook: Working on a preferences JFrame/dialog, switching between tabs
[02:14:49] <Fanook> even more so then
[02:14:53] <XeruX> using a custom controller (macwidgets) etc
[02:15:17] *** qeed has quit IRC
[02:15:23] <XeruX> hm. I'll look into CardLayout then
[02:15:25] <XeruX> ty
[02:15:28] <Fanook> CardLayout is designed for switching between panels in the same layout area
[02:15:53] *** tilerendering has quit IRC
[02:17:43] *** cyphorious has joined ##java
[02:18:10] *** nixness has quit IRC
[02:18:26] <XeruX> Fanook: k, what I've got atm. is a borderlayout, where the tabbed buttons are in north, the jpanel which I want to replace according to what button the user clicks on in Center. Isn't cardlayout most often used with a combobox?
[02:18:35] <White_Cat> how can I access a public variable within a class? :/
[02:20:25] <Fanook> XeruX: cardlayout can be used with whatever you want. in this case, the jpanel in the center would have a cardlayout which would swap the desired panel based on which button the user clicks
[02:20:31] <Fanook> White_Cat: just access it
[02:20:49] <White_Cat> its giving me erros
[02:20:52] <White_Cat> I dont understand why
[02:20:59] <White_Cat> http://pastebin.com/kKMW7med
[02:21:11] <Fanook> 1) read the errors and the complete error message. 2) pastebin the code and the errors
[02:21:20] <White_Cat> I did paste it
[02:21:29] <White_Cat> error is "cannot find symbol" for .x and .y's
[02:21:39] *** teralaser has quit IRC
[02:21:55] <White_Cat> problem is in SeeAround ()
[02:22:23] <Fanook> pastebin the exact errors you're getting
[02:22:32] <White_Cat> I dont know how to copy it
[02:22:36] <White_Cat> its all the same error
[02:22:37] <Fanook> it's not that i don't trust you, i just don't trust you
[02:22:52] <White_Cat> "cannot find symbol" where it points to the .x
[02:22:55] <White_Cat> .x is underlined
[02:23:04] <White_Cat> I am using netbeans
[02:23:13] <Fanook> and you've done a clean and build?
[02:23:17] <White_Cat> yes
[02:23:35] <White_Cat> I think
[02:25:03] <Fanook> go make sure
[02:25:04] *** kermit has joined ##java
[02:25:24] *** kermit has joined ##java
[02:25:35] <xelister> how best to embbed JRE isntallation with installer of my java program? for windows
[02:25:52] <freeone3000> xelister: Java gives you an MSI. Put its MSI in your MSI.
[02:25:53] <White_Cat> I dont know how
[02:26:02] <White_Cat> do you see anything wrong with the code at all?
[02:26:42] <xelister> freeone3000: installer is an .exe probably
[02:27:02] <ojacobson> xelister: well, there's your zero'th problem
[02:27:05] <freeone3000> White_Cat: Your code works, despite it not going with conventions. So your build's screwed up.
[02:27:17] <ojacobson> We live in the future. Act like it. Package your app in something other than a random executable.
[02:27:24] <White_Cat> what are these conventions?
[02:27:27] <freeone3000> ~conventions
[02:27:27] <javabot> freeone3000, conventions is http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html , or "ThisIsAClassName, thisIsAVariableOrMethodName, THIS_IS_A_CONSTANT_NAME". See also http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
[02:33:05] *** jjido has quit IRC
[02:33:11] *** lighta has quit IRC
[02:36:24] <xelister> ojacobson: well but MSI sounds really gay, it has MicroSoft in it
[02:36:36] <ojacobson> xelister: You're deploying on Windows, dude.
[02:36:47] <ojacobson> Also, use "gay" as a perjorative again and I'll ban you.
[02:37:22] <xelister> nigger, please
[02:37:39] <xelister> :)
[02:37:42] <ojacobson> MSI gives you really solid integration with Windows' (minimal) package management, the ability to chain installers, and a bunch of other things in a nice, uniform, user-friendly package
[02:38:14] *** fisted_ has quit IRC
[02:38:22] <xelister> meh. Perhaps you are right
[02:38:22] *** lisak has quit IRC
[02:41:27] <White_Cat> this is not right is it? ArrayList<ArrayList<int>> = new ArrayList<ArrayList<int>>;
[02:41:54] <ojacobson> You're missing some parens on the new-expression, and type parameters must be reference types (so int can't be a type parameter)
[02:42:50] *** wchun has joined ##java
[02:42:54] <White_Cat> how would I get a 2d dynamic array? http://stackoverflow.com/questions/3540713/dynamic-2d-array-in-java-using-arraylist this one looks like it wouldnt handle the task :/
[02:43:09] <dmlloyd> it is embarrassing when your code marked /* not reached */ is, in fact, reached
[02:43:17] *** fisted has joined ##java
[02:43:34] <dmlloyd> would be kind of nice if you could somehow assert that some line of code is not reached
[02:43:34] <White_Cat> can i just do a int[][] and assign them values without worying about size?
[02:43:43] <dmlloyd> ~~ White_Cat arrays
[02:43:43] <javabot> White_Cat, arrays is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
[02:44:05] <White_Cat> I am trying to do 2d arrays
[02:46:03] <freeone3000> dmlloyd: 'assert false;', and run with -ea.
[02:46:06] <XeruX> Fanook: CardLayout worked fine, but now I'm strugling with placing what you see in the center @ http://img25.imageshack.us/i/screenshotrttssettings.png/ at the top
[02:46:20] <XeruX> the "Operations folder" + textfield etc = JPanel with GridBagLayout
[02:46:35] <dmlloyd> freeone3000: that'll yield a compile error if the statement is in fact unreachable
[02:46:48] <XeruX> The main layout is BorderLayout, where tabbed buttons = north and the card to display is center
[02:46:59] <XeruX> maybe I should use SOUTH..? I'll try that
[02:47:19] <freeone3000> dmlloyd: Thought you mean "reachable, but through conditions that can't happen".
[02:50:08] <Fanook> XeruX: use a FlowLayout or GroupLayout for the preference panels.
[02:51:21] <Fanook> XeruX: the idea is that the JPanel in CENTER has a CardLayout that swaps between JPanels that have their own layouts. Each card can have a different layout specific to itself
[02:51:48] <cbeust> Swing's layout managers claim another victim.
[02:52:24] *** wliao has joined ##java
[02:52:40] *** cyphorious has quit IRC
[02:53:12] <XeruX> Fanook: so I can still have BorderLayout to place the tabbedBar and the card-panel ?
[02:53:51] <Fanook> sure. every container has its own layout manager
[02:54:53] <Fanook> it would be pretty silly if every container had to use the same layout
[02:54:57] <XeruX> but my "General"-settings-panel has GridBagLayout as layout manger, but I can't seem to place it at the top - it's centered.
[02:55:40] <Fanook> when you add the item to your gridbag, I think you can set the vertical alignment
[02:56:02] <freeone3000> You can set the everything. It's why you should avoid GridBagLayout.
[02:56:22] <Fanook> great power begets great confusion
[02:56:27] <XeruX> thought it was c.anchor=START_something , but didn't work. I'll look into it though, should be able to figure it out :P
[02:57:12] *** tissue has joined ##java
[02:57:15] *** Matuku has quit IRC
[02:57:29] <freeone3000> There's actually five constants with differing values that mean the same thing, and an additional two that mean the same thing assuming en_US locale.
[02:57:42] *** Macstheyjustsuck has joined ##java
[02:57:54] *** gucko has joined ##java
[02:57:58] <gucko> hi guys
[02:58:30] <Macstheyjustsuck> In C++, you can use #DEFINE to make a phrase have a number value, I know there's no pre-processor in Java, but is there some way to do that in Java?
[02:58:39] <Macstheyjustsuck> without enums
[02:58:40] *** Serendib has quit IRC
[02:58:42] *** Sliker has quit IRC
[02:58:52] <cheeser> public final int BOB = 42;
[02:58:53] <gucko> how can I access the session object in a jsp page? I want to access it to get a bean , then work with this bean...like do: bean.getSomething() ...etc
[02:59:03] <Fanook> heck, make it static too!
[02:59:09] <cheeser> oh, i meant to.
[02:59:10] <cheeser> 8^)=
[02:59:18] <Macstheyjustsuck> cheeser: But wouldn't that still be an int? Could you use that in place of a String?
[02:59:34] <cheeser> uh. yeah it'd be an int.
[02:59:35] <Fanook> so do a static final String foo = "somestring"
[02:59:38] *** jdolan_ has quit IRC
[02:59:38] *** xiliax has quit IRC
[02:59:42] <XeruX> Awesome. Found out how to do it :) thanx for the help
[02:59:57] *** Wicked has quit IRC
[02:59:58] <Macstheyjustsuck> Fanook: But then you couldn't use that in place of an int
[03:00:14] <cheeser> java has types. you can't just swap 'em around.
[03:00:14] <XeruX> for the last component I add I just do c.weighty=1.0; which requests whatever vertical space there's left
[03:00:27] <Macstheyjustsuck> Wasn't asking to swap them around XD
[03:00:29] <Fanook> um...yes...why would you want to use a string where an int is required?
[03:00:34] <gucko> it seems nobody will answer my question because I'm using VERY old stuff :(
[03:00:40] *** t0rc has joined ##java
[03:01:01] <Macstheyjustsuck> Fanook: I want to use a word rather than a number
[03:01:13] <Fanook> and which part of what cheeser gave you doesn't do that?
[03:01:16] <cheeser> so you'd use BOB instead of 42
[03:01:25] <Macstheyjustsuck> Rather than, for example, 0512123654, I would use TACO
[03:01:46] <cheeser> public static final int TACO = 0512123654;
[03:01:53] <cheeser> how hard does it have to be?
[03:01:56] *** mkovacs has joined ##java
[03:02:16] <Fanook> how hard can we make it?
[03:02:55] <freeone3000> We could add in an additional precompilation step which does a search-and-replace for the left-hand side with the right-hand side, ignoring any sort of context, and give erroneous error numbers if there's ever a problem.
[03:03:05] *** Wicked has joined ##java
[03:03:37] *** chomping has joined ##java
[03:03:38] <Fanook> do we have to give error numbers?
[03:03:41] <Macstheyjustsuck> I came in here knowing what I wanted and why, it just all fell apart when I tried explaining it -.-
[03:03:49] <Macstheyjustsuck> Sorry
[03:03:53] *** Tiktalik has joined ##java
[03:03:53] *** Macstheyjustsuck has left ##java
[03:03:59] <cheeser> ~nnext
[03:03:59] <javabot> cheeser, what does that even *mean*?
[03:04:02] <cheeser> heh
[03:04:06] <freeone3000> Fanook: Yes, but they're allowed to be completely irrelevant and in a system-provided file.
[03:04:12] <ojacobson> Someone should've waved the phrase "constant expression" at him
[03:04:15] <ojacobson> I would've, but I just got un-afk
[03:04:30] <freeone3000> But it's not a constant expression, cause you can't use it in an annotation parameter.
[03:06:52] *** terranova has joined ##java
[03:07:04] <XeruX> another question, what layout manager should I use to place two buttons aligned to the right edge of the panel? ("Apply" & "Cancel"-buttons)
[03:07:18] <XeruX> absolute positioning.. gridbag?..
[03:07:28] <freeone3000> FlowLayout.
[03:07:37] <XeruX> k
[03:08:54] *** tewecske has quit IRC
[03:09:37] *** tigger0jk has joined ##java
[03:13:17] <cbeust> XeruX: are you sure you can't reuse an existing dialog? It's sad that you have to do this kind of thing yourself
[03:13:23] *** devkhadka has joined ##java
[03:13:26] <cbeust> it's also guaranteed to give a non standard lay out
[03:13:58] <XeruX> cbeust: I'm creating a settings/preferences dialog, not sure if there's anything standard to use
[03:14:06] <XeruX> apart from conventions as to where apply/cancel goes etc
[03:15:15] <cbeust> XeruX: try to find one, I haven't done Swing in a long time but there has to be some reusable dialog where all you need to do is implement your own panel but everything else is done for you, especially the ok/cancel buttons
[03:15:47] <freeone3000> JDialog says that you *have* these buttons, but not where they go. You can extend JOptionPane to get one of the standard dialog types with custom content.
[03:16:10] <XeruX> hm, I guess I could do that
[03:16:29] <XeruX> but I've already made the tabbed-bar, custom panel content and the apply/cancel-buttons at the bottom
[03:19:39] <cbeust> Yeah all you should be doing is say which buttons you need and get callbacks on them
[03:19:44] <cbeust> but you shouldn't have to lay them out
[03:20:14] <cbeust> This is one of the many reasons why people complain that Swing never looks native
[03:20:39] *** homie has joined ##java
[03:21:01] *** lamdk has quit IRC
[03:21:09] <XeruX> http://img691.imageshack.us/i/screenshot3ld.png/ <- doesn't look too bad either
[03:21:38] <XeruX> cbeust: I guess you're right - maybe swing needs a do-over?
[03:22:31] <freeone3000> cbeust: You're talking about JOptionPane. (But there, you don't get to decide what the buttons do - just the return code mapped to whether it was APPROVED or CANCELLED.)
[03:22:39] <Fanook> yeah, and they could name it to sound cool...maybe somethingFX....
[03:23:12] <XeruX> is it possible to add some sort of padding above my Apply/Cancel-buttons (which are in a JPanel using flowlayout)?
[03:23:35] <XeruX> I use theFrame.pack() , but I'd like at least 30 pixels of space above Apply/cancel :P
[03:23:36] <freeone3000> XeruX: You can add an empty border, or add a Box, or add some Insets.
[03:23:41] <Fanook> or glue
[03:24:03] <XeruX> hmm
[03:25:04] <XeruX> I'll go for the empty border option. been a while since I've worked with swing
[03:25:23] <XeruX> the last time I made a swing app I used the built-in gui-builder in NetBeans because I was in a hurry :P
[03:25:39] <freeone3000> When doing it properly, things get nested in a hurry.
[03:27:16] <cbeust> I cleared your comment about JOptionPane as I started reading, what were you saying?
[03:28:05] <freeone3000> cbeust: It gives one of the standard OS-styled dialogues, can be extended to show different contents, and puts the appropriate buttons in the appropriate positions. You don't decide what the buttons do, but you do get whether it was APPROVED or CANCELLED (where you started it from).
[03:28:29] <gucko> guys I just discovered something, that web dev in java sucks :(
[03:28:42] <XeruX> ooo I remember creating a "native" file-chooser with preview of images etc
[03:28:44] <gucko> I really can't work with jsp
[03:28:44] <XeruX> that was a bitch
[03:28:57] <XeruX> using some awt file-chooser or whatever
[03:28:58] <gucko> it seems that I must learn a framework
[03:29:01] <cbeust> freeone3000: yup, that's the one everyone should use
[03:29:28] <cbeust> Still suffers from Swing's deficiencies though, e.g. can you cancel it by pressing ESC? And get the default by pressing RETURN?
[03:29:36] *** hex` has quit IRC
[03:29:59] <meeper> cbeust: you can if you add listeners but such behavior is not 'cross platform'
[03:30:29] <cbeust> meeper: you shouldn't have to add listeners to get the standard behavior, that's the problem with Swing (a lot of wrong defaults)
[03:31:01] <meeper> cbeust: yeah, I remember having this conversation long long ago. don't think they ever fixed it.
[03:31:05] <freeone3000> cbeust: You get the default by pressing return. Not sure about escape.
[03:31:07] *** deSilva has quit IRC
[03:31:20] *** sanchaz has joined ##java
[03:31:46] <cbeust> they never fixed it even in 10 years http://stackoverflow.com/questions/642925/swing-how-do-i-close-a-dialog-when-the-esc-key-is-pressed
[03:32:05] <meeper> these days people writing java gui apps really should use swt. especially now that windowbuilder is free. there's really no point to using swing imo
[03:32:27] <cbeust> ~ meeper ++
[03:32:27] <javabot> cbeust, what does that even *mean*?
[03:32:29] <cheeser> tee hee hee
[03:32:54] *** AMcBain has joined ##java
[03:33:19] *** meling has quit IRC
[03:35:06] *** Nikelandjelo has quit IRC
[03:37:09] <tjsnell> ~javabot++
[03:37:10] <javabot> javabot has a karma level of 223, tjsnell
[03:37:10] *** cbeust has quit IRC
[03:37:41] <ojacobson> Servlet 3 question. Is there a way to put a .jsp into a JAR file that lives in WEB-INF/lib/ in the app such that the JSP *can* be mapped in as a servlet (via jsp-file) but *cannot* be reached directly (as it would be if it were in the JAR's META-INF/resources/)?
[03:37:44] *** cbeust has joined ##java
[03:38:15] *** sorabji52 has quit IRC
[03:38:28] *** X-Scale has joined ##java
[03:39:20] *** rgr has joined ##java
[03:42:51] *** Bombstone has quit IRC
[03:43:05] *** terranova has quit IRC
[03:44:13] *** pyrony has quit IRC
[03:45:39] *** mxweas has quit IRC
[03:46:26] *** gucko has quit IRC
[03:47:29] *** L-----D has joined ##java
[03:48:18] *** eyesUnclouded has joined ##java
[03:56:48] *** Behold has quit IRC
[03:57:05] *** cool123 has quit IRC
[03:57:34] *** cool123 has joined ##java
[03:58:51] *** sanchaz has quit IRC
[03:59:02] *** cool123 has quit IRC
[03:59:29] *** rgr has quit IRC
[03:59:32] *** cool123 has joined ##java
[04:01:56] *** ojacobson has quit IRC
[04:04:19] *** ojacobson has joined ##java
[04:04:58] *** barq has quit IRC
[04:05:03] *** pyrony has joined ##java
[04:05:35] *** grug has joined ##java
[04:08:04] *** phantomcircuit has joined ##java
[04:11:23] *** cool123 has quit IRC
[04:11:42] *** pyrony has quit IRC
[04:17:29] *** BoF has joined ##java
[04:18:15] *** rjohnson19 has quit IRC
[04:18:42] *** teralaser has joined ##java
[04:25:08] *** LadySerena has joined ##java
[04:25:17] *** meling has joined ##java
[04:36:44] *** happyuser163 has joined ##java
[04:41:49] *** epalm has joined ##java
[04:42:16] <bearded_oneder> .
[04:44:10] *** caverdude has joined ##java
[04:44:35] *** phantomcircuit has quit IRC
[04:45:38] *** X-Scale has quit IRC
[04:47:07] *** tilerendering has joined ##java
[04:49:29] *** kebomix has joined ##java
[04:51:01] <kebomix> this method hangs the application when i call it, i don't know why !, any solution !, there is no error or anything ! just the application hangs ! http://pastebin.com/j6RrY3ZP
[04:52:20] <AMcBain> kebomix, can you convert that to a self-contained test-case that also exhibits the problem?
[04:53:00] <AMcBain> The problem for us is mainly the code we cannot see (though you seem to indicate you did track it down to the call of this method perhaps), and classes such as PixelGrabber, etc.
[04:55:26] <AMcBain> heh heh heh. PixelGrabber is a core class. I'm awesome tonight! but at any rate, it still exists that DownQuadrant is an unknown.
[04:55:29] <kebomix> ds.downSample(), that is how i called it , and it is really hard to convert it to self-contained test-case :(
[04:55:53] *** devkhadka has quit IRC
[04:56:12] <grug> do you know what line it is hanging on?
[04:56:22] <AMcBain> kebomix, that's going to be the best way you'll solve this, as you will remove any code that doesn't cause the problem in the process. and if you find along the way it no longer happens, then something you removed is the real cause.
[04:57:05] <AMcBain> It seems to me it wouldn't be too much trouble to wrap the given method in a class with a main and supply the Image instance you use.
[04:57:12] <AMcBain> along with the DownQuadrant method.
[04:57:26] <XeruX> How can I get an FileOutputStream of a file that's inside a certain package? Tried new FileOutputStream("/apackage/secondpackage/appProps.properties" but it fails
[04:57:38] *** digs has joined ##java
[04:58:00] <kebomix> http://pastebin.com/xHLHj9nF here is the downQuadrant all math
[04:58:03] <AMcBain> XeruX, it's not a good idea to write into packages, especially if your program is going to be later packaged intoa JAR.
[04:58:13] <digs> Is there a way to save the state of a java app and exit? Then when you start the java app back up, the state is restored?
[04:58:15] *** fuzzygroove has joined ##java
[04:58:32] <AMcBain> kebomix, that paste is seemingly empty.
[04:58:34] <XeruX> AMcBain: what would you suggest I do then?
[04:59:00] <XeruX> I need to save/load properties
[04:59:15] <AMcBain> XeruX, store it somewhere outside of the application. Perhaps extract the internal copy to outside the program then use it from there. Or check out solutions such as the Preferences class.
[04:59:53] <AMcBain> A Preferences node could easily be populated from default data, perhaps from an internal Properties file.
[05:00:14] <XeruX> I just need a place to store key/value-pairs
[05:00:21] <freeone3000> digs: You want Preferences.
[05:00:22] <XeruX> I basically have no properties in the beginning
[05:00:30] <freeone3000> XeruX: And Preferences for you, too.
[05:00:31] <AMcBain> Then Preferences is fine.
[05:01:00] *** fuzzygroove has left ##java
[05:01:52] <kebomix> AMcBain:sorry here is the correct one http://pastebin.com/HAW552bj
[05:02:16] <kebomix> the problem in pixelgrabber i believe
[05:02:43] <AMcBain> kebomix, well you've got a lot of nested loops here, and I wouldn't be surprised if given a large image that this wouldn't just take a very, very, long time.
[05:02:57] <XeruX> is the preferences-class specific for each class, or for the entire app?
[05:03:04] <AMcBain> XeruX, either.
[05:03:10] *** phantomcircuit has joined ##java
[05:03:27] <XeruX> good.
[05:03:30] <AMcBain> You can make a class that you use as the anchor for an application or you are also free to use more than one class in the application as an anchor.
[05:03:33] <kebomix> yeah, but the nested loops are limited, small loops not looping the whole image
[05:03:48] <AMcBain> kebomix, over all, I mean.
[05:04:01] <XeruX> AMcBain: as in, have a static class to keep track of the preference-class instance?
[05:04:27] *** nmx has joined ##java
[05:04:33] <AMcBain> XeruX, I'd suggest a wrapper around it that you pass everywhere with accessors for things you use.
[05:04:39] <AMcBain> That way you don't lose flexibility.
[05:04:56] <White_Cat> hey
[05:05:10] <AMcBain> You can pass an instance of your preferences or wrapper anywhere, static while it seems nice, makes it hard to do certain things easily, and it's not that nice of a pattern here.
[05:05:19] <White_Cat> I am trying to impliment a Breadth First Search
[05:05:43] <AMcBain> kebomix, you've got two nested loops in the first paste, the inner one calling that other method which has 2 more nested loops called ever iteration of the nested loop from the first.
[05:05:51] <White_Cat> I already coded most of it but I am sort of puzzled about recording the path I want to take since I am a java newbie
[05:05:53] <White_Cat> http://dasl.mem.drexel.edu/Hing/BFSDFSTutorial.htm
[05:05:53] <XeruX> AMcBain: so, you mean I should (somewhere, like in my main gui-frame) create an instance of the preference class and pass it around wherever I might need it ?
[05:05:59] <White_Cat> that url explains the structure I need
[05:06:06] <AMcBain> kebomix, I'd try commenting out some of the nested calls and see if it finishes and slowly add more stuff back in.
[05:06:11] <White_Cat> what existing java structure would be better?
[05:06:35] <AMcBain> XeruX, erm ... perhaps in the controller class for the application. that's not really the GUI layer's responsitiblity.
[05:06:43] <AMcBain> but yes, that's about right, pass it around.
[05:07:03] <AMcBain> If you wrap it in a class you have the ability to abstract away the keys you need if you like, though there is a bit of repition involved without using any magic.
[05:07:47] <AMcBain> Plus then the wrapper class (if appropriately named) can become the anchor for your app preferences instead of some other arbitrary class in the program.
[05:07:55] <freeone3000> White_Cat: Generally a stack is used to track where you've been. Push items on the stack to forge ahead, pop items from the stack to backtrack. Mayhaps maintain a separate set of visited items (if items don't know if they've been visited) so you don't hit cycles.
[05:08:08] <XeruX> k
[05:08:52] *** matsebc has quit IRC
[05:09:18] <White_Cat> hmm
[05:10:15] *** ivenkys_ has quit IRC
[05:10:25] <White_Cat> for BFS I need a FIFO model so queue works best but the problem with queue is once I have reached the end point I also have ended up all my path info
[05:11:00] <White_Cat> I need a method to record path choices I have
[05:11:16] <White_Cat> sort of like a tree
[05:11:24] *** eyesUnclouded has quit IRC
[05:11:58] <White_Cat> but I want to avoid pointer usage like pague so I am confused as to what to use.
[05:12:00] *** ivenkys has joined ##java
[05:13:25] <kebomix> AMcBain: i found it, the problem was with pixelgrabber, and pixelgrabber can be used only with image object not with imagebuffer object which i use
[05:13:36] <White_Cat> see the pictures of the branching?
[05:13:41] <White_Cat> thats what I want probably
[05:13:47] <White_Cat> thats not a queue...
[05:13:50] <AMcBain> kebomix, great.
[05:14:09] *** matsebc has joined ##java
[05:14:10] <AMcBain> White_Cat, wha? What you said about "pointer usage" makes no sense.
[05:17:02] *** nmx has quit IRC
[05:17:57] *** nmx has joined ##java
[05:19:16] *** teralaser has quit IRC
[05:19:38] <White_Cat> AMcBain in c++ one solution would be the use of pointers to construct such a tree
[05:19:46] <White_Cat> I dont want to deal with that unless I absilutely have to
[05:19:56] <White_Cat> I dont know if this concern has a point in java
[05:19:57] <White_Cat> :(
[05:20:00] <freeone3000> It doesn't.
[05:20:07] <freeone3000> (It barely has a point in C++.)
[05:21:31] <White_Cat> ah
[05:21:35] <White_Cat> saves me lots of pain :)
[05:21:38] <ztj> White_Cat: "deal with" what?
[05:21:40] <ztj> What pain?
[05:22:23] <White_Cat> freeone3000 are there any tree structures like that in java
[05:23:06] <freeone3000> When you make a tree, you care more about the internals than the actual structure. So you're going to make your own.
[05:23:12] * AMcBain swaps computers.
[05:23:31] <White_Cat> freeone3000 so such a data structure doesnt exist by default then, thanks thats all I needed to know.
[05:23:47] <AMcBain> White_Cat, there are tree structures in Java, but you're being pretty confusing.
[05:23:55] <White_Cat> ok
[05:24:04] <White_Cat> should I start over, I appologise if I wasnt clear
[05:25:04] <White_Cat> ok I have a way where I am able to compute the shortest path using queues (BFS implimentation) to find my shortest path to my end goal in a maze
[05:25:07] *** Rainier has joined ##java
[05:25:15] <ztj> java has tree backed collections but not plain actual trees that I'm aware of
[05:25:47] <freeone3000> Because you usally don't care that it's a tree, you care that it's a set. If you're using a tree, you're probably using some sort of weird special tree, where you care about the internals rather than the actual storage.
[05:26:02] *** AMcBain has quit IRC
[05:26:16] <Rainier> That's still my quit message? wow. :P
[05:26:36] <White_Cat> how else can I record it if it isnt a tree?
[05:26:46] <White_Cat> each cell has 1-8 possible branching 8 only at start since the place I came from is uninteresting later on.
[05:27:35] *** xingped has quit IRC
[05:30:41] *** cbeust has quit IRC
[05:31:20] *** cbeust has joined ##java
[05:31:46] <XeruX> Any tutorials online on how to seperate views,controllers and models when working with swing? I usually just have the actionlisteners for the buttons etc in the same class, i.e a JPanel-class
[05:31:53] <XeruX> Maybe I should split it all up a bit?
[05:33:11] <Fanook> ~mvc
[05:33:11] <javabot> Fanook, mvc is http://ootips.org/mvc-pattern.html -- For GUI development, examples include the Smalltalk libraries and Swing. For web applications, see Spring or one of the multitude of other frameworks
[05:33:26] <Fanook> go read that
[05:33:32] <Rainier> White_Cat, yeah, I think as given previously that's perfect for a queue. Push things on, then take things off the end to evaluate.
[05:33:43] <Rainier> So the first thing on the queue would be your current location.
[05:33:53] <Rainier> Pop it off, and push on the other 8 locations.
[05:34:56] <karstensrage> hi
[05:35:05] <Rainier> and following freeone3000's comment, maybe perhaps keep a set of visited locations so you don't cycle.
[05:35:26] <karstensrage> are there jvm options that will log memory details of the jvm that can be read in by jconsole at a later time?
[05:35:42] <Rainier> I can tell you this queue thing works really great for revealing squares in a minesweeper game ;)
[05:35:48] <karstensrage> and show all the memory details that jconsole would show if you left it running over time?
[05:36:25] <karstensrage> +XX:PrintGCDetails only seems to print GC details
[05:36:29] <XeruX> Fanook: can't find anything about swing on that page. I just read a couple of articles on swing + mvc, but they didn't provide any good examples
[05:37:04] *** dyurds has joined ##java
[05:37:56] *** c_axis has quit IRC
[05:39:57] <freeone3000> karstensrage: You want a heap dump.
[05:40:12] <Rainier> XeruX, MVC is really a concept of separation of concerns into 3 main areas (or some fuzzy application of such), but in reality what you actually end up doing isn't perfectly cut. It will vary depending on what you are doing and what you need.
[05:40:15] *** terranova has joined ##java
[05:40:15] <karstensrage> i want a long running dump that i can analyze later
[05:40:47] <karstensrage> freeone3000 I *would* just hook jconsole up to it and run it for 2 days.... I cant cause of networking issues, i cant get a console on the machine
[05:41:11] <freeone3000> A heap dump is a finite thing. You can probably take a heap dump every so often, and that'll give you a pretty decent idea...
[05:42:20] <karstensrage> hmmm
[05:42:43] <XeruX> because it seems like I keep having the controller and view in the same class, like: I've got a JPanel with different types of data, with different models ( a table, drop-down list ) etc - and I tend to have the listeners in the same class, well, in private classes.. :S
[05:42:46] *** ojacobson is now known as ojacobson_
[05:43:08] <XeruX> so I'm not sure if I'm following the conventions of creating good swing applications :p
[05:43:31] *** ojacobson_ is now known as ojacobson
[05:43:59] *** matsebc has quit IRC
[05:44:18] *** daark has joined ##java
[05:45:01] <freeone3000> A JTable isn't a model. A JTable is an aggregate view. A TableModel is a Model.
[05:45:04] *** rfw has joined ##java
[05:45:24] <XeruX> I know, but I meant the model of the table
[05:45:26] *** Fanook has quit IRC
[05:48:48] *** chachan has quit IRC
[05:49:59] *** kieran491 has joined ##java
[05:52:35] *** zuxqoj has joined ##java
[05:54:39] *** Fanook has joined ##java
[05:55:48] *** matsebc has joined ##java
[05:56:10] *** top^ has joined ##java
[05:56:49] *** daark has quit IRC
[05:58:40] *** marcosroriz has joined ##java
[05:59:53] <White_Cat> hmm
[06:00:53] <White_Cat> whats a good data structure to impliment trees in java?
[06:01:07] <Rainier> TreeNode.
[06:01:28] <Rainier> Mainly because you can also use DefaultTreeNode if you want an existing impl.
[06:01:49] *** bojo has quit IRC
[06:01:51] <freeone3000> DefaultTreeNode isn't part of the SDK.
[06:01:53] <Rainier> ah, hm, more of an interface for a structure.
[06:02:25] <Rainier> ~javadoc DefaultTreeNode
[06:02:29] <javabot> I don't know of any documentation for DefaultTreeNode
[06:02:31] <freeone3000> TreeNode is a useful useless starting place. No need to make it conform to that interface. Defined recursively, a tree is a rooted structure with up to n children, where each child is a tree.
[06:03:00] *** ojacobson_ has joined ##java
[06:03:06] <freeone3000> Or: public class TreeNode<K> { public List<TreeNode<K>> children; public K data; }
[06:03:22] <Rainier> FIne, it's called DefaultMutableTreeNode, but it *is* in there.
[06:03:36] <Rainier> At any rate, you don't need much to make a tree, yes.
[06:03:47] *** ojacobson_ has joined ##java
[06:03:49] <Rainier> I don't see why TreeNode is a bad place to start. It is very minimal.
[06:04:05] <freeone3000> Rainier: That's a javax component, and DefaultMutableTreeNode is *far* from minimal.
[06:04:22] <White_Cat> Rainier looking now
[06:04:24] <Rainier> freeone3000, yes, but TreeNode (the interface) is.
[06:04:29] <White_Cat> I am trying to impliment something like http://en.literateprograms.org/Image:Suffix-tree-rendered-output.png
[06:04:36] *** BoF has quit IRC
[06:04:41] *** BoF has joined ##java
[06:04:50] <Rainier> freeone3000, though yes if you don't need parent attachments and the like you could get simpler.
[06:05:34] *** ralnaemi has joined ##java
[06:06:06] *** terranova has quit IRC
[06:06:16] <ralnaemi> Say I'm looking for a joptionpane.showinputdialog with more than one input (text field, combobox etc), what should I be googling for?
[06:06:45] <White_Cat> Rainier is treenode a default implimentation like queue?
[06:06:59] <Rainier> ralnaemi, pass in a JPanel instance for the "message" parameter of a messageDialog.
[06:07:00] <White_Cat> ah it isnt part of the sdk
[06:07:12] <Rainier> TreeNode is an interface.
[06:07:40] <ralnaemi> Rainier: How would I get the user's input? Just put it all into an array or something and return that?
[06:07:51] <White_Cat> I want to add children to the main node recursively till an end point is reached
[06:07:55] *** pippijn has left ##java
[06:08:02] <White_Cat> then I want to cycle back to the parent
[06:08:07] <White_Cat> stacking those on my way
[06:08:11] *** daark has joined ##java
[06:08:14] <Fanook> ralnaemi: when the user clicks Okay, you still have the panel you passed in. Read the values from that
[06:08:20] <freeone3000> White_Cat: Okay. Sounds like you know what you want to do. Have you tried doing it?
[06:08:23] <Rainier> ralnaemi, no, you keep a reference around to the items you added to the panel and inspect them.
[06:08:36] <White_Cat> I dont know what data type to use for this
[06:08:46] <ralnaemi> Fanook, Rainier: Cool. That's so much easier. Thanks.
[06:08:46] <Rainier> White_Cat, I told you previously.
[06:09:02] <White_Cat> I coded something like this on c++ but my new "world" is far more complex
[06:09:12] <Rainier> White_Cat, in fact, I think I even gave away how to do it all (probably a mistake), but you don't seem to have registered that fact.
[06:09:33] <White_Cat> umm
[06:10:12] <Rainier> about an hour and a half ago
[06:10:18] <White_Cat> you did mention a DefaultMutableTreeNode I take it that is part of the sdk?
[06:10:21] <White_Cat> half an hour?
[06:10:35] <White_Cat> <Rainier> White_Cat, yeah, I think as given previously that's perfect for a queue. Push things on, then take things off the end to evaluate.
[06:10:36] <White_Cat> oh
[06:10:40] <White_Cat> thats implimented already
[06:10:52] <White_Cat> but once I poll for an item its permanently removed
[06:10:52] <Rainier> yes, but that is a Swing class.
[06:11:20] <White_Cat> once I reach the ending I need that path recorded somehow
[06:11:21] <Rainier> if all you're doing is a BFS, why does it matter if items are "gone" when taken off the queue?
[06:11:31] <Rainier> Then pop those onto another data structure.
[06:11:42] <White_Cat> hmm
[06:11:54] <White_Cat> yeah I was seeking a tree for that reason :)
[06:12:08] <White_Cat> am I trying too hard?
[06:12:17] *** Cymage has quit IRC
[06:12:21] <Rainier> I think you're talking more than you're doing :P
[06:12:43] <White_Cat> hey! I am trying to learn java instead of downloading someone elses code :(
[06:12:49] <Rainier> I think if you built a tree it would be easier to track your path since you just need to walk back up to the root when done.
[06:12:57] <Rainier> White_Cat, and kudos!
[06:13:03] <White_Cat> yay
[06:13:10] <White_Cat> my first kudos here :p
[06:13:25] <Rainier> ~White_Cat++
[06:13:25] <javabot> white_cat has a karma level of 1, Rainier
[06:13:28] <Rainier> there.
[06:13:33] <White_Cat> yay
[06:13:52] <Rainier> White_Cat, I think for simplicity if you listened to freeone3000, it's not hard to build your own tree.
[06:14:03] <White_Cat> hmm
[06:14:22] *** GeorgeBrabazon has joined ##java
[06:14:41] <White_Cat> which spesific point :)
[06:15:00] *** KarlThePagan1 has joined ##java
[06:15:10] <Rainier> Just that it's a wrapper around a collection indicating children of a node that may have links to the parent and some kind of data value.
[06:15:29] <White_Cat> Or: public class TreeNode<K> { public List<TreeNode<K>> children; public K data; } ?
[06:15:45] *** nanomachine has joined ##java
[06:15:47] <Rainier> that's about as simple as it gets.
[06:16:07] <White_Cat> k
[06:16:13] *** RobotCow has quit IRC
[06:16:18] <White_Cat> do you have reccomended documentation for it
[06:16:24] *** nanomachine is now known as RobotCow
[06:16:25] <White_Cat> google is returning a lot of results
[06:16:32] *** RobotCow has quit IRC
[06:16:32] *** RobotCow has joined ##java
[06:16:48] <White_Cat> hmm
[06:17:01] <White_Cat> I think you are asking me to write treenode from scratch
[06:17:18] <freeone3000> Considering it's *that one line*, yes.
[06:17:35] <Rainier> TreeNode as included in the core Java is an interface, so you'd be writing an implementation to fulfill it anyway.
[06:17:49] <digs> Is there a way to save the state of a java app and exit? Then when you start the java app back up, the state is restored?
[06:17:55] <digs> preferences: A node in a hierarchical collection of preference data. This class allows applications to store and retrieve user and system preference and configuration data.
[06:18:30] <digs> that was recommended... but not exactly what I was looking for... I was looking for stateful recovery
[06:18:31] <XeruX> When trying to follow the guidelines of MVC + swing, would one usually just have _one_ controller class that would work with every view and extend the controller class to override the functions for each view?
[06:18:34] <freeone3000> digs: So your goal is to figure out what your application's "state" is, how much of it needs to be stored, and how it can be. Your main tools will be Preferences and serialization (binary and otherwise)
[06:18:49] <XeruX> or would one have different controller-classes with different methods depending on the view itself ?
[06:19:06] <White_Cat> freeone3000 sorry I was confused if its something in the sdk or not since it was so short :D
[06:19:23] <digs> freeone3000, okay. I will take you word for it and exhaust those two. Thank you.
[06:19:24] *** bojo has joined ##java
[06:19:49] <digs> freeone3000, btw... dam* you are quick.
[06:20:48] <digs> freeone3000, you are one of the few very good helpers on irc I have met in my many many yeas on irc.
[06:21:02] <digs> kudos.
[06:21:55] <White_Cat> freeone3000 "public List<TreeNode<K>> children; " list is highlighted as missing symbol I am probably missing an import right?
[06:22:16] <freeone3000> White_Cat: Sure, why not.
[06:22:17] <White_Cat> what should I import?
[06:22:30] <freeone3000> Since TreeNode is defined right there, and K is defined right there, signs point to "java.util.List".
[06:23:25] <White_Cat> ah nice
[06:23:26] <White_Cat> thanks
[06:23:55] *** t0rc has quit IRC
[06:24:19] *** ojacobson_ has quit IRC
[06:24:25] <White_Cat> what is the "K" in that code sniplet? an int?
[06:24:26] *** ojacobson_ has joined ##java
[06:24:29] <freeone3000> ~generics
[06:24:29] <javabot> For a tutorial on generics, please see http://javachannel.net/wiki/pmwiki.php/Main/Generics
[06:24:37] <freeone3000> It's an anything-but-primitive.
[06:24:40] <White_Cat> ah
[06:24:48] <White_Cat> I see it now
[06:24:51] <White_Cat> :)
[06:25:10] *** ojacobson_ has quit IRC
[06:26:06] *** ojacobson_ has joined ##java
[06:26:07] <White_Cat> data holds parent right?
[06:26:12] <White_Cat> trying to picture the structure
[06:27:38] *** huntercool has joined ##java
[06:28:12] *** ojacobson has quit IRC
[06:28:19] *** ojacobson_ is now known as ojacobson
[06:28:47] <freeone3000> Data holds the data.
[06:28:51] <Rainier> White_Cat, no, that's data specific to what that node represents.
[06:29:01] <Rainier> Parent is a different concept.
[06:29:24] <freeone3000> Tree structures are pretty cool mathematically, but useless computationally.
[06:30:10] <ztj> I am fascinated that you can somehow extricate the two concepts
[06:32:39] <White_Cat> I picture this like binary search trees exept with more branches
[06:33:51] <freeone3000> Yes. A binary search tree is an n-ary tree where n = 2.
[06:34:41] *** bearded_oneder has quit IRC
[06:35:26] *** mistik1 has quit IRC
[06:35:40] <White_Cat> I am trying to think of how to add items to this tree structure I am utterly confused
[06:35:43] <White_Cat> sorry :(
[06:36:28] *** ChanServ sets mode: +o ojacobson
[06:37:11] *** mistik1 has joined ##java
[06:37:19] <ztj> White_Cat: learn data structures d00d
[06:37:21] <ztj> ~~ White_Cat dads
[06:37:22] <javabot> White_Cat, what does that even *mean*?
[06:37:27] <ztj> wtf javabot
[06:37:32] <ztj> did someone go through randomly removing factoids?
[06:37:44] <Rainier> I think so. There's more than a few useful ones gone.
[06:38:10] <Rainier> White_Cat, we try not to spoon-feed here You seem like you need more work with Java fundamentals and the Collections API.
[06:38:22] <Rainier> There are plenty of places out there covering both.
[06:38:25] <Rainier> ~bibles
[06:38:25] <javabot> Get these: 1) Sun Java Tutorial (http://java.sun.com/docs/books/tutorial) 2) Bruce Eckel's "Thinking in Java" (http://www.mindview.net/Books/TIJ) (Get the 3rd edition, the 4th is only freely available up to chapter 7.)
[06:38:40] <White_Cat> I know data structures
[06:38:44] <White_Cat> I dont know java
[06:38:54] <White_Cat> a general tutorial doesnt help me
[06:39:04] <freeone3000> White_Cat: What language do you know?
[06:39:10] <White_Cat> C++
[06:39:12] <ztj> ~dads is a dictionary of algorithms, algorithmic techniques, data structures, archetypal problems, and related definitions available at http://xlinux.nist.gov/dads//
[06:39:12] <javabot> OK, ztj.
[06:39:13] <White_Cat> c#
[06:39:21] <Rainier> Sure it does. You aren't going to get anywhere in Java if you don't learn it.
[06:39:22] <ztj> ~~ White_Cat dads
[06:39:22] <javabot> White_Cat, dads is a dictionary of algorithms, algorithmic techniques, data structures, archetypal problems, and related definitions available at http://xlinux.nist.gov/dads//
[06:39:26] <freeone3000> White_Cat: Then List works exactly like Systems.Collections.Generic.IList.
[06:39:36] <White_Cat> stop spamming me random urls please
[06:39:38] <ztj> White_Cat: look at anything with "tree" in the name heh
[06:39:41] <freeone3000> White_Cat: And very similarly to std::vector.
[06:39:43] <ztj> none of it's random
[06:39:50] <White_Cat> Systems.Collections.Generic.IList, thanks
[06:39:55] <White_Cat> ah a vactor
[06:39:56] <White_Cat> I see
[06:40:00] <freeone3000> ~javadoc List
[06:40:01] <javabot> freeone3000: http://is.gd/knALm [JDK: java.awt.List]; http://is.gd/iBx8D [JDK: java.util.List]
[06:40:11] <Rainier> yes, but don't use Java's "Vector" class :P
[06:40:21] <ztj> ~vectorhashtable
[06:40:22] <javabot> ztj, what does that even *mean*?
[06:40:24] <ztj> ugh
[06:40:30] *** devkhadka has joined ##java
[06:40:31] <Rainier> ~vector
[06:40:32] <javabot> The only reason to use Vector is for compatibility with Java 1.1/1.0, or JavaME. Otherwise, use ArrayList. If you need an internally synchronized version (if you don't know what that means, you don't need it), use the collections in java.util.concurrent; the same applies to Hashtable and HashMap, Hashtable is old, HashMap is new, and Stack vs. ArrayDeque (NB: ArrayDeque is java 1.6+)
[06:40:38] *** Yusdan has joined ##java
[06:40:57] <freeone3000> White_Cat: Quick C#->Java conversion: When you see "java.util.", replace with "Systems.Collections.Generic". There's an eerie similarity, especially since .NET came out shortly after J# was discontinued...
[06:41:16] <White_Cat> I use an array list already I think
[06:41:35] <White_Cat> when I search for Systems.Collections.Generic.IList I get msdn urgh
[06:41:41] <White_Cat> msdn is a plague
[06:41:45] <White_Cat> :(
[06:41:48] <Rainier> freeone3000, yeah, but some of C# uses accessors Java doesn't. Java has the "getter setter methods" pattern, C# sometimes allows (or only does it via) bracket accessors.
[06:41:57] <ztj> freeone3000: uh this makes no sense ".NET came out shortly after J# was discontinued..."
[06:42:13] <freeone3000> Rainier: The latter's fancy bytecode for the former.
[06:42:14] <Rainier> and they behave differently than get/set does, if you read their docs for some of the collections. It's weird.
[06:42:32] <Rainier> freeone3000, was that for ztj?
[06:42:48] <freeone3000> Nah. It's just C# looks very different from a non-C# language.
[06:43:05] <XeruX> wooohoo, I think I finally found a good MVC-structure for my swing app :)
[06:43:09] * ztj wonders what cog fell loose in freeone3000's brainbox
[06:43:11] *** sakekasi has joined ##java
[06:43:33] <Rainier> freeone3000, well yes technically they should behave the same, but I think for for at least one collection the [] syntax could throw an exception but the appropriate method for the same would not.
[06:43:37] <Rainier> I forget which one that was.
[06:43:45] <sakekasi> what is the regular expression for an integer? I already tried googling for it
[06:43:56] <freeone3000> sakekasi: \\d+
[06:44:04] <Rainier> ~~sakekasi javadoc Pattern
[06:44:04] <javabot> sakekasi: http://is.gd/jNNxJ [JDK: java.util.regex.Pattern]
[06:44:14] <Rainier> documents all that Java's regex impl supports.
[06:44:21] <freeone3000> sakekasi: Or rather, that's the regular expression for "one or more digits, 0-9". An integer is also bounded. It's usually easier to just parse it and catch the failure.
[06:44:37] <sakekasi> freeone3000: will that work if I plug it into string.matches()?
[06:44:49] <freeone3000> Yes. I even double-escaped it for you.
[06:44:55] * Rainier .oO( mmm. extra sharp white cheddar. )
[06:45:09] <sakekasi> freeone3000: one last question, does it work with negative numbers?
[06:45:20] <freeone3000> sakekasi: Why don't you just parse it and catch the failure?
[06:45:21] <Rainier> freeone3000, they need to hurry up with our regex literals ;P
[06:45:38] <freeone3000> Regex literals are a bit too magic for java.
[06:45:44] <Rainier> hehe
[06:45:53] <sakekasi> freeone3000: regex seems like it will take less lines of code as I do not need a try catch statement
[06:46:12] *** marcosroriz has quit IRC
[06:46:16] <sakekasi> freeone3000: all I have to do is run it thru a string.matches()
[06:46:28] <GeorgeBrabazon> parsing it is going to be the way to go
[06:46:34] <Rainier> sakekasi, yes, but the understanding of the code you'll end up writing to an outside viewer (or you several weeks or months later) will be greater if you do the parse and catch.
[06:47:13] <GeorgeBrabazon> dont use regex unless you need to, and mostly only if you are dealing in string pattern matching and text manipulatoin
[06:47:14] <sakekasi> Rainier: ok the wisdom of this decision is finally getting to me
[06:47:19] <sakekasi> thanks!
[06:47:52] *** pranay_09 has joined ##java
[06:48:03] <sakekasi> Integer.parseInt throws a numberformatexception right?
[06:48:11] <freeone3000> Yes.
[06:48:21] <sakekasi> thanks
[06:48:25] <Rainier> Check the JavaDocs. They're your friend :)
[06:49:24] <pranay_09> hi, i am trying to get the current hour of the day as follows: System.out.println(Calendar.HOUR_OF_DAY); . I changed the system time to 17:00 but it still gives me 11(present) as output
[06:49:47] <pranay_09> i am using ubuntu
[06:50:34] <ztj> pranay_09: not in a virtual machine right?
[06:51:51] <pranay_09> ztj, no
[06:52:00] <Planck_> Calendar.HOUR_OF_DAY is a static int
[06:52:25] <Planck_> Its actual value is meaningless
[06:52:29] * ztj guffaws
[06:52:33] <ztj> I didn't even notice he was printing that
[06:52:53] * ztj sighs
[06:53:55] <Rainier> ~~ pranay_09 javadoc Calendar.get(*)
[06:53:56] <javabot> pranay_09: http://is.gd/81DJtu [JDK: java.util.Calendar.get(int)]
[06:54:20] <echosystm> any spring users around?
[06:54:30] <echosystm> i need a bit of help understanding something
[06:54:42] <Rainier> echosystm, I dunno know man, you lookin' to sell? Got a good deal?
[06:55:06] *** pranay_09 has quit IRC
[06:55:09] <White_Cat> Rainier mind if I pm you?
[06:55:15] <echosystm> i fundamentally do not understand how MVC works in spring
[06:55:25] <Rainier> White_Cat, yes, actually I do.
[06:55:44] <Rainier> Most likely what you are going to say/ask could be done here in the channel to the better benefit of you and all.
[06:56:01] <White_Cat> ok
[06:56:45] <echosystm> in a normal desktop application, you can nest views inside views, with each having their own controller and so on
[06:56:53] <echosystm> so you can re-use things
[06:56:54] <freeone3000> echosystm: Yes. See JTable.
[06:56:59] <White_Cat> so I am looking at public List<TreeNode<Coor>> children; it is a list of tree noes so the children do not have children?
[06:57:07] * Rainier realizes he is out of pepsi :(
[06:57:15] <freeone3000> White_Cat: Does a TreeNode<Coor> have children?
[06:57:17] <echosystm> it seems in spring that a controller must return full pages and must handle all input for that page
[06:57:23] <echosystm> so its impossible to nest views?
[06:57:30] <echosystm> you just have to keep repeating logic over and over?
[06:57:32] <White_Cat> Rainier I could email you some but I am freshly out of some myself
[06:57:54] <Rainier> White_Cat, it's okay :P I should stop drinking that addicting sludge anyway.
[06:58:07] <echosystm> what does jtable have to do with anything freeone3000 ?
[06:58:13] <echosystm> i'm talking about springmvc
[06:58:23] <Rainier> JTable is an example of a nestable MVC
[06:58:25] <freeone3000> Sorry, missed the question being spring-specific. Answered in general, "yes, you get nasty layered ick-panes".
[06:58:38] <White_Cat> freeone3000 atm I am not sure how to access elements of that treenode so I do not know
[06:58:44] <freeone3000> White_Cat: Well, both fields are public.
[06:59:01] <freeone3000> White_Cat: Java syntax is, to be loose, a subset of C# syntax.
[06:59:19] <freeone3000> (It's also a subset of C++ syntax, but there the semantics are different.)
[06:59:21] <White_Cat> yes but if this was a vector I could just use [x].[y]
[06:59:29] <freeone3000> White_Cat: So why can't you here?
[06:59:40] <Rainier> So translate those to Java's methods.
[06:59:51] <freeone3000> White_Cat: Becuase Java doesn't do operator overloading. .get(x).get(y). Or .get(x).y, possibly.
[06:59:54] <White_Cat> if I could do that why would I be here
[07:00:06] *** RobotCow has quit IRC
[07:00:06] * Rainier embeds some bytecode in his program and uses a custom classloader to prove freeone3000 "wrong" :P
[07:00:08] <White_Cat> how would java handle it
[07:00:13] <freeone3000> I don't know why you're here *now*, considering you haven't looked at the page for List.
[07:00:19] <White_Cat> I tried
[07:00:22] <White_Cat> I cant find it
[07:00:24] <Rainier> White_Cat, as he already explained it. The JavaDocs are your friend.
[07:00:31] <White_Cat> I get c# documentation from msdn and other sutff
[07:00:31] <Rainier> ~~ White_Cat javadoc List
[07:00:31] <javabot> White_Cat: http://is.gd/knALm [JDK: java.awt.List]; http://is.gd/iBx8D [JDK: java.util.List]
[07:00:39] <freeone3000> The concepts are the same across languages. The syntax is different. You need to learn the syntax.
[07:00:40] <White_Cat> I was listed like a dozen docs
[07:00:46] <freeone3000> And, possibly, the context.
[07:00:52] <freeone3000> *concepts.
[07:00:58] <White_Cat> thanks
[07:01:00] <Rainier> White_Cat, the link I just gave you is to the official current JavaDocs for Java.
[07:01:06] <White_Cat> yes yes
[07:01:12] *** RobotCow has joined ##java
[07:01:32] <Rainier> The'll tell you about all methods, classes, and their behaviors / purpose. So take a look at the List documentation and find a method with the behavior you seek.
[07:02:05] <White_Cat> I should care more about Interface List<E> I think
[07:02:40] * Rainier awaits Java7 with its generic JList impl :)
[07:02:47] <freeone3000> Yeah. The java.awt.* one is pretty useless.
[07:02:53] <Rainier> White_Cat, yes, the second link JavaBot gave you is the one you want to look at.
[07:03:01] <White_Cat> yup
[07:03:19] <White_Cat> OMFG java has actual documentation
[07:03:33] <freeone3000> No shit.
[07:03:34] <Rainier> uh, yeah ... nothing to shout about. but it is nice :)
[07:03:35] <White_Cat> why have I been using c++ all this time? -_-
[07:03:47] <ztj> Rainier: you haven't used enough other languages then
[07:03:56] <ztj> java has pretty much the best docs of any useful programming language
[07:03:56] <xelister> White_Cat: because you where intelligent, precise and wanted good performance and templates?
[07:04:10] <White_Cat> xelister probably :3
[07:04:11] <freeone3000> C++ has actual documentation as well; Apache happened to reimplement the entire standard library and documented as they went.
[07:04:25] <Rainier> ztj, there may be a reason for the "not enough of other languages" then ;) but I have used ones with little or poor. Java is very, very, nice to us.
[07:04:31] <White_Cat> c++ has good documentation if you look hard for it
[07:04:39] <White_Cat> msdn is often confusing
[07:04:45] <Rainier> Mostly written by a collection of various sources though.
[07:04:51] <White_Cat> yeah
[07:04:57] <xelister> msdn is for winheteros
[07:05:08] <xelister> ha now Im saying hetero like if its a bad thing
[07:05:10] <cbeust> Let's be fair, documentation is much more a function of the developers than of the language
[07:05:25] <Rainier> White_Cat, well, anyway, just bookmark the index of the JavaDoc site and you're golden.
[07:05:32] <ztj> xelister: most people seem to think it is
[07:05:43] <Rainier> I think if I type "java" into my URL bar in the browser it automatically brings up that as the first link :P
[07:05:44] <White_Cat> documentation is a pain in the ass to write probably... :/
[07:05:45] <ztj> xelister: any old differences really...
[07:05:54] <Rainier> White_Cat, not if you write it as you go along.
[07:06:04] <Rainier> If you come back and write it later, then you've kinda shot yourself.
[07:06:30] <ztj> it's just saying what things are supposed to do, it's kind of impossible to be sure things work right if you don't say what they are supposed to do, so docs are sort of essential
[07:06:36] <Rainier> Writing it as you go along also helps with the implementation. If the documentation/JavaDoc doesn't make sense, maybe you need to rethink what you're doing.
[07:06:47] <White_Cat> Rainier yeah but for me programming is like a dance. If I interrupt it it is no longer a dance
[07:06:53] *** epalm has quit IRC
[07:07:17] <Rainier> White_Cat, I think of it more as a train. Distractions are pennies.
[07:07:22] <xelister> would work better with sex metafore
[07:07:24] <cbeust> White_Cat: consider writing documentation as one of the steps of the dance
[07:07:48] <White_Cat> meh
[07:07:55] <White_Cat> I am a terrible dancer :(
[07:08:06] <cbeust> Although to be honest I don't really care if you write the documentation as you code or at the end, but by the time you send me that code review, there'd better be documentation.
[07:08:29] <Rainier> cbeust, I've gotten very good at writing it now. I've gone from what used to be little / zip, to quite a lot (but not the "every. single. line." too much)
[07:08:42] <Rainier> because I force myself to do it as I go.
[07:08:53] <Rainier> I don't want to end up coming back and wondering ... been there, it sucks.
[07:08:56] <White_Cat> why do I imagine you whiping yourself?
[07:09:20] <Rainier> White_Cat, hardly a whip. I think I really don't even have to apply any real force anymore. I just do it.
[07:09:50] *** bojo has quit IRC
[07:10:13] <Rainier> I'd like it to be such that if someone came in and took a peek they'd know why I did something and why I wrote it the way I did, and how it's all supposed to fit together.
[07:10:29] <Rainier> Not only reducing potential questions for me, but making it easier to work with.
[07:11:21] <White_Cat> hmm
[07:11:31] <White_Cat> wouldnt Class DefaultMutableTreeNode make my life easier?
[07:11:41] <White_Cat> I know it was mentioned to be more complicated
[07:11:50] <White_Cat> but considering how little java I know... :/
[07:11:54] <White_Cat> just asking
[07:11:58] <Rainier> White_Cat, is also helps to think about it too from the perspective that the person looking in and taking a peek could be you several weeks, months, etc. from now :)
[07:12:13] <Rainier> White_Cat, it's really a Swing class, aimed at using it with JTree for visulization.
[07:12:22] <Rainier> visualization*
[07:12:29] <White_Cat> I never worked on projects that large
[07:12:35] <White_Cat> would I have serious performance loss?
[07:12:53] <White_Cat> or would it be harder to code?
[07:12:56] <Rainier> well, probably not, but I mean if you're not going to have an interface, you probably don't need to use the Swing class. It's overkill.
[07:13:04] <Rainier> It's got methods/features out the wazoo.
[07:13:16] <White_Cat> wazoo?
[07:13:42] <Rainier> virtual something that something else would pour out of if the container was too small for it.
[07:13:58] <White_Cat> "getPathToRoot" is what I want to do.
[07:14:05] <Rainier> or, your asshole. take your pick.
[07:14:16] <White_Cat> mmm
[07:14:24] <White_Cat> I am a pussy not an asshole :p
[07:14:27] <Rainier> White_Cat, yes, but that's not hard to write yourself if you have a chain of references from a node to its parent.
[07:14:36] <Rainier> It's really just a loop.
[07:14:41] <Rainier> They just abstracted it for you.
[07:14:43] <White_Cat> Rainier right
[07:15:10] <Rainier> White_Cat, depending on how you build your tree, you could actually give children a reference to the root node of the parent they are added to.
[07:15:12] <White_Cat> I know the levels of my tree and I added an ID for each element
[07:15:34] <GeorgeBrabazon> WhiteCat, then why not just recurse up the tree
[07:15:51] <White_Cat> so my root is 1 and I can add 1-8 children to it (if only I knew how, still reading on that)
[07:16:02] <White_Cat> I am semi concerned on how to add children to the children
[07:16:13] <White_Cat> since I need to pay attention to how I am distributing them
[07:16:18] <Rainier> Read the documentation for the Collection class you use to store your children for how to add to it.
[07:16:34] <Rainier> Same way you would to the parent.
[07:17:29] <White_Cat> yeah I am reading
[07:17:45] <Rainier> If all nodes in the tree are an instance of the same class, say Node, then adding to a child element is no different than its parent.
[07:17:54] *** zamN has quit IRC
[07:19:22] <White_Cat> I suppose I am stupid or something cause I am not getting this :/
[07:19:39] <Rainier> Which bit?
[07:19:44] *** kieran491 has quit IRC
[07:19:55] <White_Cat> well for starters I really cannot picture this
[07:19:56] * Rainier .oO( byte, or word )
[07:19:56] <White_Cat> I mean
[07:20:23] <White_Cat> if its an array its a list of "items"
[07:20:35] <White_Cat> a list of ints if the item is type int
[07:20:50] <White_Cat> here I have a public List<TreeNode<Coor>> children; a list of treenodes
[07:21:03] <Rainier> okay. how is that different?
[07:21:09] <freeone3000> Because it's a non-scalar.
[07:21:27] <Rainier> freeone3000, :P
[07:21:45] <White_Cat> eh?
[07:22:06] <Rainier> he means that you're not storing a direct value, such as 3
[07:22:16] <White_Cat> I already feel stupid, I dont need help :)
[07:22:20] <White_Cat> http://en.literateprograms.org/images/Suffix-tree-rendered-output.png
[07:22:33] <White_Cat> ok would my structure look like that?
[07:22:48] <Rainier> It could.
[07:22:49] *** bojo has joined ##java
[07:23:04] <freeone3000> The given TreeNode is sufficient to implement *any* tree. What the tree does is up to you.
[07:23:07] <cbeust> Huffman tree?
[07:23:41] <White_Cat> ah
[07:23:47] *** digs has quit IRC
[07:24:26] <White_Cat> if I add() to the tree I'd create a child tree?
[07:24:47] <Rainier> you could look at it that way, yes.
[07:24:56] <White_Cat> ah
[07:25:02] * Rainier closes the box of crackers before he exceeds his daily ration of salt.
[07:25:09] <White_Cat> its becoming a lot clearer now...
[07:25:10] <Rainier> Or you could just consider it a child of the current tree.
[07:25:43] <mischief> anyone here familiar with luaj?
[07:25:57] <White_Cat> how would I navigate to a second level tree for example?
[07:26:05] *** bindaas has quit IRC
[07:26:26] <White_Cat> .sublist ?
[07:26:28] <freeone3000> White_Cat: There's no one second-level tree. There are n second-level trees, one per child, since each child is a tree.
[07:26:31] *** bindaas has joined ##java
[07:26:54] <Rainier> White_Cat, sublist would give you a range of children. Or a range of second-level trees.
[07:27:02] <Rainier> If you want a single one, just get a single child.
[07:27:33] <White_Cat> yes but I'd need to check each child to know which one I need to choose
[07:27:44] <White_Cat> to add to child of child
[07:28:09] <freeone3000> White_Cat: You know how to iterate your own linked list?
[07:28:11] *** pranay_09 has joined ##java
[07:28:28] <White_Cat> probably not.
[07:28:31] <freeone3000> White_Cat: It works the same, only instead of one "next", you have n possible "next"s, and you need to choose which one to go to.
[07:28:58] <pranay_09> sorry if i missed out on anything, net problems
[07:29:18] <freeone3000> White_Cat: What confuses me is that you keep stating, in precise terms, the solution to your problem. I'm not understanding why you don't just do what you just said.
[07:29:27] <Rainier> pranay_09, we only talked about you while you were gone :P
[07:30:06] *** banpdtr_ has joined ##java
[07:30:24] <White_Cat> I really dont know how to code it I suppose. I understand the structure, yes
[07:30:45] <pranay_09> Rainier: actually i had asked a query, so if someone replied it i might have missed it
[07:30:59] <freeone3000> White_Cat: Draw it out.
[07:31:04] <Rainier> pranay_09, did you catch my link to the Calendar.get(*) method?
[07:31:11] <banpdtr_> How can I control the data transmission in socket programming... could anyone give me suggestions..
[07:31:23] <pranay_09> Rainier: no
[07:31:25] <Rainier> ~~ pranay_09 javadoc Calendar.get(*)
[07:31:25] <javabot> pranay_09: http://is.gd/81DJtu [JDK: java.util.Calendar.get(int)]
[07:31:33] <Rainier> There ya go!
[07:31:45] <Rainier> The problem is that Calendar.HOUR_OF_DAY means nothing by itself.
[07:31:50] <freeone3000> banpdtr_: What do you mean, "control"? First, determine whether you have a stream or a datagram.
[07:32:04] <Rainier> pranay_09, It's an indicator of a "field" in a current Calendar instance.
[07:32:07] <banpdtr_> stream...
[07:32:31] <White_Cat> freeone3000 draw what?
[07:32:35] <Rainier> pranay_09, if you don't already have an instance, Calendar has a static method to get one. Or you can instantiate a subclass.
[07:33:02] <freeone3000> White_Cat: Draw your data structure on paper. Label it as necessary. "This is a treenode. This is a list of pointers to children". It should look approximately like a tree.
[07:33:16] <freeone3000> banpdtr_: Then you have very little control. You write data at your end, it gets read in the same order at the other end.
[07:33:19] <banpdtr_> freeone3000: stream . Actually I want to transfer one file and its metadata using sockets
[07:33:25] <pranay_09> Rainier: ok
[07:33:26] *** supercosmonaut has quit IRC
[07:33:39] <White_Cat> freeone3000 why? I already shown a picture of exactly what I need
[07:33:44] <Rainier> freeone3000, thank goodness for TCP :P
[07:33:47] <freeone3000> White_Cat: Because you need to draw it so you can understand it.
[07:33:54] <pranay_09> Rainier: thanks :)
[07:34:03] <Rainier> pranay_09, yup, no problem.
[07:34:05] <White_Cat> I understand the structure, problem is with the java
[07:34:23] <freeone3000> White_Cat: Okay. Do it in C++, then, and have all your problems vanish.
[07:34:24] <Rainier> but, writing a TCP-like impl on top of UDP for the academic benefit was kinda fun.
[07:34:37] <White_Cat> I cant do it in c++
[07:34:46] <White_Cat> why do you think I am torturing myself with java?
[07:34:57] <freeone3000> White_Cat: Why not? You can't *submit* it in C++, but if you think the problem's with Java, doing it in C++ should be simple.
[07:35:06] <Rainier> Java is torture? ^.- that's a terrible mindset ...
[07:35:13] <White_Cat> I cannot use c++ with battlecodes
[07:35:17] <freeone3000> White_Cat: Then you can come up with a short list of "how do I do this?" and "how do I do that?", so I don't have to explain an entire semester of datastructures to you.
[07:35:32] <Rainier> haha
[07:35:33] <White_Cat> I know data structures
[07:35:35] <freeone3000> White_Cat: Yeah. Don't care. Do it in a langauge you know first, and then translate.
[07:35:36] <White_Cat> thats NOT the problem
[07:35:38] <ztj> HA HAHAH
[07:35:41] <ztj> White_Cat: you do not
[07:35:47] *** Zta has quit IRC
[07:35:50] <White_Cat> fine mock me
[07:35:57] <White_Cat> I hope it ammmuses you
[07:36:00] <ztj> you don't have to know something but you do have to admit it
[07:36:26] <Rainier> White_Cat, tbh, we've been trying to help you short of holding your hand to help you cross the street.
[07:36:33] <Rainier> However, it seems the latter is what you really want.
[07:36:48] <White_Cat> what?
[07:37:01] <Rainier> You seem to have a problem with Java fundamentals honestly.
[07:37:04] <White_Cat> all I need to know is how to access values in TreeNode
[07:37:18] <White_Cat> of course I have problems with java fndementals
[07:37:33] <freeone3000> White_Cat: Okay. Let's solve this in C++, then.
[07:37:39] <White_Cat> ok...
[07:37:46] <White_Cat> if this was in c++
[07:37:50] <Rainier> and we gave you links to resources to solve that, but you said generic tutorials wouldn't help you. so I think you missed the point.
[07:37:54] <freeone3000> White_Cat: You have a template<typename T> class tree_node { public: std::vector<tree_node<T>> children; T data; };
[07:38:03] <Rainier> *shrug* I want to keep helping, but you're draining the fun out of it.
[07:38:03] <White_Cat> I'd probably use a factor of vectors
[07:38:20] <Rainier> ~ freeone3000++
[07:38:20] <javabot> freeone3000 has a karma level of 73, Rainier
[07:38:21] <White_Cat> vector<vector <Coor>>
[07:38:33] <freeone3000> White_Cat: Nope. That's not a tree. See above.
[07:38:35] <echosystm> when writing unit tests for a function that goes and does some shit on a database, do you guys prefer to use mocks or just check the database has the right data?
[07:38:44] <freeone3000> White_Cat: Well, it could be a tree, but it's not a nice tree.
[07:38:57] <White_Cat> ok...
[07:39:20] <White_Cat> so what is T supposed to hold, a pointer?
[07:39:30] <freeone3000> White_Cat: It's a template! It can be anything.
[07:39:40] <White_Cat> yes I realise it can be a template
[07:39:41] <Rainier> echosystm, I think it depends. If you're testing that the method works correctly then you probably want mocks and mocked data.
[07:39:44] <White_Cat> *it is a template
[07:39:54] <Rainier> If you're testing the effect it has on the database, you can't really mock that.
[07:40:03] <echosystm> right
[07:40:07] <White_Cat> gah
[07:40:18] <echosystm> so, integration testing is really more important than unit testing on webapps ?
[07:40:34] <White_Cat> I currently have public List<TreeNode<Coor>> children; public Coor Data;
[07:40:41] <White_Cat> why do I even need data?
[07:40:51] <freeone3000> White_Cat: Because a tree's structure means very little.
[07:40:54] <echosystm> oops, hometime
[07:41:00] *** echosystm has quit IRC
[07:41:01] *** daark has quit IRC
[07:41:14] <White_Cat> so List<TreeNode<Coor>> itself doesnt hold any data then
[07:41:17] <White_Cat> ok
[07:41:29] <freeone3000> It holds all children of the current node.
[07:41:37] *** neuro_sys has quit IRC
[07:41:44] <White_Cat> yes but its holding pointer values to them then
[07:41:55] *** neuro_sys has joined ##java
[07:41:56] <freeone3000> Right. (I'd still say that's data, but you've got the picture.)
[07:42:16] <White_Cat> indeed its memory adresses and thats data but its not the data I care about :)
[07:42:33] <freeone3000> It'll come in handy when you do a traversal.
[07:42:43] <White_Cat> right
[07:43:05] *** BoF has quit IRC
[07:46:30] *** paissad has quit IRC
[07:49:32] *** paissad has joined ##java
[07:51:35] <White_Cat> I'd access child trees with get()
[07:51:37] <White_Cat> simple
[07:51:57] <White_Cat> there probably is some sort of size() parameter to help me navigate between each child
[07:52:12] *** frangiz has joined ##java
[07:52:29] <freeone3000> Probably?
[07:52:31] <freeone3000> ~javadoc List
[07:52:31] <javabot> freeone3000: http://is.gd/knALm [JDK: java.awt.List]; http://is.gd/iBx8D [JDK: java.util.List]
[07:52:44] <freeone3000> ~javadoc java.util.List
[07:52:45] <javabot> freeone3000: http://is.gd/iBx8D [JDK: java.util.List]
[07:52:52] *** rretzbach has joined ##java
[07:53:13] <White_Cat> yes yes its somewhere in the documentation I probably read it, I just cannot remember every line of the documentation on the top of my head yet
[07:53:18] * freeone3000 proposes removing all non-layout java.awt.* classes from javabot - people should use their Swing counterparts anyway.
[07:53:42] <Rainier> freeone3000, Color
[07:53:45] *** rgr has joined ##java
[07:54:22] <GeorgeBrabazon> White_Cat: what ide are you using? most of them have an suggestion feature of some sort (when you type objectInstance. something should pop up)
[07:54:22] <White_Cat> ok so how would I check the parent if I am at a child level?
[07:54:33] <GeorgeBrabazon> i know in eclipse it will even show you the java docs for each method
[07:54:40] <White_Cat> I am using netbeans so yes its a relatively medium sized list
[07:54:43] <freeone3000> White_Cat: You wouldn't, because your TreeNode doesn't have a parent. If you need one, define one.
[07:54:56] <White_Cat> mm
[07:55:22] <White_Cat> how would I do a traversal without that info?
[07:55:42] <freeone3000> http://en.wikipedia.org/wiki/Tree_traversal
[07:56:15] <freeone3000> Note that "push" and "pop" in the article refer to an anonymous auxillary stack. (Which very well could be a java.util.Stack.)
[07:56:42] <White_Cat> oh
[07:57:17] <White_Cat> re read the entire thing...
[07:57:22] <White_Cat> so I have a queue
[07:57:27] <White_Cat> and a tree to record it
[07:57:30] <White_Cat> and a stack to read it
[07:57:45] <freeone3000> Why do you have a tree recording a queue? That seems like you're introducing undue complexity.
[07:57:54] <White_Cat> I do not know
[07:57:59] <freeone3000> (And in most traversals, the stack is implicit on the call-stack)
[07:58:02] <White_Cat> I am trying to figure this out
[07:58:09] <freeone3000> What are you trying to do?
[07:58:15] *** sakekasi has quit IRC
[07:58:31] <White_Cat> Breadth First Search
[07:58:39] <White_Cat> I already implimented that with queue
[07:58:51] <freeone3000> So what's the tree for?
[07:58:57] <White_Cat> to record my path
[07:59:05] <freeone3000> Why is that a tree?
[07:59:10] <White_Cat> umm
[07:59:25] <White_Cat> I dont have any preference as to what to use to record my path
[07:59:35] <freeone3000> You already have a queue. Why not use that?
[07:59:51] *** glcrazy has joined ##java
[07:59:51] <White_Cat> well, when I poll my queue I loose information
[07:59:57] <White_Cat> right?
[08:00:04] <freeone3000> When you pop from a queue, you do, not when you poll.
[08:00:28] <White_Cat> hmm
[08:01:59] * freeone3000 believes the magic words might be "minimally spanning tree via breadth-first search", but that may be the discrete talking.
[08:02:00] *** GeorgeBrabazon has quit IRC
[08:02:14] <White_Cat> ok let me pm you my code
[08:02:54] <_W_> why not pastebin it?
[08:02:57] *** terranova has joined ##java
[08:03:06] <_W_> ~show us
[08:03:07] <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.
[08:03:15] <White_Cat> I pmed the url
[08:03:20] <_W_> ~pastebin
[08:03:20] <javabot> http://mysticpaste.com - Paste the final url after you've pasted your stuff there.
[08:03:26] <freeone3000> ~~ White_Cat conventions
[08:03:26] <javabot> White_Cat, conventions is http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html , or "ThisIsAClassName, thisIsAVariableOrMethodName, THIS_IS_A_CONSTANT_NAME". See also http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
[08:03:43] <White_Cat> sigh
[08:03:44] <freeone3000> Capital letters at the beginning of symbols mean data types.
[08:04:02] <White_Cat> yes yes I am trying to learn the convention as well
[08:04:22] <freeone3000> "ThisIsAClassName, thisIsAVariableOrMethodName, THIS_IS_A_CONSTANT_NAME". Pretty simple.
[08:04:39] <White_Cat> for //Do stuff to create a stack to return as the shortest path would I get the shortest path at my queue?
[08:04:49] <White_Cat> yes freeone3000 its simple
[08:05:05] <White_Cat> can we please focus on the task, I promise I will make it nice later :p
[08:05:43] *** happyuser163 has quit IRC
[08:05:48] <White_Cat> I probably want pop over poll right?
[08:06:23] <freeone3000> Okay, so you've added a queue of nodes to traverse to get to *an* end. Your algorithm finds one path.
[08:06:35] *** phantomcircuit has quit IRC
[08:06:41] <freeone3000> Hate to break it to you, but it's depth-first, and worse, it's depth-first without backtracking.
[08:07:06] <freeone3000> You do want pop() over poll.
[08:07:13] <White_Cat> yes
[08:07:18] <White_Cat> I have no backtrack
[08:07:24] <White_Cat> thats why I was trying to record it somehow
[08:07:42] *** Kamaran has joined ##java
[08:08:10] <freeone3000> A stack is normally used for backtracking. Push items when you visit, pop items when you leave.
[08:08:24] <White_Cat> pop() isnt working for queue
[08:08:33] <freeone3000> ~javadoc Queue
[08:08:33] <javabot> freeone3000: http://is.gd/j7uY [JEE: javax.jms.Queue]; http://is.gd/ADw2UB [JDK: java.util.Queue]
[08:08:50] <freeone3000> Queue.remove(), then.
[08:09:10] <freeone3000> And I'm going to go do something more productive, so have fun with this. Wikipedia's your friend.
[08:09:19] <White_Cat> before you go
[08:09:39] <White_Cat> isnt it .peek versus .poll ?
[08:10:23] *** new2net has joined ##java
[08:11:09] *** pranay_09 has quit IRC
[08:12:02] *** coalado has joined ##java
[08:12:37] *** matsebc has quit IRC
[08:12:52] *** caverdude has quit IRC
[08:13:59] *** Jacmob has joined ##java
[08:14:17] *** rgr has quit IRC
[08:15:43] *** frangiz has quit IRC
[08:15:45] *** ramenmeal has joined ##java
[08:17:10] *** frangiz has joined ##java
[08:17:29] *** flip28 has joined ##java
[08:18:46] *** magn3ts has joined ##java
[08:19:53] *** mxweas has joined ##java
[08:20:34] *** zhulikas has joined ##java
[08:21:58] *** fuzzygroove has joined ##java
[08:24:30] *** rgr has joined ##java
[08:24:54] <new2net> java won't support Integer for int anymore?
[08:26:06] <Rainier> ...
[08:26:15] *** topriddy has joined ##java
[08:26:36] <new2net> the JDK i mean...
[08:26:44] <Rainier> you still don't make sense.
[08:26:59] <Sou|cutter> what does 'support' mean?
[08:27:06] *** akear has joined ##java
[08:27:32] *** akear has left ##java
[08:27:39] *** rretzbach has quit IRC
[08:28:03] *** Junior has joined ##java
[08:30:45] *** DJClean has joined ##java
[08:31:02] <new2net> when did java introduce generics?
[08:31:07] <Planck_> 1.5
[08:31:26] <new2net> how long ago was that (i recall the versioning is confusing).
[08:32:03] <Planck_> 2004
[08:33:20] *** LouisJB has quit IRC
[08:33:38] <Planck_> (And yes, 1.5 was released as "Java 5")
[08:33:59] *** wolfman2000 has quit IRC
[08:34:09] <new2net> oh. hmm, you used to use java to program appliances?
[08:34:27] <Planck_> Not just "used to"
[08:34:49] <White_Cat> gah
[08:34:51] *** Kamaran has quit IRC
[08:34:52] <White_Cat> head hurts
[08:35:01] <White_Cat> I probably need a break
[08:35:21] <cbeust> I was using Java in appliances in1998
[08:35:30] <White_Cat> Rainier I know I have been abusing the chat but...
[08:35:30] <new2net> what did you make?
[08:35:31] <cbeust> Obviously, it was a bit too soon for that :)
[08:35:57] <White_Cat> what would you reccomend I do to record my paths
[08:36:11] <White_Cat> evidently a tree is way overkill
[08:37:38] *** FrozenKnight has joined ##java
[08:38:03] *** sileni has joined ##java
[08:38:18] <sileni> hey guys if i have question about hypercubes what channel should i go to ?
[08:38:46] <Planck_> Are you modelling hypercubes in Java?
[08:38:56] <sileni> sure
[08:39:09] <Rainier> sileni, #hypercubes if you join ##freenode from the 4th dimension.
[08:39:19] <Rainier> Otherwise, the channel is not guaranteed to exist.
[08:39:34] <sileni> eh
[08:39:47] <new2net> if I don't use generics, do I ever need to use @override; annotation?
[08:39:48] <sileni> nobody is there in hypercubes channel
[08:39:54] <Planck_> Of course it exists, it's just that most of the partipants are not in our 3-space.
[08:39:58] <cbeust> @Override has nothing to do with generics.
[08:40:07] <Rainier> sileni, you didn't join freenode from the 4th dimension.
[08:40:29] <Planck_> General mathematical properties might be suitable for #math
[08:40:53] <sileni> actually this is like a java question http://pastebin.com/T7qYcR8Y
[08:41:01] <sileni> its just two for loops
[08:41:23] <sileni> lets say my input is 01001 for A and 00011 for B
[08:41:43] <sileni> actually
[08:41:49] <sileni> what does invert bits stepwise mean?
[08:42:02] <White_Cat> http://www.roseindia.net/java/beginners/stack-demo.shtml
[08:42:30] <cbeust> sileni: no idea, the text you pasted doesn't make much sense to me either. Is it translated from another language tan English?
[08:42:30] <White_Cat> I am looking at that
[08:42:32] <sileni> White_Cat, is that for me ?
[08:42:37] <White_Cat> oh no
[08:42:41] <White_Cat> i suck at java
[08:42:45] *** fuzzygroove has quit IRC
[08:42:55] <sileni> cbeust, yes its english one second
[08:43:07] <White_Cat> how can I get a stack to have a type?
[08:43:15] *** Ch30ps has joined ##java
[08:43:19] <sileni> cbeust,http://dl.dropbox.com/u/14349012/364204817X%20Parallel%20Programming%20for%20Multicore%20and%20Cluster%20Systems.pdf
[08:43:23] <sileni> thats the pdf version
[08:43:30] <sileni> cbeust, are you able to see it ?
[08:44:01] *** mhahe has quit IRC
[08:44:06] <cbeust> Yes, it's the whole book(!)
[08:44:19] <Planck_> I was about to say, WTF on the size of the file
[08:44:29] <sileni> cbeust, good can you go to page 35
[08:44:37] <sileni> in the book or page 46 in the pdf
[08:44:45] *** carutsu has quit IRC
[08:44:58] *** _Jorde has joined ##java
[08:45:07] <sileni> im look at the paragraph that starts " the connectivity of a hypercube
[08:45:22] <sileni> are you guys able to see it ?
[08:45:27] <new2net> White_Cat, have you tried generics?
[08:46:11] <cbeust> Yes I see it, still not sure what "inverting stepwise" mean in this context and I don't feel like reading the whole thing.
[08:46:21] <cbeust> I do know what a Hamming distance is, but I'm not sure that's what you need right now.
[08:46:53] <sileni> cbeust, ye i know what hamming distance is too but im stuck on the very last part
[08:46:56] <Planck_> Ahh, it's pretty straightforward. It's just that 90% of the context was missing from that pastebin excerpt
[08:47:06] <sileni> Planck_, you got it ?
[08:47:12] *** frangiz has quit IRC
[08:47:18] *** Jacmob has quit IRC
[08:47:23] *** frangiz has joined ##java
[08:47:30] <sileni> Planck_, you are my savior!
[08:48:13] <Planck_> But yeah, not so Java-ish. I'll PM if you like :)
[08:48:14] <sileni> Planck_, ok you see fig.2.13 especially the "Additionally ,there are k-l ..."
[08:48:28] <sileni> Planck_, ok that would be great
[08:48:29] <White_Cat> new2net I merely need a stack of my custom class
[08:48:35] <White_Cat> not generics
[08:49:09] *** LyQuid has joined ##java
[08:50:25] *** rgr has quit IRC
[08:51:24] *** purestrain has joined ##java
[08:52:57] <White_Cat> ah Stack <Coor> PathFindStack = new Stack <Coor>();
[08:53:03] <White_Cat> that was stupid of me :(
[08:53:11] <new2net> import java.util.Stack;
[08:54:28] *** sileni has quit IRC
[08:54:44] *** sileni has joined ##java
[08:55:25] *** ngochai has joined ##java
[08:56:30] *** platzhirsch has joined ##java
[08:56:35] <White_Cat> ya
[08:56:39] <White_Cat> I feel dumb :(
[08:57:36] <new2net> nah, you taught me how to use generics. That better be all there is to it.
[08:57:49] *** dframe has joined ##java
[08:58:12] *** Tiktalik has quit IRC
[08:58:21] <White_Cat> I taught you?
[08:58:26] <White_Cat> I suck at java tho :(
[08:59:21] *** xianny has quit IRC
[09:01:17] <new2net> so do I, but sometimes i know things other newbs dont.
[09:01:48] *** McMAGIC-- has quit IRC
[09:02:42] <White_Cat> :D
[09:06:58] *** White_Cat has quit IRC
[09:11:48] *** cbeust has quit IRC
[09:14:35] *** titankiller has quit IRC
[09:15:32] *** tewecske has joined ##java
[09:16:14] <new2net> can I make my own database language in java?
[09:16:55] *** hyppias has joined ##java
[09:16:58] <topriddy> new2net: derby is written in java
[09:17:10] <new2net> is it open source?
[09:17:27] <new2net> ~derby
[09:17:27] <javabot> new2net, derby is Apache Derby, an Apache DB subproject, is a relational database implemented entirely in Java and available under the Apache License, Version 2.0. Small, embeddable, client/server. http://db.apache.org/derby
[09:18:10] *** ExtraSpice has joined ##java
[09:18:39] *** ExtraSpice has quit IRC
[09:19:51] *** dinesh___ has joined ##java
[09:20:44] *** ramenmeal has quit IRC
[09:23:03] *** mah01 has joined ##java
[09:23:37] *** ExtraSpice has joined ##java
[09:25:59] *** eitch0000 has joined ##java
[09:35:50] *** bizarrefish has joined ##java
[09:37:14] <bizarrefish> hi, all. I've got this issue with RMI. On the client side, after sending a reference to an object made remote from the server, i get $Proxy1 cannot be cast to java.rmi.server.RemoteStub :\
[09:37:34] *** RobotCow has quit IRC
[09:39:44] <Planck_> I have to admit I've avoided java RMI. I'm sure one day I'm going to end up reimplementing something like it only worse :)
[09:41:23] <bizarrefish> From what i've seen, you can't get much worse
[09:41:37] <Planck_> (and a buggy implementation of half of Lisp)
[09:41:46] *** idledroid has joined ##java
[09:41:48] <bizarrefish> it's the epitome of everything bad about the java language
[09:41:53] *** balooo has joined ##java
[09:42:15] *** [[thufir]] has joined ##java
[09:42:55] <Planck_> I can see how it could arise, and what it's trying to do ... I'm just sure there has to be a better way to do it :)
[09:42:59] <idledroid> /close
[09:43:11] *** idledroid has left ##java
[09:48:57] *** frangiz has quit IRC
[09:49:04] *** frangiz has joined ##java
[09:49:10] <Elvanor> Is there a locking mechanism that is *not* counting?
[09:49:25] *** chandan_kumar has joined ##java
[09:49:26] <Elvanor> Eg, similar to ReentrantLock but where there is no counting
[09:50:13] *** mazzachre has joined ##java
[09:50:36] *** foocraft has joined ##java
[09:51:37] <foocraft> hi all, is there any way I can let let JUnit order which tests to run first, based on which test depends on which other test?
[09:52:18] <selckin> tests should not depend on each other.
[09:52:28] <foocraft> something like @Depends test1 test2
[09:52:51] *** XeruX has quit IRC
[09:53:06] *** echosystm has joined ##java
[09:53:15] <foocraft> selckin, true, but suppose there are composite tests that I want to tell JUnit to run if and only if, for instance, the individual components have passed their own tests
[09:53:47] *** Benkinooby has joined ##java
[09:53:48] <jink> selckin: If adding doesn't work, there's no point in testing multiplication (since it's implemented as repeated adding)?
[09:54:14] <foocraft> jink, and that's another instance of what I was getting at.
[09:54:21] <Benkinooby> hi, when do i use try/catch and when do I use "throws"?
[09:54:25] <jink> On the overall, tests should not depend on each other, sure. :)
[09:54:33] <jink> ~exceptions
[09:54:33] <javabot> jink, exceptions is http://java.sun.com/docs/books/tutorial/essential/exceptions/ (also see http://billharlan.com/pub/papers/Catching_Exceptions_in_Java.html )
[09:54:36] <jink> Benkinooby: ^^
[09:55:38] <Benkinooby> jink, i allready know the first link. thx for second one
[09:56:19] <foocraft> maybe it should be a feature for a future release
[09:56:40] <new2net> is null going to satisfy every <generic>?
[09:56:57] <jink> foocraft: Why? Because you want your tests to fail sooner? There really is no point in having tests depend on each other.
[09:57:28] <jink> new2net: More context would be nice. What are you asking and why?
[09:57:36] <Elvanor> Is there a Mutex class in the std JDK ?
[09:57:37] <new2net> uh
[09:57:57] <foocraft> jink, well...it's just basically for when a test suite grows in complexity and you want to speed your test-code-test cycles
[09:58:21] <Benkinooby> jink, throws->hands th exception object away to something that might know what to do. try/catch -> work on the exception and don
[09:58:24] <new2net> Collection<? extends Pair<String, ?>> c = new ArrayList<Pair<String,?>>();
[09:58:27] <Benkinooby> dont pass it on
[09:58:31] <jink> foocraft: Don't test everything? :) Break up the tests in smaller suites? They're unit tests, not project tests.
[09:58:34] <foocraft> assuming A and B work, I will test C, which depends on A and B working correctly
[09:59:25] <jink> Don't assume. Test.
[10:00:14] <selckin> you don't C want to erase your harddrive if a or b doesn't work correctly
[10:00:17] <new2net> foocraft. A test suite can have instance variables... just make one this,ATest = false / true / null" ... if A works make it true..
[10:00:27] <foocraft> so I'd want JUnit to run the tests for A and B first, before even deciding to run the tests for C, for that very reason :)
[10:00:47] <jink> If A and B test ok, but C fails because of a bug in A and/or B, your tests are poor. If C fails because of C, then you need to fix C.
[10:01:17] <foocraft> new2net, cool hack around it.
[10:01:19] <selckin> anyway testng can do this
[10:01:23] <selckin> junit can't
[10:01:25] <jink> foocraft: So, don't do C until you're confident about A and B?
[10:01:30] <selckin> but you can group them together in a suite
[10:01:43] <foocraft> jink, yeah. I'm sure that case happens sometimes
[10:02:11] <Elvanor> Is there any good library providing a Mutex implementation for Java?
[10:02:14] <jink> Of course it does. :)
[10:02:55] * foocraft celebrates new2net's newborn dependency-checking super simple junit hack
[10:03:06] *** afkos has joined ##java
[10:03:09] <_W_> yeah tests should not be dependent on each other - use mock-ups of the dependencies
[10:04:13] *** msieradzki has joined ##java
[10:04:44] *** mastroDani has joined ##java
[10:10:41] <Rainier> Elvanor, have you checked out the core concurrency package?
[10:11:18] <Elvanor> Rainier: it has Lock and Semaphore, but no Mutex :(
[10:12:07] *** Fuco has joined ##java
[10:12:14] <Rainier> uh, and between all that's in the concurrency package and Java's synchronized block, you can't make code that behaves like the "Mutex" you want? I find that very hard to believe.
[10:12:39] *** LyQuid has quit IRC
[10:13:39] <Elvanor> Rainier: it's the case, unfortunately
[10:13:47] <Elvanor> syncrhonized keyword does not help here
[10:14:22] <Elvanor> and what I want is a simple Mutex. I dont like Lock because there is an intrinsic count mechanism
[10:14:25] *** BSWolf has quit IRC
[10:14:29] <Rainier> I'm not convinced, and honestly, you've told neither me nor anyone else in the channel what you're doing that makes *none* of the stuff currently available in Java useful t you.
[10:14:40] *** durre has joined ##java
[10:14:46] *** White_Cat has joined ##java
[10:15:21] <Elvanor> Rainier: so what I am trying to do is
[10:15:27] <Elvanor> in a JEE container
[10:15:42] <Elvanor> suppose there are 10 requests from a single session going at once
[10:15:46] <Elvanor> I want to queue them
[10:15:59] <Elvanor> so that the second one executes the action only when the first has exited
[10:16:21] <Elvanor> So I defined a Filter that would lock the mutex before the servlet action
[10:16:27] <Elvanor> and unlock at the end
[10:17:14] <_W_> ouch
[10:17:20] <Rainier> That sounds terrible.
[10:17:30] *** mazzen has joined ##java
[10:17:39] <durre> good morning everyone! we're investigating if we can move from hibernate to mybatis. the plan was to keep the writing with hibernate and rewrite some of the reading with mybatis. this will probably work. the problem comes when we try to write integration tests. hibernate writes the data, mybatis tries to read the data... but mybatis doesnt find anything. it doesnt use the same session/connection.
[10:17:41] <Elvanor> Rainier: Why?
[10:17:52] <_W_> and likely impossible, in a J2EE environment, given class loaders and such
[10:17:55] <durre> anyone run into this problem?
[10:17:55] <Rainier> Especially since doing a synchronized block on a "lock object" that encompasses the entire method would work better and be the preferred Java way of doing that.
[10:18:09] <Elvanor> Rainier: I cannot do that
[10:18:19] <Rainier> Elvanor, no? I fail to see why not.
[10:18:27] <_W_> durre, just make sure that the hibernate session is committed/flushed
[10:18:30] <Rainier> You've given no proper explanation as to why that simply will not work.
[10:18:33] <Elvanor> Which code block would you write synchronized on ?
[10:18:52] <Elvanor> The servlet action?
[10:19:05] <Rainier> That is what you wish to serialize requests to, is it not?
[10:19:06] <durre> _W_: hmm, we tried flushing
[10:19:07] <_W_> Rainier, it won't work because you don't know which instance each request gets
[10:19:13] <Elvanor> The problem is that this block can be ran concurrently; I just dont want it to be run concurrently from the same session (HTTP session)
[10:19:22] *** frangiz has quit IRC
[10:19:52] <Rainier> Wouldn't be easier to just configure the J2EE instance to not use more than one thread?
[10:19:54] <_W_> Elvanor, the solution probably lies in the nature of the problem - why exactly do you want to do this? what need does it solve?
[10:20:03] <durre> _W_: if I commit the data, will the test be able to roll back?
[10:20:06] <Rainier> and yes, that would certainly help us.
[10:20:09] <Elvanor> _W_: Hibernate concurrency problems
[10:20:09] <_W_> durre, no
[10:20:22] <Elvanor> eg, an object can be updated concurrently
[10:20:27] <_W_> durre, if you intend to roll back, only _that_ connection can see the changes
[10:20:39] <durre> _W_: thats our problem :)
[10:20:45] <Elvanor> Simple example: ten threads going on at the same time to update the same customer object
[10:20:49] <_W_> Elvanor, what exactly is the problem?
[10:21:06] <_W_> have you run this and seen that transactions lock up or something?
[10:21:10] <Elvanor> _W_: ? I just told you
[10:21:14] <Elvanor> _W_: yes
[10:21:22] <Elvanor> Hibernate throws stale object exceptions, etc
[10:21:26] <_W_> no, you described a scenario, you didn't explain what the outcome was
[10:21:30] <Elvanor> because of optimistic locking in hibernate
[10:21:48] <_W_> seems like this should be solved in hibernate's configuration
[10:21:54] <Elvanor> Not really
[10:21:55] <Benkinooby> ~paste
[10:21:55] <javabot> http://eugeneciurana.com/pastebin - Paste the final url after you've pasted your stuff there.
[10:21:59] <_W_> really
[10:22:07] <Benkinooby> ~paste code
[10:22:07] <javabot> Benkinooby, what does that even *mean*?
[10:22:08] <Elvanor> I do want optimistic locking active in Hibernate
[10:22:15] <_W_> there should be no problem concurrently doing transactions
[10:22:25] <Elvanor> _W_: ? there is?
[10:22:33] <Elvanor> how can you update an object that was just updated
[10:22:43] <Elvanor> That's impossible
[10:22:49] <_W_> I don't see how
[10:23:06] <Elvanor> well it means you permanently have to refresh the object in Hibernate
[10:23:15] <Elvanor> and then it means you manage the concurrency at Hibernate's level
[10:23:18] <Elvanor> which I dont want
[10:23:27] <Elvanor> the logical thing to do is to manage that at the session level
[10:23:38] <White_Cat> _W_ mm
[10:23:42] <Elvanor> I am sure of that. The only problem is that I cannot find the correct tool to achieve what I need
[10:23:56] <_W_> Elvanor, which is likely impossible without coding something outside of the web app sphere of things that the web app communicates with
[10:24:08] <new2net> foocraft, did the junit hack work or did you shred your harddrive?
[10:24:13] <White_Cat> I am still having issues with BFS... _W_ mind taking a look at it?
[10:24:15] <Elvanor> Why? You just code that at the filter level
[10:24:18] <_W_> given that J2EE containers give no guarantee that different requests can communicate in any way
[10:24:21] <foocraft> new2net, it worked :)
[10:24:35] <foocraft> new2net, although it makes for dirty code, with extensive use
[10:24:37] <_W_> ~~ White_Cat nagging
[10:24:37] <javabot> White_Cat, nagging is asking specific people without good reason, complaining that no one answers your question, or otherwise try to get people to answer your question (faster). It is very likely to produce the exact opposite effect.
[10:24:49] * Rainier doesn't see how using transactions and having everything be atomic in the face of concurrency is a problem: last edit wins. :)
[10:24:56] <White_Cat> I dont want to post the code in public :(
[10:25:06] <Elvanor> Rainier: yeah, in this case I *dont* want last edit to win
[10:25:12] <Elvanor> that's the thing
[10:25:21] <foocraft> new2net, which is why having dependency checking and reordering part of JUnit would've been nice, because failing 20 tests because 19 depend on 1 doesn't sound like useful output to me.
[10:25:21] <White_Cat> its for an assignment and I dont want peers having the code beofre its due
[10:25:25] <_W_> White_Cat, I am a random stranger on the internet. The moment I see your code *I* can post it to the public
[10:25:26] <Elvanor> For some other objects, i just configured hibernate for last edit win
[10:25:35] <_W_> ~~ White_Cat homework
[10:25:35] <javabot> White_Cat, Homework is meant to be done by YOU, so that YOU learn something. Stop cheating; we don't like doing our own, why should we do yours? Also, answering homework questions is extremely frustrating. See "~why no homework" for more reasons why we won't answer your questions.
[10:25:36] <White_Cat> yes well I suppose
[10:25:44] <White_Cat> you were interested in looking at it a while back ago
[10:26:05] <White_Cat> fine bot attack me
[10:26:12] <White_Cat> I had a genuine question too
[10:26:17] <White_Cat> nevermind
[10:26:29] <Elvanor> _W_: I am trying to parse your last remark (given that J2EE containers give no guarantee that different requests can communicate in any way)
[10:26:50] <foocraft> White_Cat, ask about BFS and ask about Java, but don't ask "hey guys...here's a line from my hw, but I just etc. etc."
[10:26:58] <_W_> White_Cat, no, I was interested in getting you to ask questions to the channel, so everyone can help and benefit from the help, as opposed to asking specific people *in* the channel
[10:26:58] <Elvanor> In practice, they do communicate
[10:27:01] <Elvanor> via the HTTP session
[10:27:15] <Elvanor> which is precisely what I want to do
[10:27:18] <White_Cat> meh
[10:27:32] *** kebomix has quit IRC
[10:27:33] <_W_> Elvanor, I guess. Given that you only want this per-session, it could be possible
[10:27:45] <Elvanor> yeah, I am sure it is possible
[10:27:51] <_W_> Elvanor, I doubt you could get a mutex of any kind to survive in a session though
[10:27:55] <Elvanor> I am just surprised that I have to code a Mutex myself
[10:28:03] <Elvanor> _W_: why ?
[10:28:17] <_W_> because sessions are simple things - they could be stored in a database
[10:28:32] <Elvanor> Well the container associates an object by session
[10:28:42] <Elvanor> it does not mean it stores this object
[10:28:45] <foocraft> Elvanor, have your mutex use synchronized and voila :p
[10:28:59] <_W_> I am a bit out of my depth here, but as I understood it, everything in a session must be serializable
[10:29:06] <Elvanor> foocraft: *which* mutex ?
[10:29:12] <foocraft> Elvanor, the one you create
[10:29:16] <Elvanor> _W_: indeed, true. but I dont care about that
[10:29:23] <_W_> locks, semaphores etc are by nature not serializable
[10:29:28] <Elvanor> It does give me exceptions in Tomcat when I restart the container, though.
[10:29:35] <Elvanor> but as this rarely happens, I dont care yet.
[10:29:56] <Elvanor> foocraft: you mean the object linked to the session?
[10:30:34] <_W_> Elvanor, you might be relying on non-guaranteed behavior then, and your app could cease functioning on a different container, or even a different version of the container you are using
[10:30:54] <foocraft> _W_, you can have them become serializable if you use a queue to implement a neat mutex that is a bit more fair than a typical mutex
[10:30:58] <Rainier> That's hardly the right attitude: "X must be Y. I don't care. I'm doing to do it anyway with X as !Y"
[10:30:59] <Elvanor> yeah, you are probably right there, although I dont think there is a serious problem
[10:31:11] <new2net> ~why no homework
[10:31:11] <javabot> We understand you aren't asking us to do your homework. That's not why we don't answer. We don't because 1) You usually don't comprehend the answer and we get stuck in an endless loop of 'why', 2) You will understand, but you'll retort with "my professor doesn't want me to do it this way'. That's frustrating. 3) Homework questions are boring questions. We don't get paid. Your prof does.
[10:31:40] <Elvanor> foocraft: ok. I dont really know the synchronized keyword for a whole object so I ahve to parse that
[10:33:14] <new2net> javabot gets frustrated haha
[10:33:14] <javabot> new2net, what does that even *mean*?
[10:33:37] <Elvanor> foocraft: any URL so that I can understand what does syn chronized on an object?
[10:34:21] <foocraft> Elvanor, http://download.oracle.com/javase/tutorial/essential/concurrency/locksync.html
[10:34:45] *** bn` has quit IRC
[10:35:02] <foocraft> Elvanor, see the parts when they do synchronized ( someObject ) { code; }
[10:35:08] *** pantokrator has quit IRC
[10:35:10] *** psst has joined ##java
[10:35:46] *** mazzen has quit IRC
[10:36:05] <Elvanor> foocraft: oh, I got it, but it wont help me there
[10:36:24] <Elvanor> as the effect still applies on a *block*
[10:36:44] <Elvanor> and since I am doing that on filters this is not how I architectured the thing
[10:36:51] <foocraft> Elvanor, do you like have other parts in that block that you don't want them to block on waiting for an unlock?
[10:36:55] <Elvanor> I really need to have cross-cut mechanism
[10:37:25] <Elvanor> eg, I need to do acuireLock() in the before filter and releaseLock() in the after filter
[10:37:50] <Rainier> No, you need the ever impossible Universe.getLock(name).aquire()
[10:39:23] <new2net> javabot tell #php about OOP
[10:39:23] <javabot> The user #php is not on ##java
[10:40:58] *** mastroWork has joined ##java
[10:43:28] *** supercosmonaut has joined ##java
[10:44:58] *** mastroDani has quit IRC
[10:46:36] *** dinesh___ has quit IRC
[10:46:49] *** bulltwang has joined ##java
[10:46:57] *** ormaaj has quit IRC
[10:48:36] *** NS_IS has joined ##java
[10:50:12] *** ormaaj has joined ##java
[10:53:07] *** lhnz has quit IRC
[10:54:13] *** lhnz has joined ##java
[11:01:10] *** dyurds has quit IRC
[11:01:52] *** mastroWork has quit IRC
[11:01:58] *** enigma has joined ##java
[11:02:32] *** Benkinooby has quit IRC
[11:05:44] <sveajobb> what would be a nice fast way of comparing ip-addresses? I have them stored as a byte[4]
[11:06:39] <deadbeef> what about storing in a long?
[11:08:37] *** DerHorst has joined ##java
[11:11:02] *** chandan_kumar has quit IRC
[11:12:28] *** xiliax has joined ##java
[11:12:30] <sveajobb> deadbeef, yes that would probably be a good way of doing the comparison, I've come along some problems when converting to long before though, is there a built in for doing the conversion?
[11:12:55] *** Junior has quit IRC
[11:13:06] <FauxFaux> sveajobb: What about ipv6? You can't fit an ipv6 in a long.
[11:13:40] <sveajobb> FauxFaux, that is true, but for now the backing system only supports ipv4 so it's not a problem for awhile
[11:13:54] <sveajobb> FauxFaux, if you have a better solution that will work in the future (ipv6) I'm all ears
[11:13:55] <FauxFaux> Yeah, designing to make the inevitable impossible is a good idea.
[11:14:06] <dreamreal> heh
[11:14:15] <deadbeef> sveajobb: http://teneo.wordpress.com/2008/12/23/java-ip-address-to-integer-and-back/
[11:14:33] <selckin> what's wrong iwth comparing bytes
[11:14:57] <deadbeef> selckin: 4 comparisons instead of 1
[11:15:08] <deadbeef> (in the worst case ofc)
[11:15:12] <selckin> oh noes
[11:15:14] <FauxFaux> deadbeef: I bet you can't make that show up in a benchmark that involves networking.
[11:15:15] <selckin> what will you do
[11:15:16] <dreamreal> four whole comparisons?
[11:15:22] <dreamreal> *four*?
[11:15:27] <dreamreal> holy cow
[11:15:46] <FauxFaux> If it fails to unroll the loop it'll be eight comparisons!
[11:15:53] <dreamreal> Do you also, like, avoid using references on the stack because stack allocations take time, man, they take time?
[11:16:05] <sveajobb> four whole comparisons might be alot of comparisons depending on the application
[11:16:10] <deadbeef> haha
[11:16:15] <dreamreal> sure. You comparing millions of IPs?
[11:16:20] <dreamreal> Have you benchmarked?
[11:16:33] <dreamreal> (millions of SIMILAR ips, at that - in the same class C.)
[11:16:41] <deadbeef> indeed, speaking of efficiency in ##java is like speaking of virginity in the LA porn convention
[11:16:50] *** rfw has quit IRC
[11:16:55] <dreamreal> deadbeef: no, it's not - but most people focus on the wrong thing.
[11:17:15] <deadbeef> yup, i was kind of trolling
[11:17:23] <dreamreal> Using your, um, porn convention as a starting point, it'd be like mentioning what a cute nose that buxom actress has
[11:17:37] *** NS_IS has quit IRC
[11:17:44] *** mastroDani has joined ##java
[11:17:44] <FauxFaux> I wonder what year binary search was invented in.
[11:17:50] <sveajobb> I seriously dislike the fact that people do not want to optimize where they can optimize anymore. I miss the good ol' c days
[11:18:00] <sveajobb> I don't care if it's a millisecond faster, it's a millisecond faster
[11:18:03] <dreamreal> sveajobb: those days aren't gone
[11:18:08] <Rainier> FauxFaux, 10 AD
[11:18:21] <dreamreal> sveajobb: if your elimination of those four comparisons actually shows up as a millisecond, I'll buy a hat. Then eat it.
[11:18:30] <FauxFaux> sveajobb: You've wasted more time connecting to irc than will be gained in the every invocation of the referenced code.
[11:18:43] <FauxFaux> I'll also eat dreamreal's hat after he's done digesting it.
[11:18:48] <dreamreal> I'd be surprised if it added up to hundreds of *NANOSECONDS*.
[11:18:57] <sveajobb> dreamreal, :D excellent
[11:19:03] <Rainier> If you could measure it that resolutely.
[11:19:06] <dreamreal> not very - because nanoseconds are amazingly small - but still!
[11:19:13] <dreamreal> Rainier: I feel pretty safe there, yeah
[11:20:00] <dreamreal> in fact, I bet the conversion to a long will take just as long as the four comparisons, perhaps even longer
[11:20:23] <deadbeef> sveajobb: anyway, the solution at that link doesn't look so efficient, imho it should be like l = b[0] | (b[1] >> 8) | (b[2] >> 16) etc.
[11:20:23] <sveajobb> but it's not really a matter of the actual speed gain, it's an art form , it's knowing you did something as fast as you could instead of an unnoticable tad slower
[11:20:33] <dreamreal> the best advice, as usual, is "don't optimize."
[11:20:43] <dreamreal> instead of an unnoticable tad slower?
[11:20:46] <dreamreal> Did you really say that?
[11:21:01] <sveajobb> yes?
[11:21:02] <dreamreal> sveajobb: look... the JIT will optimize far far far better than you ever can imagine on a micro level.
[11:21:10] <Rainier> dreamreal, but it's almost, but not entirely, unlike faster.
[11:21:23] *** ExtraSpice has quit IRC
[11:21:34] <dreamreal> sveajobb: http://www.enigmastation.com/?p=173
[11:21:35] <FauxFaux> My favourite thing about JITs is that even if it's slower now it might be faster later or on a different cpu.
[11:21:49] <dreamreal> FauxFaux: and it's probably not slower now, by any measure
[11:21:49] <FauxFaux> (Exactly the same as native code, to be fair. Even after compilation.)
[11:22:04] <dreamreal> FauxFaux: static compilation isn't as good as runtime optimization
[11:22:06] <Rainier> FauxFaux, my favorite thing is that I don't have to do anything!
[11:22:12] <dreamreal> not when it's done the way the JVM does it
[11:22:12] <selckin> and just restarting the app might make it faster!
[11:22:36] <FauxFaux> dreamreal: I'm fully aware of that, I was presenting the argument that that blog is probably about. :p
[11:23:05] * Rainier decides that if his remote session doesn't reactivate soon he needs to go to bed.
[11:23:07] <Rainier> oh darn.
[11:23:22] <dreamreal> FauxFaux: heh
[11:23:30] <FauxFaux> Actually, I have a testcase somewhere where I have two independent side-effect-free methods, a() and b(), where a(); b(); is significantly faster than just running b();.
[11:23:52] <dreamreal> well, optimization in java should be a last resort. Use good algorithms at the macro level, and don't worry about anything else unless you have to.
[11:26:43] *** arborist has joined ##java
[11:27:11] *** benJIman has joined ##java
[11:28:42] *** shervin_a has joined ##java
[11:29:04] *** Odd_Bloke has joined ##java
[11:29:47] *** evaluate has joined ##java
[11:29:49] <evaluate> hello
[11:30:43] <evaluate> I'm pretty new to java and I would like to edit a program, but not sure how I can achieve this. I have class Foo1 with method Bar1 and class Foo2 with method Bar2. Is there a way to call method Bar2 from within method Bar1?
[11:31:35] <selckin> minecraft?
[11:31:45] <dreamreal> heh
[11:31:59] <dreamreal> okay, what? edit a program, then figure out how to chain methods? These are two problems.
[11:32:58] *** mastroWork has joined ##java
[11:33:11] <dreamreal> and, naturally: "minecraft?"
[11:33:15] <evaluate> No this isn't minecraft, it's an android application. And dreamreal sorry, English isn't my first language, I know how to edit the program (doh) I don't know how to tall that second methond from within the first method
[11:33:26] <evaluate> s/tall/call/
[11:33:34] <dreamreal> public class A { void bar1() { } void bar2() { bar1(); } }
[11:33:44] <dreamreal> same way you call the first method
[11:34:10] <Odd_Bloke> Good day, sir.
[11:34:28] <evaluate> dreamreal, it's rather something like: public class A { void bar1() { } }; public class B { void bar2() { bar1(); } }
[11:34:43] *** Odd_Bloke has quit IRC
[11:34:57] *** ExtraSpice has joined ##java
[11:35:00] <dreamreal> evaluate: nope. Try this instead: public class A { void bar1() { } } public class B { void bar2(A a) { a.bar1(); } }
[11:35:59] <evaluate> Hmm. Then I'd have to pass it the object that adopts that class, guess I'd have to figure out which one that is.
[11:36:49] <dreamreal> yeah.
[11:36:59] *** mastroDani has quit IRC
[11:37:00] <dreamreal> what's your native tongue?
[11:37:12] <evaluate> dreamreal, I know romanian and german
[11:37:17] *** eyesUnclouded has joined ##java
[11:37:28] *** Odd_Bloke has joined ##java
[11:37:28] <dreamreal> Strangely, that doesn't answer the question. :)
[11:37:42] *** mastroWork has quit IRC
[11:37:48] <Odd_Bloke> MrWilson.
[11:37:52] <dreamreal> it's not important. :)
[11:38:09] <evaluate> dreamreal, I'm not sure why you're asking though...
[11:38:09] *** fr0ggler has joined ##java
[11:38:22] <dreamreal> evaluate: just interested, is all.
[11:38:28] <dreamreal> Like I said, it's not important.
[11:38:52] <evaluate> Well, I live in Romania, but I've studied everything in the German language.
[11:38:59] <evaluate> In school I mean...
[11:39:07] <dreamreal> *nod* I keep wanting to learn German
[11:39:13] <evaluate> So I know both of them really well
[11:39:29] <evaluate> English was my third language and I was never really good at it :-p
[11:40:12] <dreamreal> you're typing it here very well (which is why I wondered - usually people for whom english is a secondary tongue have a lot of linguistic outliers which weren't present in what you typed)
[11:40:43] <dreamreal> usually I can get a good sense of what someone's primary language is from what they do incorrectly in english
[11:40:44] <Rainier> dreamreal, this like you mean?
[11:40:50] <dreamreal> Rainier: I have a doubt.
[11:40:58] <Rainier> heheh
[11:41:14] <sveajobb> dreamreal, interesting, did you get a hint of what my primary language is? :)
[11:41:27] <evaluate> dreamreal, well, I've got most of my English skills from talking to other people (just like now) so my writing skills are decent, you wouldn't want to hear me speak English though :-p
[11:41:53] <dreamreal> you wouldn't want to hear me speak german, so we're even :)
[11:42:00] <evaluate> heh
[11:42:05] <dreamreal> sveajobb: no, honestly
[11:42:21] <evaluate> ok then, thanks for the help! Hope I can figure this java stuff out. :-)
[11:42:22] <sig^> norwegian
[11:42:29] <sveajobb> swedish ;)
[11:42:37] <dreamreal> norwegia usually has decent english skillz
[11:42:40] <Rainier> evaluate, dreamreal, http://www.youtube.com/watch?v=akbflkF_1zY
[11:42:51] <dreamreal> just like finlandites
[11:43:11] *** mastroWork has joined ##java
[11:44:13] <dreamreal> europe is funny. For example, did you know that "iceland" in english looks like "land of ice," instead of "icky land?"
[11:44:44] <Rainier> no, no, greenland is the one with ice.
[11:44:45] <sig^> eh.
[11:45:06] <sveajobb> icky land? o_O
[11:45:30] <dreamreal> I saw a picture that was made up from a "satellite." It didn't show greenland as being green; it was sorta whitish, proof that satellites don't exist.
[11:45:46] <dreamreal> I mean, DUH. Greenland. it's green.
[11:45:48] <new2net> do we have a bot loose?
[11:46:03] <fr0ggler> ~ping
[11:46:04] <javabot> You rang, m'lord?
[11:46:04] <dreamreal> ~javabot hello
[11:46:05] <javabot> dreamreal, what does that even *mean*?
[11:46:21] <fr0ggler> the bot is available. repeat, bot available.
[11:46:25] <sveajobb> :D now that is one intelligent bot
[11:46:25] * dreamreal is still giggling that people think we've been to the moon
[11:46:40] <dreamreal> I mean, duh. It'd melt. Fire + cheese = melted cheese.
[11:46:48] <sveajobb> ...
[11:47:24] <fr0ggler> it's not Earth cheese you fool. it's *moon* cheese. it doesn't obey the same laws
[11:47:49] *** bitshuffler has joined ##java
[11:47:57] <dreamreal> ... oh. I'd not thought of that.
[11:48:17] <Rainier> You didn't watch the documentary by Wallace and Gromit?
[11:48:19] * dreamreal adjusts world view. Thank god sarah palin is gonna win in 2014!
[11:48:24] <dreamreal> Rainier: no
[11:48:40] <Rainier> :(
[11:49:31] *** DroidAgent has quit IRC
[11:50:19] *** DroidAgent has joined ##java
[11:50:41] <new2net> i am voting using a random number. Its my vote my choice.
[11:51:01] <dreamreal> I'm all for that. That'd probably give us a much smarter body politic.
[11:51:30] *** ManOwl has joined ##java
[11:51:49] *** wliao has quit IRC
[11:52:44] <ManOwl> I am missing something about implementing Iterable
[11:52:59] <dreamreal> so noted.
[11:53:21] <ManOwl> http://pastie.org/1646849 there's my code for the Iterable class, but when I try to for(:) through it, I have to declare the LHS as an Object or it gets flagged by eclipse static analysis as wrong
[11:53:26] <ManOwl> what did I do?
[11:55:31] *** platzhirsch has left ##java
[11:55:36] *** BSWolf has joined ##java
[11:55:43] *** Rainier has left ##java
[11:56:23] <dreamreal> Iterable<Entry>, no?
[11:56:50] <ManOwl> it should be Iterator<Entry>
[11:57:32] * dreamreal points to Iterable
[11:57:47] *** devkhadka has quit IRC
[11:57:48] *** Versuchen has joined ##java
[11:57:55] *** GibbaTheHutt has joined ##java
[11:58:21] <ManOwl> yeah, I see what you mean now
[11:58:31] <ManOwl> I just changed that and I'm a bit closer
[12:00:38] <ManOwl> changed that, changed all the Entry to T
[12:00:45] <ManOwl> still demanding I declare my LHS as object.. hm
[12:01:19] <FauxFaux> Show us the new code.
[12:01:47] <ManOwl> http://pastie.org/1646871 thanks
[12:02:19] <FauxFaux> No, you want implements Iterable<T>.
[12:02:26] <dreamreal> whew, just finished Mahjong
[12:02:35] <dreamreal> what a stress!
[12:02:36] <FauxFaux> Also, add @Override annotations everywhere and that code will be a compile error.
[12:02:39] * dreamreal can now get to work
[12:02:54] *** gelignite has joined ##java
[12:03:31] <ManOwl> FauxFaux: exxxxxcellent
[12:03:40] <ManOwl> what is the bot syntax for giving karma?
[12:04:59] <dreamreal> tilde, name, ++ or --
[12:05:05] <dreamreal> ~karma
[12:05:05] <javabot> dreamreal, karma is all living beings have actions (karma) as their own, their inheritance, their congenital cause, their kinsman, their refuge. it is karma that differentiates beings into low and high states.
[12:05:09] <dreamreal> pffft
[12:05:42] <ManOwl> ~FauxFaux ++
[12:05:42] <javabot> ManOwl, what does that even *mean*?
[12:05:48] <dreamreal> no space
[12:05:48] <ManOwl> ~FauxFaux++
[12:05:48] <javabot> fauxfaux has a karma level of 18, ManOwl
[12:05:55] <ManOwl> ~dreamreal++
[12:05:55] <javabot> dreamreal has a karma level of 4, ManOwl
[12:06:00] <ManOwl> thanks guys
[12:06:02] <dreamreal> damn it
[12:06:04] <dreamreal> ~dreamreal--
[12:06:04] <javabot> Changing one's own karma is not permitted.
[12:06:06] <javabot> dreamreal, you have a karma level of 3
[12:06:06] <dreamreal> ~dreamreal--
[12:06:07] <javabot> Changing one's own karma is not permitted.
[12:06:08] <javabot> dreamreal, you have a karma level of 2
[12:06:08] <dreamreal> ~dreamreal--
[12:06:09] <javabot> Changing one's own karma is not permitted.
[12:06:10] <dreamreal> ~dreamreal--
[12:06:10] <javabot> dreamreal, you have a karma level of 1
[12:06:11] <javabot> Changing one's own karma is not permitted.
[12:06:12] <javabot> dreamreal, you have a karma level of 0
[12:06:14] <dreamreal> there.
[12:06:37] <ManOwl> what, you don't think irc is reddit?
[12:06:48] <ManOwl> :-P
[12:06:58] <dreamreal> surprisingly, no. And I don't want anything in the bot.
[12:07:10] *** chandan_kumar has joined ##java
[12:08:19] <Zharf> karma's useless
[12:09:04] <ManOwl> i like it, especially on stack overflow
[12:09:12] <dreamreal> that's fine
[12:09:27] <dreamreal> and I don't care if people use it here, but *I* want nothing to do with it
[12:09:36] <ManOwl> haha
[12:10:33] <dreamreal> it has potential to be useful, because it's a way people can show approval or lack of it. But again: me, javabot: no.
[12:12:41] <_W_> ~dreamreal++
[12:12:41] <javabot> dreamreal has a karma level of 1, _W_
[12:12:51] <_W_> you deserve karma for shunning karma :p
[12:13:05] <dreamreal> ~dreamreal--
[12:13:05] <javabot> Changing one's own karma is not permitted.
[12:13:06] <javabot> dreamreal, you have a karma level of 0
[12:13:30] *** mastro has joined ##java
[12:13:36] *** sileni has quit IRC
[12:15:33] <_W_> what in J2EE would you use for things like weekly tasks? Or is that just not suitable, you should use cron and a separate process?
[12:16:07] <dreamreal> timer bean.
[12:16:43] <_W_> what google refers to as "EJB timer services"?
[12:17:17] *** mastroWork has quit IRC
[12:17:28] <_W_> looks like it, thanks
[12:17:29] <dreamreal> yeah.
[12:19:08] *** chandan_kumar has quit IRC
[12:19:25] *** supercosmonaut has quit IRC
[12:19:34] *** devkhadka has joined ##java
[12:19:55] *** ferret_ has quit IRC
[12:20:24] *** wchun has quit IRC
[12:20:53] *** SniperFodder has quit IRC
[12:22:11] *** Benkinooby has joined ##java
[12:22:52] *** ferret_ has joined ##java
[12:23:57] <Benkinooby> hi, the suggestionf or the doc layout from oracle http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html are different from the ones eclipse suggests (e.g. eclipse puts an asterisk in every doc line while the examples on the web site do not)
[12:24:04] <Benkinooby> which one should i follow?
[12:24:25] *** cocoloa has joined ##java
[12:24:40] <dreamreal> the one that you want to use.
[12:25:04] *** magentar has joined ##java
[12:25:12] <Benkinooby> dreamreal, ok. i was not sure, becasue the make a big fuzz out of comment layout on the web site ;)
[12:26:58] *** Benkinooby has quit IRC
[12:26:58] *** mastroWork has joined ##java
[12:27:02] <ManOwl> just set up my desktop coffee maker :D
[12:27:10] <ManOwl> you think the steam from a 1 cup can damage an lcd?
[12:28:29] <fr0ggler> ~~ManOwl tias
[12:28:29] <javabot> ManOwl, Try it and see. You learn much more by experimentation than by asking without having even tried.
[12:29:10] * ManOwl senses some caveats o_o
[12:30:09] *** supercosmonaut has joined ##java
[12:30:18] *** mastro has quit IRC
[12:35:14] *** jjido has joined ##java
[12:36:13] *** new2net has quit IRC
[12:37:28] <dreamreal> more like we're waiting with bated breath for the "AAARRRRGHHHH MY LCD!!!!!!" screams
[12:39:17] <dreamreal> fr0ggler here said you'd do it in a manly, "Shaft"-style voice
[12:39:29] <dreamreal> meanwhile: I went with the girly scream of fear and agony. (I drew first.(
[12:41:58] <ManOwl> heh
[12:42:05] <ManOwl> I am going to move it to my bookshelf
[12:42:29] <dreamreal> man, we never get any fun :(
[12:42:54] * ManOwl remembers he's not supposed to be having fun right now
[12:43:09] *** ManOwl has quit IRC
[12:44:17] *** bulltwang has quit IRC
[12:45:02] *** bulltwang has joined ##java
[12:45:11] <evaluate> Any idea how I can solve this: http://pastebin.com/adXVG2KV ?
[12:45:17] *** topriddy has quit IRC
[12:47:08] *** topriddy has joined ##java
[12:47:16] <fr0ggler> evaluate, well the first error is pretty self explanatory. you can't instantiate PowerManager because it's private. only static methods can be called like you have done in your second example, and goToSleep() appears not to be static.
[12:47:23] <fr0ggler> ~static
[12:47:23] <javabot> fr0ggler, static is a keyword which indicates that a member is scoped to a class rather than an object instance. Members of interfaces (except methods) are always static. Nested interfaces and enums are always static. See http://tinyurl.com/3q7oc and http://tinyurl.com/34vr3u for more information.
[12:47:50] *** jjido has quit IRC
[12:49:33] *** mastro has joined ##java
[12:51:13] *** echosystm has quit IRC
[12:52:28] <evaluate> Hmm. Does that mean that the goToSleep method is not meant to be used from anywhere else? Or am I just doing it wrong?
[12:52:40] *** mastroWork has quit IRC
[12:52:49] <fr0ggler> no idea. you'll probably have more luck in #android
[12:53:07] <fr0ggler> (and read the API)
[12:53:26] <evaluate> ok, thank you! :-)
[12:53:29] <fr0ggler> np
[12:54:32] *** supercosmonaut has quit IRC
[12:55:47] <bizarrefish> hi, all
[12:55:53] <bizarrefish> i'm having an RMI issue
[12:56:19] <fr0ggler> evaluate, ah it may be #android-dev. sorry, just read the topic :)
[12:56:58] <evaluate> fr0ggler, yeah, I tried asking there already, the people doesn't seem that active though.
[12:57:01] *** rgr has joined ##java
[12:57:16] <evaluate> s/doesn't/don't/
[12:57:23] <bizarrefish> I'm new to all of this and trying to get the 'front' remote object to be used as a broker for remote objects. Problem is, the client, after the server returns the new remote object, then complains: "$Proxy1 cannot be cast to java.rmi.server.RemoteStub"
[12:57:39] <fr0ggler> evaluate, android dev forums?
[12:58:13] <evaluate> fr0ggler, I tried using google and I think I found a way to call that method. I'm trying it out right now.
[12:58:19] <bizarrefish> WHy can't it?! it's a subclass of unicastremoteobject
[12:58:43] <dreamreal> heh
[12:58:54] *** jjido has joined ##java
[13:00:05] *** Engin has joined ##java
[13:03:44] *** LyQuid has joined ##java
[13:08:02] *** pipeep has quit IRC
[13:13:51] *** topriddy has quit IRC
[13:14:37] *** topriddy has joined ##java
[13:16:19] *** bitshuffler_ has joined ##java
[13:17:26] *** pipeep has joined ##java
[13:18:11] *** bitshuffler has quit IRC
[13:21:05] *** topriddy has quit IRC
[13:21:47] *** VJTachyon has joined ##java
[13:21:49] *** homie has quit IRC
[13:23:06] *** enigma has quit IRC
[13:23:50] *** jtheuer has joined ##java
[13:24:26] <durre> I'm writing data with hibernate and then I try to read the data back with mybatis. this is not going well since the two dont share session/transaction/connection. I'm thinking that maybe if I flush the hibernate session and change the isolationlevel to ISOLATION_READ_UNCOMMITTED, it might work. will it? :)
[13:24:37] *** homie has joined ##java
[13:24:59] *** topriddy has joined ##java
[13:26:31] <cheeser> um. why would they be sharing a transaction?
[13:26:49] <jtheuer> "not going well"?
[13:27:20] *** remonvv has joined ##java
[13:27:26] <deebo> one shouldnt see uncommitted data anyhow, or you are using some funky databases
[13:28:01] <remonvv> Hi guys. Can't think of a better channel to ask this so I'll try here. Does anyone know if returning HTTP status code 400 requires mandatory response headers or something? JavaScript from FF refuses to "see" responses from 4XX requests.
[13:28:36] <durre> this is just for integration tests. we want to use our existing infrastructure with hibernate to write the test data, and then read with mybatis.
[13:28:36] <deebo> how about #web or #javascript
[13:28:48] <remonvv> tried, no response and no response respectively ;)
[13:29:07] <deebo> remonvv: did you wait more than 30 minutes
[13:29:12] <durre> so in the real world we wont be needing to see uncommitted data
[13:29:24] <remonvv> Since 11:38
[13:29:25] *** topriddy has quit IRC
[13:29:45] <fr0ggler> remonvv, other unresponsive channels are not ##java's responsibility
[13:30:07] *** jdolan has joined ##java
[13:30:07] <deebo> durre: my point was, you shouldnt see, if your database integrity is proper (real foreign keys etc), the reader should have no problems at any time
[13:30:17] <deebo> just make the writer has a sensible transaction length
[13:30:20] <deebo> +sure
[13:30:38] <deebo> im just not seeing how this is even a problem :P
[13:30:47] <remonvv> I didn't bring up their responsiveness did I.
[13:32:07] *** hex` has joined ##java
[13:33:15] *** DerHorst has quit IRC
[13:33:25] <durre> deebo: I dont understand what you're saying in my @Test method I first insert data with hibernate (so we are not dependant on existing data in db). then in the same method we try to read the data with mybatis to assert the result. but we're not seeing the data
[13:33:45] *** caverdude has joined ##java
[13:33:54] <deebo> durre: if the hibernate transaction is still running, you wont see anything
[13:33:59] *** jjido has quit IRC
[13:34:24] *** Cymage has joined ##java
[13:34:26] *** tilerendering has quit IRC
[13:34:38] *** supercosmonaut has joined ##java
[13:34:38] *** zhulikas has quit IRC
[13:34:42] <deebo> the db will commit th writes when the hibernate session closes and/or you call commit on it
[13:35:21] <durre> deebo: so calling flush (synchronize with db) and changing isolation level with have no effect?
[13:35:21] *** gelignite has quit IRC
[13:35:21] *** eitch0000 has quit IRC
[13:35:21] *** FrozenKnight has quit IRC
[13:35:21] *** bojo has quit IRC
[13:35:21] *** ivenkys has quit IRC
[13:35:21] *** tigger0jk has quit IRC
[13:35:21] *** fisted has quit IRC
[13:35:21] *** freeone3000 has quit IRC
[13:35:22] *** JohnnyDavidson has quit IRC
[13:35:22] *** Pawnee has quit IRC
[13:35:22] *** yogi has quit IRC
[13:35:22] *** xelister has quit IRC
[13:35:22] *** dmiles has quit IRC
[13:35:22] *** joed has quit IRC
[13:35:22] *** Garibaldi has quit IRC
[13:35:22] *** Noya has quit IRC
[13:35:22] *** Stephmw has quit IRC
[13:35:22] *** mordu has quit IRC
[13:35:23] *** PigFlu has quit IRC
[13:35:23] *** raek has quit IRC
[13:35:40] <deebo> flushing wont help if the transaction is still running, since the isolation level is withing hibernate (correct me if im wrong)
[13:35:54] <cheeser> the isolation is done in the db
[13:36:08] *** remonvv has left ##java
[13:36:21] <durre> but it seems you can set a custom isolation level
[13:36:35] <deebo> why cant you just commit the transaction?
[13:36:36] *** dmiles_afk has joined ##java
[13:36:51] *** Pawnee has joined ##java
[13:37:07] <durre> deebo: then we will have to delete the data after each test method
[13:37:18] <deebo> uhm so?
[13:37:22] <dreamreal> heh
[13:37:24] <deebo> thats what @before is for
[13:37:29] *** mastroWork has joined ##java
[13:37:31] <dreamreal> durre: don't use a slow data store, no problem
[13:37:44] <dreamreal> besides, are you trying to test hibernate or what?
[13:38:09] *** gelignite has joined ##java
[13:38:31] <durre> dreamreal: nope, our DAO method using mybatis
[13:39:04] <deebo> write the data to the DB _BEFORE_ the @Test method if you're just testing reading
[13:39:20] <dreamreal> durre: so you don't trust mybatis?
[13:39:37] *** Garibaldi has joined ##java
[13:39:40] *** fisted has joined ##java
[13:39:43] *** ker has joined ##java
[13:40:19] <durre> dreamreal: I dont trust our query. or rather... I want to just run my unit test without having to build, startup the whole application
[13:40:37] *** mastro has quit IRC
[13:40:51] *** eitch0000 has joined ##java
[13:40:51] *** FrozenKnight has joined ##java
[13:40:51] *** bojo has joined ##java
[13:40:51] *** ivenkys has joined ##java
[13:40:51] *** tigger0jk has joined ##java
[13:40:51] *** freeone3000 has joined ##java
[13:40:51] *** xelister has joined ##java
[13:40:51] *** JohnnyDavidson has joined ##java
[13:40:51] *** yogi has joined ##java
[13:40:51] *** Noya has joined ##java
[13:40:51] *** joed has joined ##java
[13:40:51] *** Stephmw has joined ##java
[13:40:51] *** mordu has joined ##java
[13:40:51] *** PigFlu has joined ##java
[13:40:51] *** raek has joined ##java
[13:40:52] <dreamreal> durre: *nod* well, using hsqldb in-memory, and wiping the data after each test, is pretty normal
[13:40:54] <ker> hi
[13:41:00] <ker> what's wrong with this? if (comboSerialPorts.getSelectedItem().toString().compareTo("Refresh...") == 0) {
[13:41:04] *** eitch0000 has quit IRC
[13:41:06] <ker> I get "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException"
[13:41:10] *** eitch0000 has joined ##java
[13:41:19] <dreamreal> ker: i wonder at which method the NPE is being thrown
[13:41:29] <dreamreal> I can't tell, offhand, since you have so many chained methods
[13:41:29] <ker> at ControlloRele.ControlloRele.comboSerialPortsActionPerformed(ControlloRele.java:197)
[13:41:58] <dreamreal> hmm. I wonder if comboSerialPorts is null! Or getSelectedItem() might be returning null! Or the toString() might be returning null!
[13:42:04] <jink> Probably comboSerialPorts is null or getSelectedItem() returns null.
[13:42:18] <durre> deebo: I'll think about using the @Before for this. i havent before :)
[13:42:18] <jink> toString() never returns null, afaik. It might return "null", though.
[13:42:22] <dreamreal> So many questions to ponder. And yet, I never get NPEs unless I'm doing stupid stuff, and I can fix that. I think I'll head back to my own work.
[13:42:26] <dreamreal> jink: really?
[13:42:41] <jink> Ok, sure, if you override it poorly. :P
[13:42:42] *** devkhadka has quit IRC
[13:42:43] * dreamreal casually writes @Override public String toString() { return null; }
[13:42:48] <ker> yes, fixed
[13:42:52] <ker> if(comboSerialPorts.getItemCount() > 0) {
[13:42:55] <ker> with this check ;)
[13:42:57] <jink> Silly dreamreal. :)
[13:42:58] <ker> thanks
[13:43:04] <dreamreal> still bad form to chain so many method calls
[13:43:11] <jink> +1
[13:43:18] <dreamreal> you don't save anything by chaining them, and you obscure stuff you may actually be interested in
[13:43:39] <dreamreal> (such as "which reference is the NPE coming from?")
[13:43:42] <ker> what's a better way to do this?
[13:43:48] <ker> I mean, how do I unchain them?
[13:44:07] <jink> selectedItem = comboSerialPorts.getSelectedItem();
[13:44:08] <jink> etc.
[13:44:11] <dreamreal> ^^^ that.
[13:44:14] <jink> And null-check every item.
[13:44:15] <ker> oh ok
[13:44:27] <jink> Like, you'd only want to do that if comboSerialPorts != null.
[13:44:29] <dreamreal> jink: no need to null-check every time, unless null is a normal condition
[13:44:34] <jink> Sure.
[13:44:47] <dreamreal> but if it isn't a normal condition, the stack trace would show you VERY clearly where it came from
[13:44:49] *** zhulikas has joined ##java
[13:44:49] *** cool123 has joined ##java
[13:44:49] <jink> But null is a normal condition, apparently, or the NPE wouldn't have happened. :D
[13:45:11] <dreamreal> and at runtime? That doesn't cost you anything, because JIT will eventually not bother storing those refs on the stack, it'll use registers
[13:45:16] <durre> dreamreal: speaking of in memory. I was playing around with hsql in my hobby project... which worked fine. then I went to production (mysql) and got lots of problem. can I get hsql to act more like mysql? :)
[13:45:32] <dreamreal> durre: you want hsql to have mysql's problems?
[13:45:38] <dreamreal> Hmm, normally it's the other way around.
[13:46:04] <dreamreal> (incidentally: I dunno, I don't care. I hate relational databases. they're slow, clunky, problem-ridden.)
[13:46:04] <durre> dreamreal: sigh... I want the same behaviour in the in memory as the production db
[13:46:21] <deebo> you can (almost) have that
[13:46:23] <dreamreal> durre: for that, you'd have to use mysql in-memory. Oh wait! It's mysql, so you can't. :)
[13:46:30] <deebo> with careful schema planning etc
[13:46:38] <deebo> count out oracle tho
[13:47:15] <deebo> we have mysql postgre and oracle via hibernate on the same mappings
[13:47:19] <deebo> only schemas differ
[13:47:20] <durre> ok, we're using oracle at work so I guess hsql is out the question there too :)
[13:47:57] <deebo> nah its not, just takes some time
[13:48:06] <deebo> and non-generated schemas
[13:48:21] <dreamreal> you guys should tell me who you work for, so $employer can go ahead and start marketing to you for when your performance drops through the floor.
[13:48:47] *** deus_ has joined ##java
[13:48:57] <deebo> :)
[13:49:01] <deebo> no problems (yet!)
[13:49:08] <dreamreal> of course.
[13:49:25] <dreamreal> databases are tar babies: they work fine until you really start interacting with them.
[13:49:54] <durre> I think we're headed towards cassandra and mongodb for some tasks
[13:50:23] <deebo> id prefer solr and nosql but it would be a massive change, so not quite possible yet
[13:50:49] *** Sliker has joined ##java
[13:51:44] *** Peeter has joined ##java
[13:51:47] <Peeter> Is there a way to get the ID (or any unique identifier) of the Connection @ jdbc?
[13:51:53] <dreamreal> nosql shouldn't be a massive change
[13:52:03] <dreamreal> It often is, but that's a failure on the part of the nosql product
[13:52:16] <dreamreal> Peeter: why would the id be important?
[13:52:37] <deus_> I have a text file with doubles, all which have 3 decimals. I need to read them as accurate as possible, i.e. no rounding, so I probably need to store them as integers. How can I read them properly? Something like: int myConvertedInt=(int)(Double.parseDouble(mydouble)*1000); is probably not a safe way to do this right?
[13:52:40] <Peeter> I'm messing with a connection pool and would like to know which connection is doing which query
[13:52:48] <deebo> deus_: BigDecimal
[13:52:57] *** FrozenKnight has quit IRC
[13:53:25] <deus_> deebo: I prefer to work with a lightweight data type like int's. makes it also easier to perform calculations
[13:53:47] <fr0ggler> ...
[13:53:57] <dreamreal> heh
[13:53:57] *** FrozenKnight has joined ##java
[13:54:30] <Planck_> I suggest byte. Even lighter weight.
[13:54:49] <deus_> An alternative way to get my integer would be to read the string which contains the double, remove the ".", e.g. 123.999 and cast the result to an int?
[13:54:58] <fr0ggler> ...
[13:55:01] <Planck_> And efficient even on Z80 CPUs.
[13:55:10] *** rgr has quit IRC
[13:55:30] <deus_> so what would be the proper way to do this?
[13:55:48] <Peeter> dreamreal: Any thoughts?
[13:56:47] *** glcrazy has quit IRC
[13:58:27] *** zuxqoj has quit IRC
[13:58:44] <dreamreal> Peeter: nope, depends very much on the connection implementation
[13:59:05] <fr0ggler> deus_, you could try using BigDecimal, as originally suggested
[13:59:06] *** suiside has quit IRC
[13:59:19] *** zuxqoj has joined ##java
[14:00:05] <deus_> fr0ggler: why would you recommend BigDecimal over integer?
[14:00:50] <[[thufir]]> deus_: you have two options AFAIK
[14:00:59] <dreamreal> deus_: heh
[14:01:04] <[[thufir]]> one, is to prefer accuracy, the other is speed
[14:01:06] *** ker has quit IRC
[14:01:19] <[[thufir]]> if accuracy, then use int. if speed, then decimal
[14:01:40] <[[thufir]]> furthermore, there are special Java classes. I think BigInteger or something. that's what banks use?
[14:01:49] <dreamreal> gee. integer is awesome, because it's ... so precise. After all, it can handle ginormous numbers! up to, what, 20 million units if we take away two places for cents!
[14:01:49] <[[thufir]]> if accuracy is what you want.
[14:01:58] <dreamreal> 20 million dollars is enough for anyone.
[14:02:09] <fr0ggler> deus_, read the API for BigDecimal. precision is one of the factors that you seem to need to consider.
[14:02:17] <[[thufir]]> dreamreal: there's another, like BigInteger or something to address that.
[14:02:19] *** mastroWork has quit IRC
[14:02:20] <dreamreal> And BigDecimal is ideal for money, because the unit is the dollar/euro/whatever, and you don't lose accuracy.
[14:02:25] <dreamreal> hahaha
[14:02:26] <dreamreal> my god
[14:02:40] <[[thufir]]> oh, I thought there was BigInteger? no?
[14:02:56] <dreamreal> You do know that BigDecimal doesn't lose digits, right? BigInteger isn't *more precise* than BigDecimal, it just doesn't handle real numbers. At all.
[14:03:14] <dreamreal> Money is normally reflected as a form of real number (i.e., $4.12 isn't an integer; it's a real.)
[14:03:42] <fr0ggler> accuracy int. speed decimal. erm. right.
[14:03:53] <sveajobb> finally!
[14:03:57] <dreamreal> damn cobol to hell. It taught people that it was okay to see money as integral values, because of 999v99.
[14:04:34] <dreamreal> I shouldn't complain; I ended up with US Sec B clearance because I was tasked to write code to help make sure the state of Florida didn't lose money thanks to that kind of rubbish.
[14:04:41] <deus_> dreamreal: well actually my data are coordinates with 3 decimals precision. The only fractional computation I need to do is calculate the distance between 2 points using pythagoras. But I'll have a look at the bigdecimal class
[14:05:11] <fr0ggler> deus_, there are probably 3rd party libraries that will do that for you.
[14:06:06] * dreamreal snickers
[14:06:46] <deus_> thnx all :)
[14:06:54] <[[thufir]]> dreamreal: ah, I didn't know that about BigDecimal, thanks.
[14:08:00] <dreamreal> so, uh... you know... I have a doubt
[14:08:24] *** cool123 has quit IRC
[14:08:35] <dreamreal> I just realized a problem: I have 20+ years in this stupid idiot field, mostly because people haven't figured out how to properly fire me such that i change careers.
[14:08:50] *** cool123 has joined ##java
[14:09:09] <dreamreal> But I know what I don't know, so i have a tendency to see everyone as equals: I'm not smarter than you are. But people ask the stupidest questions ALL THE FREAKING TIME.
[14:09:26] <dreamreal> ... you know, stuff that people with one year of experience would know how to figure out.
[14:09:29] *** aLeSD has quit IRC
[14:09:43] <mapreduce> I have one year of experience, repeated 25 times.
[14:09:59] <dreamreal> (I state this from experience: I would have been able to do so within about a month of being thrown into the fire professionally, but others may have different pressures applied.)
[14:10:11] <dreamreal> So... uh... how am I supposed to gauge what people should be able to know or not?
[14:10:18] <mapreduce> dreamreal: There's a vast difference in how people approach problems.
[14:10:44] <mapreduce> I'm guessing when you encounter an error message that makes no sense, you just google it like I do.
[14:10:45] *** topriddy has joined ##java
[14:10:46] <dreamreal> mapreduce: sure. But what is the takeaway when I see few problems as not having obvious shortcuts?
[14:11:00] <mapreduce> For others they try to reason first, and there's no point.
[14:11:28] <dreamreal> I guess I'm trying to figure out how to help people without looking like a douchenozzle and thinking the person asking for help is a moron.
[14:11:45] <fr0ggler> what if they're a moron?
[14:11:58] <Peeter> dreamreal: I'm talking about this object: http://download.oracle.com/javase/1.3/docs/api/java/sql/Connection.html
[14:11:59] <mapreduce> In my current job the problems always lie in the client or the server, rarely both. Some people don't seem to get why the first thing I try to do is work out which of the two is the problem.
[14:12:11] <dreamreal> I mean, how do you answer "hey guys what's 2+3 I can't figure it out" without, you know, thinking "gee, you FSCKING IDIOT, it's FIVE, learn to count"
[14:12:15] *** Vorrin has joined ##java
[14:12:18] *** sebersole has joined ##java
[14:12:20] <Vorrin> hello
[14:12:25] <dreamreal> mapreduce: :(
[14:12:32] <dreamreal> That's a good example of the problem, too: I mean, DUH.
[14:13:03] <deus_> dreamreal: sounds like you are in need of a holiday :)
[14:14:00] <dreamreal> deus_: or a sabbatical, lasting years, sure
[14:14:23] <dreamreal> but I'm not asking to make fun of people, I'm asking for advice on how to phrase things such that i'm not insulting people externally or internally
[14:14:33] <dreamreal> yet still encouraging people to, you know, think just a little
[14:14:50] <Vorrin> how would one go about making the items within a JComboBox larger? I found a java tutorial where that happens ( http://download.oracle.com/javase/tutorial/uiswing/examples/components/CustomComboBoxDemoProject/src/components/CustomComboBoxDemo.java ) , but I'm still not getting it :/
[14:14:52] <dreamreal> darwin's a harsh teacher, you know?
[14:15:15] <Vorrin> I swear I tried to think about it, and didn't reach anywhere this far(quite new to the whole thing) :)
[14:16:10] <fr0ggler> Vorrin, ComboBoxRenderer renderer= new ComboBoxRenderer(); that's the bit you're interested in
[14:16:19] <Vorrin> yes
[14:16:21] <fr0ggler> read up on custom renderers
[14:16:23] <Vorrin> I thought as much
[14:16:31] <Vorrin> mh, yes, what I was trying :D
[14:17:00] *** Sliker has quit IRC
[14:17:02] <Vorrin> got a bit stuck, but I will try again... there's even the code for that ComboBoxRenderer (as it's a class he just created) and still, I struggle to see where ever it actually specifies something as such
[14:17:07] *** Sliker has joined ##java
[14:17:29] <Vorrin> anyway, will go and read more about custom renderers, thank you
[14:17:57] <fr0ggler> Vorrin, you're replacing the default combobox renderer with one that you create
[14:18:15] <fr0ggler> that will more than likely have different properties to the default, like the preferred size (see your own paste)
[14:18:22] <fr0ggler> (or link even)
[14:18:25] <bulltwang> how easy is it to spoof an email adress from my bank??
[14:18:28] *** cool123 has quit IRC
[14:18:42] <fr0ggler> bulltwang, how is this Java?
[14:18:50] *** r0bby has quit IRC
[14:19:04] <dreamreal> and how is it appropriate for ##java even if it is
[14:19:14] <dreamreal> for that matter, go away, douchenozzle
[14:19:14] <bulltwang> yeah you're right...
[14:19:15] <bulltwang> sorry
[14:19:20] <fr0ggler> bulltwang, by the way, I'm actually from your bank. we need to look at your account because something's happened to it. I need your account number, sort code and user/pass combination.
[14:19:33] <bulltwang> okay...
[14:19:37] <bulltwang> can I pm you??
[14:19:41] <fr0ggler> of course!
[14:19:42] <bulltwang> :D
[14:19:42] <bulltwang> :D
[14:19:56] <dreamreal> nah, just put it on channel
[14:19:56] *** evaluate has left ##java
[14:20:02] <dreamreal> nobody will keep track of that stuff
[14:20:14] <fr0ggler> and it's not recorded anywhere at all.
[14:20:28] *** csaba has joined ##java
[14:20:43] *** cool123 has joined ##java
[14:21:10] <csaba> if I want to have 2 objects locked, then can I do this? synchronized (obj1) { synchronized (obj2) { ... do stuff ... } }
[14:22:26] <dreamreal> sure. just make sure you NEVER EVER sync on obj2 before obj1 :)
[14:22:57] *** caverdude has quit IRC
[14:23:37] *** djbpython has joined ##java
[14:23:39] *** xelister has quit IRC
[14:23:59] <csaba> hmm I cannot guarantee that... maybe then it's not such a good idea :/
[14:24:31] <csaba> what happens if I synchronize the whole method, would that work? I actually want to clear both lists, and populate them again... and in the meantime, no one may interfere
[14:26:16] *** coalado1 has joined ##java
[14:26:32] *** coalado has quit IRC
[14:26:34] <deus_> csaba: why not use a lock on an immutable object?
[14:26:46] <deus_> csaba: and release the lock one you are done editing the lists
[14:27:16] <csaba> while I'm editing the lists, some other threads may access the list and read from them
[14:27:26] <csaba> access the lists from some other method
[14:27:39] <csaba> what if I set the list to be volatile?
[14:27:40] * dreamreal eyes Collections.synchronizedList()
[14:27:57] <csaba> thanks I'll look into that
[14:28:13] *** cool123 has quit IRC
[14:28:23] *** jjido has joined ##java
[14:28:53] <csaba> cool maybe this is what i need
[14:28:55] *** stimpie has joined ##java
[14:28:58] *** PhoenixSTF has joined ##java
[14:29:52] *** glcrazy has joined ##java
[14:30:20] <mapreduce> dreamreal: Perhaps something like ESR's 'how to ask questions' but aimed at solving problems.
[14:31:47] *** djbpython has quit IRC
[14:33:11] *** Johannes13 has joined ##java
[14:35:55] *** topriddy has quit IRC
[14:36:59] *** jjido has quit IRC
[14:37:18] *** topriddy has joined ##java
[14:40:19] *** ces200 has joined ##java
[14:42:08] *** jdolan has quit IRC
[14:43:58] *** jjido has joined ##java
[14:45:27] <bulltwang> we are busy writing an application for a client, and unfortunately we need to create a lot of reports.... currently JasperReports is something we are considering, as it does what we need, but its too time consuming...
[14:45:33] <bulltwang> any other suggestions?
[14:46:06] *** suiside has joined ##java
[14:46:15] <deadbeef> bulltwang: same here, i'm going to tell you how we solved
[14:46:16] <deadbeef> 3 secs
[14:46:19] *** jjido has quit IRC
[14:46:50] *** devkhadka has joined ##java
[14:47:16] <deadbeef> bulltwang: http://dynamicjasper.com/
[14:47:33] <bulltwang> deadbeef: thanks, I'll check it out...
[14:47:48] <deadbeef> it's supereasy, i did all the reporting in like a night
[14:50:23] *** L-----D has quit IRC
[14:50:58] *** jjido has joined ##java
[14:53:40] *** tissue has quit IRC
[14:53:53] <bulltwang> deadbeef: thanks, it look like its a lot easier; no more jrxml from a quick squint?
[14:54:46] <deadbeef> you can avoid it
[14:55:08] <reisi> in the context of Iterator interface, is there any possible difference between Iterator<E> and Iterator<? extends E>?
[14:57:39] *** paissad is now known as lol
[14:58:00] <paulweb515> reisi: isn't the implication you can pass in an Iterator<ExtendedE> to a method that takes Iterator<? extends E> ?
[14:58:09] *** lol is now known as Guest14361
[14:58:57] <reisi> paulweb515: hmm of course, thanks; i was only thinking the difference in use; as in #next() will return E in either case
[15:00:57] *** cool123 has joined ##java
[15:02:03] <mapreduce> Iterator is an interface that is naturally covariant, but Java only has use-site covariance and contravariance.
[15:02:25] *** epalm has joined ##java
[15:02:38] <Vorrin> fr0ggler: I managed (the combobox), though I haven't fully understood the whole customrenderer behaviour, I know more about it now, cheers :)
[15:02:43] *** Guest14361 is now known as paissad
[15:02:47] <mapreduce> In other words, if Iterator<String> were assignable to a variable of Iterator<Object>, which would be fine, then List<String> would be assignable to a variable of List<Object>, which is not fine.
[15:05:08] *** shervin_a has quit IRC
[15:06:38] *** cool123 has quit IRC
[15:09:18] *** cool123 has joined ##java
[15:11:37] *** djbpython has joined ##java
[15:12:59] *** BeholdMyGlory has joined ##java
[15:14:05] *** kieran491 has joined ##java
[15:15:38] *** mastroDani has joined ##java
[15:17:45] *** yxz97 has joined ##java
[15:18:25] *** yxz97 has left ##java
[15:18:26] *** BSWolf has quit IRC
[15:19:02] *** l2trace99 has joined ##java
[15:20:08] *** pen has joined ##java
[15:23:12] *** cool123 has quit IRC
[15:23:24] *** saml has joined ##java
[15:24:01] *** aLeSD has joined ##java
[15:24:09] <aLeSD> hi
[15:24:47] <aLeSD> I created a List of object and I want to use Collection.max function.
[15:24:56] *** gtrak has joined ##java
[15:25:18] <dreamreal> heh
[15:25:20] <aLeSD> I implemented in myObject a public static class MyComparator
[15:25:28] <aLeSD> everything wirks
[15:25:33] *** c_axis has joined ##java
[15:25:34] <dreamreal> cool!
[15:25:39] * dreamreal moves on
[15:25:41] <aLeSD> but I don't know if it's the most elegant way
[15:25:50] <aLeSD> Collections.max(list, new SensorPoint.MaxValueComparator());
[15:25:51] *** sphenxes has joined ##java
[15:26:00] *** magentar has quit IRC
[15:26:02] <aLeSD> is it the right way ?
[15:26:26] <aLeSD> better ... : is it the most elegant way to use comparators ?
[15:26:51] *** bitshuffler_ has quit IRC
[15:26:58] <aLeSD> dreamreal hi amn
[15:27:00] <aLeSD> man
[15:28:51] *** jesmon has joined ##java
[15:30:08] *** kieran491 has left ##java
[15:31:23] *** matsebc has joined ##java
[15:32:10] *** nmx- has joined ##java
[15:33:24] <nmx-> hi.... this is a spring question but their channel is quiet so i figured i would try here too. i'm declaring a pointcut and an advice using that pointcut, using aspectj style annotations, and i'm pretty sure the pointcut expression is correct, but my advice never gets called. any way to trace/debug this?
[15:33:28] *** mg983 has joined ##java
[15:33:35] <mg983> good day all!
[15:33:44] <mapreduce> aLeSD: Looks reasonable to me.
[15:34:08] <mg983> if I wanted to import a library from say paypal... i use import paypal.xxx how does java know to reference paypal ?
[15:34:18] <freeone3000> ~classpath
[15:34:18] <javabot> The classpath tells Java or the compiler in which jar files and folders to look for classes and resources. Use the -cp/-classpath run-time options to specify the classpath (does NOT work with -jar!). Also see http://is.gd/j4gM [sun.com] for more info. If you're on windows see: http://is.gd/9qq26 [sun.com].
[15:34:20] <dreamreal> mg983: classpath.
[15:34:33] <cheeser> ~~ mg983 get started
[15:34:33] <javabot> mg983, getstarted is http://download.oracle.com/javase/tutorial/getStarted/
[15:34:37] *** BSWolf has joined ##java
[15:34:41] <mg983> gracias
[15:35:47] *** VJTachyon has quit IRC
[15:36:14] *** jdolan has joined ##java
[15:36:18] *** VJTachyon has joined ##java
[15:36:50] *** durre has quit IRC
[15:37:30] <DroidAgent> JsonPath <3
[15:37:39] *** mxweas has quit IRC
[15:39:17] *** jjido has quit IRC
[15:39:18] <topriddy> at work everybody but me thinks i should start heavy use of code generation tools. they want me to draw umls and stuff then get andromda to do its job.
[15:39:37] <dreamreal> hahaha
[15:39:57] <cheeser> dreamreal agrees.
[15:40:09] <aLeSD> mapreduce: ok .tx
[15:40:09] <dreamreal> you should do it. But before you do, write up an email that warns that while this approach has been recommended by Forrester, in practice it's an albatross that small children can do better than.
[15:40:44] <cheeser> code generation++
[15:40:49] <topriddy> am hoping completing a custom made velocity template and java dao+daoimpl generator for juice would save me
[15:40:56] <topriddy> guice*
[15:40:59] <cheeser> i'm actually a big fan but you have to be careful with it
[15:41:39] <topriddy> our current version of Magic Draw doesnt seem to support simple things like enum, embeddable (not sure of this)
[15:42:08] *** mastroWork has joined ##java
[15:43:35] *** eidolon has joined ##java
[15:45:35] *** mastroDani has quit IRC
[15:46:25] *** jjido has joined ##java
[15:47:29] *** pen has quit IRC
[15:48:31] <aLeSD> I have a feature1Class and feature2Class ... both extends Class
[15:49:11] <dreamreal> Class is final
[15:49:22] <aLeSD> no
[15:49:34] <nmx-> yes
[15:49:36] <aLeSD> I want another class Feature2Feature1 Class
[15:49:38] <dreamreal> it is, indeed
[15:50:02] <aLeSD> Do I have to copy the code in a new class that inherit from Class
[15:50:05] <dreamreal> what you want is an interface.
[15:50:13] <aLeSD> or I can do something more elegant ?
[15:50:26] <freeone3000> aLeSD: You can use delegation instead of inheiritance.
[15:50:33] <dreamreal> and stop using Class; it has an actual meaning in Java. When you say "I extend Class", well, no, you don't. Class is final.
[15:50:55] <aLeSD> ah .. ok
[15:51:27] *** Luc1fel has joined ##java
[15:51:42] <aLeSD> ~delegation
[15:51:42] <javabot> aLeSD, what does that even *mean*?
[15:51:49] <aLeSD> mmm
[15:52:10] <freeone3000> public int foo() { return myFooProvider.foo(); }
[15:52:20] *** BSWolf has quit IRC
[15:52:59] <freeone3000> It's going to be a lot of code that IDEs are really good at generating.
[15:53:47] <aLeSD> dreamreal: and what do u mean with interface ?
[15:53:56] <aLeSD> I mean .. in which way
[15:54:08] <cheeser> ~~ aLeSD aolbonics
[15:54:08] <javabot> aLeSD, 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.
[15:54:14] <dreamreal> java has these things called interfaces. They specify what behavior is available via method signatures.
[15:54:45] <dreamreal> Java does not have multiple inheritance. But if F1 and F2 are these interface things, you can do C1 implements F1, F2.
[15:55:06] *** deadbeef has quit IRC
[15:55:09] <aLeSD> understood
[15:55:25] <freeone3000> So now you have a F1, F2, F1Impl, F2Impl, and a F1F2Impl which uses a F1Impl and a F2Impl. Simple.
[15:55:31] <aLeSD> dreamreal, I was searching a way to not duplicate the cose
[15:55:32] <aLeSD> code
[15:55:46] <dreamreal> See what freeone3000 said.
[15:55:47] <aLeSD> ah
[15:55:50] <aLeSD> ok
[15:55:53] <aLeSD> cool
[15:55:54] <dreamreal> Delegate to something that implements it.
[15:57:45] *** lostern has joined ##java
[15:57:54] *** lhnz has quit IRC
[15:58:10] <lostern> What debug interface should I be using in emacs?
[15:58:23] *** lhnz has joined ##java
[15:58:51] <mapreduce> You can probably use jdb from emacs, but you should take a look at IntelliJ IDEA.
[15:59:27] <lostern> mapreduce: Thanks, I want to stay inside emacs if possible
[15:59:30] *** jjido has quit IRC
[16:00:00] *** freeone3000 has quit IRC
[16:00:07] <dreamreal> heh
[16:00:07] *** Vorrin has quit IRC
[16:00:13] *** pantokrator has joined ##java
[16:00:15] <dreamreal> No need to run more than two OSes? :)
[16:00:27] <mapreduce> emacs' Grand Unified Debugger works with jdb, according to the googlewebs.
[16:00:28] <mitch0> lostern: pervert
[16:01:19] *** PelleTut has joined ##java
[16:02:35] *** cbrock has joined ##java
[16:03:06] *** mastro has joined ##java
[16:03:10] *** c_axis has quit IRC
[16:03:57] <jesmon> lostern: eclipse has some decent emacs keybindings. NetBeans and IDEA also have support, but I find eclipse's the best of the three
[16:04:14] *** DotHack has joined ##java
[16:04:15] *** jjido has joined ##java
[16:04:29] * jesmon uses emacs for everything *except* java
[16:05:05] *** BSWolf has joined ##java
[16:06:23] <mapreduce> This IRC client is within emacs. :)
[16:06:35] *** mastroWork has quit IRC
[16:07:40] <mapreduce> emacs isn't really about keybindings though.
[16:08:17] *** lisak has joined ##java
[16:09:19] *** cbeust has joined ##java
[16:10:05] *** DotHack has quit IRC
[16:10:18] * jesmon is waiting for mapreduce to expound on what emacs is really about
[16:10:27] <mitch0> bloat, obviously
[16:10:41] <lisak> could please anybody explain to me this ? http://imm.io/4cUW and http://imm.io/4cUY
[16:10:42] <tjsnell> Cocoa has emacs key bindings for that matter
[16:11:05] *** mastroWork has joined ##java
[16:11:16] <lisak> 3 pairs in entrySet a 2 in table ?
[16:11:18] <mapreduce> jesmon: Flexibility.
[16:11:26] <FauxFaux> lisak: Press the button at the top of the Variables view called "show non-shit version of containers".
[16:11:56] <lostern> emacs keybindings != emacs
[16:13:04] *** pen has joined ##java
[16:13:04] <jesmon> lostern: of course not. but if you're an emacs user, the keybindings are an extremely important part of it. If you jump into another tool, and lots of things map, it's a win
[16:13:08] <tjsnell> I'm not sure anyone made that claim
[16:13:18] *** jdolan has quit IRC
[16:13:41] <tjsnell> and here I though OSX was emacs all this time
[16:14:16] <dreamreal> ha! It's vim.
[16:14:19] *** mastro has quit IRC
[16:14:34] <tnzr> iVim
[16:14:39] <tnzr> (eww that sounds gross)
[16:15:59] <lisak> FauxFaux, do you know how parameter names starting with underscore are treated ?
[16:16:12] <lisak> by containers ?
[16:16:15] <aLeSD> I can't delegate it
[16:16:40] <lostern> jesmon: Yes, but it's not enough
[16:16:53] <aLeSD> both have callbacks
[16:16:53] <dreamreal> heh
[16:17:01] *** meling has quit IRC
[16:17:25] <lisak> because in portlet environment the part before the last underscore is treated as a namespace, I guess
[16:17:46] <lisak> and it looks like it isn't done by portlet container but the container itself
[16:17:52] <lisak> *servlet container
[16:18:10] *** Engin has quit IRC
[16:18:14] <coalado1> any idea how to split a command string like -> java -jar \"c:\....\" into it's single parameters ?
[16:18:14] <hyppias> what is a toString strategy ?
[16:18:55] <jesmon> lostern: not enough for what, to switch to an IDE? If you code java for anything even semi serious, you'll chose an actual IDE over emacs.
[16:19:53] *** pen has quit IRC
[16:21:01] <lostern> jesmon: Alright, thanks
[16:21:03] *** mastro has joined ##java
[16:21:07] *** lostern has left ##java
[16:21:19] *** daark has joined ##java
[16:21:39] <fr0ggler> hyppias, toString() should represent your object as a.... String.
[16:21:54] *** markand has joined ##java
[16:21:56] <cheeser> crazy talk
[16:21:58] <markand> hello
[16:21:59] *** Squarism has joined ##java
[16:22:01] <fr0ggler> hyppias, Object has a default implementation. if you don't like Object's toString(), override it.
[16:22:03] *** sbalmos has joined ##java
[16:22:16] <markand> is it possible to "pretend" a different os.name to the java VM ?
[16:22:22] <markand> minecraft works on linux but not on freebsd
[16:22:27] <fr0ggler> *sigh*
[16:22:28] <dreamreal> heh
[16:22:29] <cheeser> ~tech support
[16:22:29] <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.
[16:22:35] <dreamreal> ~minecraft
[16:22:35] <javabot> dreamreal, what does that even *mean*?
[16:22:42] <dreamreal> that's what I'm sayin'!
[16:22:43] *** Fisiu has quit IRC
[16:22:51] <markand> and the code use os.name to determine the operating sytem and there is no FreeBSD
[16:22:54] <Squarism> does anyone know how to use environment variables in java.lang.ProcessBuilder... i wanna do stuff like : new ProcessBuilder("echo", "$HOSTNAME").start
[16:23:01] *** VJTachyon has quit IRC
[16:23:19] <markand> so I would pretend my system to be Linux instead of FreeBSD
[16:23:19] <Squarism> ...they are not resolved as $HOSTNAME is a shell construct
[16:23:47] <dreamreal> System.getEnv()
[16:23:56] *** VJTachyon has joined ##java
[16:24:06] <dmlloyd> markand: just out of curiousity, what does os.name return?
[16:24:16] <fr0ggler> markand, the tech support factoid was for you.
[16:24:18] *** terranova has quit IRC
[16:24:34] *** mastroWork has quit IRC
[16:25:01] <markand> dmlloyd, on FreeBSD it should be FreeBSD i guess
[16:25:01] <dmlloyd> Squarism, process builder does not call into a shell.
[16:25:21] *** ces200 has quit IRC
[16:25:21] <dmlloyd> markand: I don't really care what it should be, I was curious what it actually is returning. If you don't know that's cool
[16:25:46] <Squarism> dmlloyd, ive understood that.. but i wanna find a way to read environment variables through it
[16:26:05] <dmlloyd> Squarism: why not just use System.getenv()?
[16:26:08] <fr0ggler> Squarism, dreamreal told you
[16:26:45] <mapreduce> Squarism: echo isn't really a program on any OS I've seen.
[16:27:04] <mapreduce> Er, scrap that.
[16:27:36] <mitch0> gah, was just about to paste :P
[16:27:37] <mapreduce> Anyway, $FOO won't be expanded by arbitrary programs, only by shells.
[16:27:55] *** matsebc has quit IRC
[16:28:44] *** jjido has quit IRC
[16:29:37] *** banpdtr_ has quit IRC
[16:31:09] *** jjido has joined ##java
[16:32:55] *** mazzachre has quit IRC
[16:33:17] *** tilerendering has joined ##java
[16:33:29] *** eitch0000 has quit IRC
[16:33:39] <bulltwang> Squarism: see if Runtime and Process works better for you...
[16:34:01] <bulltwang> you can execute commands from your app, to the shell that way
[16:34:28] *** gremmachook has joined ##java
[16:34:36] <Squarism> bulltwang, thanx.. but i think im forced to use ProcessBuilder
[16:34:39] *** zuxqoj has quit IRC
[16:34:40] <bulltwang> but if I remember correctly, you'll need to write some code to get the 'output' of the command you executed
[16:34:50] <bulltwang> why forces?
[16:34:56] <bulltwang> *forced
[16:35:18] *** l3dx has joined ##java
[16:36:06] *** bn` has joined ##java
[16:36:11] <lahwran> are there any possible settings in the JRE that might cause the same jar to use more ram idling on one system than on another?
[16:36:25] *** eidolon has quit IRC
[16:36:35] <lahwran> on my desktop computer, this server takes about 250mb of ram, but on my server box it takes nearly 600mb
[16:36:39] <lahwran> (with no load)
[16:36:44] <dreamreal> which JVM is each using
[16:36:49] *** yxz97 has joined ##java
[16:37:04] *** mastroWork has joined ##java
[16:37:06] <lahwran> both are sun, lemme get the versions
[16:37:47] <fr0ggler> bulltwang, ProcessBuilder is the preferred mechanism nowadays, and it still doesn't allow you to specify shell-specific shortcuts, like $HOSTNAME
[16:38:03] <lahwran> jre1.6.0_23 is the server, 1.6.0_22 is local
[16:38:11] <fr0ggler> bulltwang, sorry, I meant that Runtime and Process don't let you.
[16:38:18] <dreamreal> and the OS/architecture of each?
[16:38:27] <mitch0> lah: 64bit vs 32bit maybe?
[16:39:04] <bulltwang> oh, I just remember we had to use it for some commands we had to run from the shell, we didn't use env variables though...
[16:39:18] *** eyesUnclouded has quit IRC
[16:39:26] <lahwran> local is linux 2.6.35-22 (ubuntu), lemme check what the server is
[16:39:26] *** gremmachook has quit IRC
[16:39:28] <bulltwang> thats why I said Squarism can check it out...
[16:39:41] <lahwran> oh, maybe so, local is 32, it's fairly likely that the server is 64
[16:39:49] <bulltwang> interesting about the processbuilder.... would have made my life easier...
[16:39:50] <fr0ggler> bulltwang, it makes no difference to env variables.
[16:40:03] <fr0ggler> so suggesting it is pointless.
[16:40:31] <reisi> lahwran: i'm guessing it's just the "memory ergonomics" setting of java6 (openjdk|oracle) jvm's
[16:40:32] *** mastro has quit IRC
[16:40:53] <reisi> lahwran: more free ram on server -> acquire more heap
[16:41:21] <lahwran> is there a way to shut it off? I'm only allowed to use 1gb of ram
[16:41:54] <reisi> lahwran: man java, look under nonstandard options
[16:41:55] *** cdg has quit IRC
[16:42:03] *** ninja_sense has joined ##java
[16:42:46] *** RLa has joined ##java
[16:42:53] *** bindaas has quit IRC
[16:42:54] <Squarism> processbuilder lets you set env variables.. but i havent found ways to really check they are set easily
[16:42:59] *** cdg has joined ##java
[16:43:11] <lahwran> also, the memory use of java never goes down on the server .. I even set up a script to monitor it, there has not been a single decrease, I have to restart the process to free ram
[16:43:17] *** bindaas has joined ##java
[16:43:38] <cheeser> the JVM doesn't (typically) release RAM back tothe OS
[16:43:47] <cheeser> though java7, iirc, fixes that.
[16:43:56] <lahwran> oooh
[16:44:17] <fr0ggler> Squarism, did you actually try System.getEnv()? the way you build the process, again, is irrelevant
[16:44:19] <lahwran> so I want to install that to get it to manage ram better?
[16:44:32] <reisi> lahwran: like cheeser said; there might be a switch even for java6, aggressive heap or something like that (wasn't in man page last time i checked)
[16:44:34] <lahwran> or, I shouldn't say better, since by better I mean smaller
[16:44:35] <dreamreal> I'm really looking forward to java 7 being released. I hope it happens as planned. (I have doubts even though there's no evidence to back them up.)
[16:44:51] *** eyesUnclouded has joined ##java
[16:45:36] <RLa> in server env, why do you need to release memory back to os at all?
[16:45:42] <RLa> because of other apps?
[16:45:59] *** eyesUnclouded has quit IRC
[16:46:04] <lahwran> because it likes to go over 1024MB used, which will get my hosting terminated
[16:46:19] <lahwran> since that's all I'm paying for
[16:46:26] <Squarism> fr0ggler, i set the environment on the processbuilder.... so i guess the env is only set on that particular process. For this test im writing.. i would just like an easy way to pick up that the env variable is set for the spawned process.. preferably wo writing a complete java program.
[16:46:53] <reisi> lahwran: to be safe, i'd read the apps documentation or faq (see outofmemoryerror); and then try and see which are the right settings for you
[16:47:10] *** Prezioso has joined ##java
[16:48:39] <fr0ggler> Squarism, how are you "setting" the environment when using ProcessBuilder? application arguments != system env variables by the way.
[16:49:02] <Prezioso> Is it possible to make a for loop that creates varibles that you can out print in the main ?
[16:49:48] <hyppias> JAXB/toString question: http://pastebin.com/au04kr4t
[16:50:00] *** jjido has quit IRC
[16:50:00] <bulltwang> fr0ggler: I see what you said about it not resolving any environment variables, it also doesn't resolve anything else like you standard, ls etc... you have to provide the full path to the ProcessBuilder in order to execute it... therefore if you have it as environment var it will work
[16:50:05] <fr0ggler> Squarism, what you probably want to do is create your own "global" env space that is a copy of the current System.getenv() plus any extra variables, then pass that to your builders
[16:50:15] *** meling has joined ##java
[16:50:38] <fr0ggler> bulltwang, yes, I appreciate that, but that's not the question being asked
[16:50:44] *** jjido has joined ##java
[16:50:51] <fr0ggler> at least, not as I understand it
[16:51:56] <fr0ggler> Squarism, allowing Java access to an underlying OS environment space seems dodgy to me, which is probably why Java doesn't do it.
[16:52:19] <fr0ggler> s/access/write access/
[16:52:35] *** mastro has joined ##java
[16:53:00] <Squarism> fr0ggler, its a mess.. but in this project it is a must =D
[16:53:19] *** whaley has quit IRC
[16:53:30] *** bitshuffler has joined ##java
[16:53:36] <dmlloyd> why do I get the feeling, Squarism, that you either don't really know what you want, or you haven't actually told us what you're really trying to do
[16:53:45] *** wad has joined ##java
[16:54:26] <dreamreal> dmlloyd: let me guess: it's obvious?
[16:54:33] <mapreduce> This company never learns.
[16:54:55] <dmlloyd> dreamreal: that might be why, yeah
[16:55:02] <fr0ggler> Squarism, you can't set OS env variables. you can get them and add more, and pass those to your bits of code that spawn more processes, then your subprocesses will have access to the things you think you want it to.
[16:55:10] *** whaley has joined ##java
[16:55:10] * dreamreal climbs back from the limb he was on
[16:55:15] <mapreduce> After embarrassing a C. Lunt by giving her a clunt@.. email address, they've now taken on a C. Ryall for customer support.
[16:55:22] <fr0ggler> hahah
[16:55:43] <fr0ggler> please tell me she's married to Terry Wunt.
[16:55:51] <mapreduce> firstname.lastname at company dot com people, it's not hard.
[16:55:53] <dreamreal> Better than poor Beatrice Itch's email.
[16:56:01] *** mastroWork has quit IRC
[16:56:29] <gtrak> is it possible to access tomcat's configured keystore from within the application level?
[16:56:29] *** jdolan has joined ##java
[16:56:38] <dreamreal> mapreduce: yeah, mine annoys the crap out of me
[16:57:01] <Squarism> dmlloyd, I wanna do 1. pb = new ProcessBuilder(...some-epression-writing-someVar-to-stdout); pb.environment.put("someVar","someValue); p = pb.start..... from the "p" outputstream.. read someVar
[16:57:10] <dreamreal> but then again, my actual work address is far less annoying than the four hours it takes for an outgoing email to plod its way through microsoft's hosted exchange services
[16:57:23] <mapreduce> dreamreal: I can't think of any stupid way of arranging your name.
[16:57:43] <Squarism> ...pseudo code wise
[16:57:43] <dmlloyd> Squarism: but why are you trying to do that? it doesn't make any sense - if you just want to read from the environment there's an API for that
[16:58:12] <dreamreal> not stupid - but my work address is joe at $employer dot com
[16:58:27] <dreamreal> It's a good thing "joe" is such a rare name, eh?
[16:58:55] <dmlloyd> Squarism: it's especially silly because not only do you know your process' environment, but you have full control over the environment of any process you create, so the value you're going to get back is 100% predictable without actually having to spawn a process
[16:59:06] *** markand has left ##java
[16:59:11] <dmlloyd> Squarism: make sense?
[16:59:12] *** Engin has joined ##java
[16:59:17] *** Noya has quit IRC
[16:59:20] <dreamreal> dmlloyd: he COULD spawn a login shell that overrides the value somehow, though
[16:59:26] <sveajobb> ok, I find this a bit weird. I have the exact same jar-file on two differenct machines. one is connected directly to the net and one is behind a nat. The one behind a nat can connect to my java server, and the one connected directly connects properly but does not receive the OP_CONNECT . any suggestions?
[16:59:38] <Squarism> i wanna make a test to see it works only
[16:59:38] <dreamreal> then you'll feel silly
[16:59:49] *** dframe has quit IRC
[16:59:52] <dmlloyd> Squarism: you're very untrusting
[16:59:53] <Squarism> but.. then fakk testing.. just slows med down =D
[17:00:08] <cheeser> leaves you more time for typing.
[17:00:13] <dmlloyd> Squarism: usually if the API docs say a method does something in no uncertain terms, you can usually trust it
[17:00:27] <dmlloyd> crazy as that sounds :)
[17:00:42] *** BoF has joined ##java
[17:00:53] <Squarism> yeah.. i understand that.. =D
[17:01:03] <fr0ggler> i have my doubts.
[17:01:38] <fr0ggler> btw, Spring Integration is actually pretty handy. TCP server client set up in 5 minutes!
[17:01:58] *** flip28 has quit IRC
[17:02:17] <bulltwang> Yeah spring is actually quite awesome....
[17:02:44] *** Ch30ps has quit IRC
[17:03:50] <bulltwang> we use a whole bunch of spring frameworks, like quartz, integration, core, batch.... and the only thing that I hate is that the dev's just through everything into one context file, and then later tried to split it, but never finished....
[17:04:00] *** dogmeat has joined ##java
[17:04:16] <sbalmos> EE 6 is nice
[17:05:11] *** ninja_sense has quit IRC
[17:05:29] <selckin> is it a security problem if you allow Class.forName() from user input? i can't think of anything bad that could happen
[17:05:33] *** deSilva has joined ##java
[17:05:43] <tjsnell> quartz isn't a spring framework
[17:06:58] <dreamreal> maybe he means they just use the spring quartz integration, without quartz itself.
[17:07:29] *** jjido has quit IRC
[17:08:39] <sbalmos> that'd be... gypsum? :)
[17:08:42] *** jds has joined ##java
[17:08:54] <dreamreal> :)
[17:09:12] <dreamreal> pyrite!
[17:09:23] *** Frostix has joined ##java
[17:10:01] *** aLeSD has quit IRC
[17:11:06] *** mastroWork has joined ##java
[17:12:30] *** Dunst has joined ##java
[17:12:30] <Dunst> May someone explain what I could use sax handling for
[17:12:30] *** matsebc has joined ##java
[17:12:35] <cheeser> parsing xml
[17:12:44] <Dunst> I understand that i can define new elements but what else
[17:12:54] <Dunst> mhm
[17:13:15] <dreamreal> or taking care of a saxophone... *hides*
[17:13:17] <Dunst> cheeser what usage can I take of it when defining my own handler then?
[17:13:36] *** svm_invictvs is now known as slerp_lerp
[17:14:09] *** barq has joined ##java
[17:14:24] <sveajobb> Ok, can someone please explain to me how this can be happening? I have a socketChannel.register(selector, SelectionKey.OP_CONNECT); later on I receive selector.selectedKeys(); and I get my key. however ALL is**** functions return false unless isValid() which returns true... why would my selected key report as "something happened" when nothing happened? I am expecting key.isConnectable() to be true
[17:14:35] <sveajobb> and it works on another computer...
[17:14:40] *** jjido has joined ##java
[17:14:48] *** mastro has quit IRC
[17:14:55] *** deSilva has quit IRC
[17:16:19] *** Engin has quit IRC
[17:18:54] *** csaba has quit IRC
[17:21:24] *** titankiller has joined ##java
[17:21:34] *** fr0ggler has quit IRC
[17:23:53] *** jackwang5 has joined ##java
[17:26:15] *** BoF has quit IRC
[17:26:24] <sveajobb> ok.. if my server is down (cannot connect) isReadable() && isWriteable() == true, if it's up nothing is true.. am I missing something here?
[17:28:02] *** barq has quit IRC
[17:28:30] *** blahspam has joined ##java
[17:29:04] <Dunst> cheeser gave up?
[17:29:13] <cheeser> on?
[17:29:24] <Dunst> explaining me sax handler
[17:29:25] <cheeser> oh the sax question? nah. i was busy with work.
[17:29:30] *** magentar has joined ##java
[17:29:31] <Dunst> ah okay :)
[17:29:38] <cheeser> if you want to understand sax handlers, read the docs.
[17:29:47] <Dunst> okay
[17:29:52] <Dunst> thanks tho
[17:31:34] *** jjido has quit IRC
[17:32:57] *** deus_ has quit IRC
[17:34:34] *** mastro has joined ##java
[17:36:13] *** Bombstone has joined ##java
[17:36:19] *** km has joined ##java
[17:37:46] *** km has quit IRC
[17:38:08] *** mastroWork has quit IRC
[17:38:27] *** km has joined ##java
[17:39:08] *** adimit has quit IRC
[17:39:42] *** _Jorde has quit IRC
[17:41:37] *** matsebc has quit IRC
[17:46:21] *** daark has quit IRC
[17:46:46] *** eichi has joined ##java
[17:47:04] <eichi> hello, can someone tell me in one sentence or a link, what "J2EE Portalserver" is?
[17:47:39] <dreamreal> it sounds like a product that implements jsr 168
[17:47:41] <dreamreal> ~jsr 168
[17:47:43] <javabot> 'JSR 168: Portlet Specification' can be found at http://www.jcp.org/en/jsr/detail?id=168
[17:48:33] *** zatan has joined ##java
[17:49:00] *** msieradzki has quit IRC
[17:49:56] <RLa> one offtopic question, how you guys manage documentation for tools and libraries you use?
[17:50:05] <RLa> or you just google?
[17:50:24] *** cbeust has quit IRC
[17:50:32] <selckin> google > bookmarks
[17:50:32] *** deadbeef has joined ##java
[17:51:33] *** lesce has quit IRC
[17:52:47] <FauxFaux> RLa: Javadocs? Part of the IDE.
[17:53:00] *** X-Scale has joined ##java
[17:53:54] *** chomping has quit IRC
[17:54:08] *** mastroWork has joined ##java
[17:54:31] <RLa> hm, in ide you seem to have jre apidocs only if jre source is installed
[17:55:37] *** magentar has quit IRC
[17:55:50] <selckin> sources should always be installed
[17:56:57] *** Nikelandjelo has joined ##java
[17:56:59] *** matsebc has joined ##java
[17:57:28] *** mastro has quit IRC
[17:58:00] <RLa> hm, not on my computer
[17:59:12] *** mastroWork has quit IRC
[17:59:38] *** Luc1fel has quit IRC
[18:01:29] *** pipeep has quit IRC
[18:01:44] <mapreduce> It's probably one of those mac things then.
[18:02:09] <mapreduce> Or a silly Linux one where the JDK gets split across 8 packages that nobody can find.
[18:02:16] *** ExtraSpice has quit IRC
[18:02:19] <RLa> no, no mac, it's ubuntu
[18:02:20] *** cythrawll has joined ##java
[18:02:54] *** mg983 has quit IRC
[18:03:04] <RLa> there should be sources.jar somewhere in JAVA_HOME?
[18:03:21] <selckin> src.zip
[18:03:43] <dreamreal> RLa: /usr/lib/jvm/java-6-sun-
[18:03:59] <RLa> find /usr/lib/jvm/java-6-sun | grep src
[18:04:07] <RLa> finds nothing
[18:04:12] <dreamreal> RLa: or: "locate src.zip"
[18:04:25] *** jdolan has quit IRC
[18:04:26] <selckin> unless you have the dir with the version it wouldn't
[18:04:27] <dreamreal> RLa: which JDK package did you install?
[18:04:44] <RLa> it must have been sun's
[18:04:46] <RLa> wait
[18:05:22] <RLa> sun-java6-jdk
[18:05:23] * sbalmos waits for the obligatory openjdk realization
[18:05:36] <RLa> so it's official sun's jdk
[18:05:46] <RLa> no openjdk here :)
[18:05:54] *** km has quit IRC
[18:06:57] <dmlloyd> I still maintain that it makes the most sense to install JVMs in your home directory
[18:07:06] * dmlloyd uses shell functions to switch among them
[18:07:08] *** yxz97 has left ##java
[18:07:25] <dmlloyd> then when you reinstall, just port your home dir over and you still have all your old versions
[18:07:54] *** mah01 has quit IRC
[18:08:14] <selckin> but it doesn't auto update
[18:08:23] <RLa> yeah, probably install my own version
[18:08:50] <selckin> s/install/unpack/
[18:08:53] <RLa> i have done that on systems that have no suitable package
[18:09:02] <RLa> or no package management at all
[18:10:03] <RLa> hoped that ubuntu won't screw up this thing
[18:10:31] <selckin> it's there or a have a -source package
[18:10:31] *** stimpie has quit IRC
[18:11:26] <RLa> nice, found it
[18:12:37] *** dmiles_afk has quit IRC
[18:13:00] *** eichi has left ##java
[18:13:14] *** km has joined ##java
[18:14:06] *** bitshuffler has quit IRC
[18:14:17] *** topriddy has quit IRC
[18:17:01] *** pantokrator has quit IRC
[18:21:09] *** gkmngrgn has quit IRC
[18:21:18] <mapreduce> selckin: Java versions so rarely matter that you don't need to update.
[18:21:19] *** terranova has joined ##java
[18:21:30] <mapreduce> automatically at least
[18:21:32] <RLa> ctrl+t now also shows source of jre classes
[18:21:33] *** jham has joined ##java
[18:22:03] <RLa> mapreduce, important security updates
[18:22:17] *** rtdos has quit IRC
[18:23:22] <RLa> and there have been quite bad issues, the last such bug was that double conversion problem
[18:23:47] *** daark has joined ##java
[18:23:48] <jham> hi. how can i make sure, that if the execution of my java application is stopped in some not natural way (eg. terminate button clicked in eclipse) my application would clean up before exiting (like closing some connections, etc).
[18:23:51] *** Unluckful has joined ##java
[18:24:08] <jham> is there an exception for that?
[18:24:11] *** aaron11 has joined ##java
[18:24:39] <dreamreal> vmware bought wavemaker
[18:25:28] <aaron11> Hey does anybody know why this isnt checking colision? I tell java that if the object intersects the other print out colision detected. JavaLearn2: http://pastebin.mozilla.org/1138506 JavaLearn3: http://pastebin.mozilla.org/1138503 http://pastebin.mozilla.org/1138505
[18:25:39] <mapreduce> RLa: If you're a Java developer you probably keep abreast of those anyway.
[18:25:52] <mapreduce> RLa: But sure, you're right.
[18:26:19] <mapreduce> How long after a critical update is released by Oracle does it appear in Ubuntu?
[18:26:23] <mapreduce> (for Java, that is)
[18:26:35] <Unluckful> Hey, does anyone know a way I can use a scanner to take a integer, but store it as a string, without truncating any numbers in the instance of things such as, "0001"?. When I try scanner.nextLine() it skips the line because it recongized a int, not a String. but doing something like Integer.toString(scanner.nextInt()); truncates the leading 0's
[18:27:04] <mapreduce> nextLine doesn't skip lines.
[18:27:09] *** sysRPL has joined ##java
[18:27:11] <sysRPL> hello
[18:27:12] <sysRPL> can anyone recommened an escrow service programmers? i.e. an account where i can get my client to depost funds in adnvance?
[18:27:17] <RLa> i usually start apt-get upgrade manually anyway
[18:27:25] <mapreduce> RLa: heh
[18:27:51] <Unluckful> Nevermind, I got it just now - I need to read docs better ;/
[18:27:54] <cheeser> sysRPL: do you have a java question?
[18:28:21] *** Frogprince has quit IRC
[18:28:23] <mapreduce> sysRPL: You can pay into my bank account. I'm leaving the country on Monday, so your money is perfectly safe.
[18:28:32] <RLa> also, that double conversion thing was something i would worry about, other bugs/improvements have never been so significant, at least for me
[18:29:09] <RLa> sysRPL, are you not trusting your client?
[18:29:42] <RLa> maybe it's time to reconsider working for them :)
[18:29:59] <cheeser> ~interesting
[18:29:59] <javabot> this is all very interesting (not really) but please take it somewhere else.
[18:30:06] *** queequeg1 has joined ##java
[18:30:59] *** foocraft has quit IRC
[18:31:36] <aaron11> Hey does anybody know why this isnt checking colision? I tell java that if the object intersects the other print out "colision detected" . JavaLearn2: http://pastebin.mozilla.org/1138506 JavaLearn3: http://pastebin.mozilla.org/1138503 http://pastebin.mozilla.org/1138505
[18:32:19] <cheeser> ~~ aaron11 repeating
[18:32:19] <javabot> aaron11, Please don't repeat yourself, it annoys people and rarely produces results. Try rephrasing or, failing that, come back in a good while when there are different people here. Meanwhile, google is your friend.
[18:32:52] *** cbrock has quit IRC
[18:33:01] <aaron11> hmmm... that atleast proves people are listening. :)
[18:33:16] *** fr0gprince_ has joined ##java
[18:33:41] <dmlloyd> with 300+ people that's a fair bet
[18:34:04] <Sou|cutter> I wasn't listening
[18:34:07] <cheeser> but also know that you're annoying people and we'd like you stop. *that's* the point.
[18:34:15] <cheeser> Sou|cutter: hell must pay!
[18:36:44] <mapreduce> What's hell then, some kind of escrow service?
[18:36:44] *** Kamaran has joined ##java
[18:37:35] *** MichealH has quit IRC
[18:38:49] *** sebersole has quit IRC
[18:38:59] *** cbeust has joined ##java
[18:39:38] <hyppias> JAXB/toString question: http://pastebin.com/au04kr4t
[18:39:46] *** cbrock has joined ##java
[18:39:58] *** bolt has quit IRC
[18:40:15] *** r0bby has joined ##java
[18:40:17] *** Ero has joined ##java
[18:40:26] *** r0bby is now known as robbyoconnor
[18:41:01] *** barq has joined ##java
[18:42:31] *** MichealH has joined ##java
[18:44:01] *** Varox has joined ##java
[18:44:04] *** sebersole has joined ##java
[18:44:30] <aaron11> Anybody willing to help
[18:44:48] <mapreduce> "ffff" to new byte[]{0xff, 0xff}, "abcd" to new byte[]{0xab, 0xcd} - quick, how do I do that without bashing my head against a wall?
[18:45:52] <aaron11> :-/
[18:46:22] <FauxFaux> mapreduce: Integer.valueOf(16, ...) << 8,
[18:46:24] *** Unluckful has quit IRC
[18:46:29] *** deadaim has quit IRC
[18:46:34] <dmlloyd> b = new byte[2]; b[0] = (byte) Integer.parseInt(s.substring(0,2), 16); b[1] = (byte) Integer.parseInt(s.substring(2,4), 16);
[18:46:39] <mapreduce> Oh, I can probably do that in one recursive line then.
[18:46:54] <mapreduce> dmlloyd: For varying lengths.
[18:47:01] <dmlloyd> sadly there's no public void getBytes(int src, byte[] dst)
[18:47:10] <dmlloyd> oh for strings, then just use a for loop
[18:47:13] <dmlloyd> as long as the length is even
[18:47:13] <mapreduce> Aye.
[18:47:23] <hyppias> can an interface be an argument to a method ?
[18:47:30] <mapreduce> hyppias: Yes.
[18:47:42] <hyppias> what is passed then ?
[18:47:48] <mapreduce> A reference.
[18:48:14] <hyppias> to an object of a class implementing that interface ?
[18:48:18] <dreamreal> heh
[18:49:16] <mapreduce> Yes, or the reference may be null.
[18:49:24] <aaron11> I dont see why this shouldent detect colision: JavaLearn2: http://pastebin.mozilla.org/1138506 JavaLearn3: http://pastebin.mozilla.org/1138503 Enemy: http://pastebin.mozilla.org/1138505
[18:49:30] *** ech0s7 has joined ##java
[18:49:31] <mapreduce> aaron11: Neither do I.
[18:49:32] <ech0s7> hi
[18:49:47] <aaron11> I mapreduce You read it that fast?
[18:50:08] <mapreduce> No, I dismissed it that fast.
[18:50:48] <aaron11> mapreduce, Why?
[18:50:54] <aaron11> o.0
[18:51:09] <sbalmos> how about actually asking a question rather than pointing us to a bunch of links?
[18:51:12] <ech0s7> i have read that it's possible to do ovveride of static methods, but i'm trying and i get error compiling: http://www.ideone.com/Erogi
[18:51:36] <ech0s7> (from java 1.6)
[18:51:37] <mapreduce> Because anyone who needs three pastebins clearly hasn't bothered to minimise their code to make the problem show its head.
[18:51:41] *** Elvanor has quit IRC
[18:51:53] <mapreduce> ech0s7: It's not possible, you can only shadow them.
[18:52:06] *** jgomo3 has joined ##java
[18:52:13] <deadbeef> happy woman's day
[18:52:27] <mapreduce> Why is she happy?
[18:52:42] <deadbeef> because she got to make a sandwich
[18:53:09] <dreamreal> haha
[18:53:16] <sbalmos> O_O
[18:53:32] *** srji has joined ##java
[18:53:35] <dreamreal> sbalmos: i meant to tell you happy women's day, too, btw
[18:53:55] *** jgomo3 has left ##java
[18:53:57] <tnzr> aaron11: have you tested the Rectangle.intersects() method to make sure it works like you think it does?
[18:54:06] *** jgomo3 has joined ##java
[18:54:22] *** whaley has quit IRC
[18:54:37] <sbalmos> dreamreal: Whatever woman I eventually find, I will tell her such in the future. Until then, I'll queue your request.
[18:54:38] <sbalmos> :)
[18:54:38] *** Vorrin has joined ##java
[18:54:40] *** bojo has quit IRC
[18:54:50] <aaron11> tnzr, Im started another project to see.
[18:54:54] <jgomo3> after a mvn compile, i receive: "annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations)" how do i enable -source 5 in maven?
[18:55:17] <dreamreal> jgomo3: maven-compiler-plugin
[18:55:40] <RLa> oh, maven still uses 1.3 source/target version?
[18:55:41] <sbalmos> didn't mvn3 update that default?
[18:55:49] <tnzr> also its probably redundant to check rect1.intersects(rect2) and rect2.intersects(rect1)
[18:56:17] <jgomo3> My maven version: Apache Maven 2.2.1 (rdebian-1)
[18:56:24] <jgomo3> dreamreal: thank you
[18:56:33] <RLa> why not to upgrade to maven 3?
[18:57:16] *** robbyoconnor has quit IRC
[18:57:22] <tnzr> aaron11: also just do: this.onColide(enemy.bound().intersects(JL2.bound())); if you want to reduce that method to one line :)
[18:57:29] <jgomo3> i'm using my distro package. Didn't know about maven 3. I don't use it a lot
[18:57:39] *** bojo has joined ##java
[18:58:16] <jgomo3> RLa: it seems i'll have to upgrade, wich mean uninstall my distro package and then install manually maven 3
[18:58:59] <jgomo3> RLa: i'll see if i can live with maven 2.
[18:59:05] <aaron11> tnzr, Thanks
[18:59:56] *** jdolan has joined ##java
[19:00:39] <tjsnell> your package manager doesn't have maven3?
[19:00:41] *** ech0s7 has quit IRC
[19:00:57] *** freeone3000 has joined ##java
[19:01:17] <RLa> jgomo3, if it's new project then certanly start with new maven
[19:03:05] *** GibbaTheHutt has quit IRC
[19:04:53] <freeone3000> When profiling memory, what's the best tool to figure out what particular data structure is using the most?
[19:05:14] <selckin> jprofiler
[19:05:16] <freeone3000> JVisualVM gives me a graph of methods by time. I'd like to see a memory graph like that.
[19:05:21] <freeone3000> JProfiler it is.
[19:06:14] <KarlThePagan1> eclipse TPTP is also viable IMO
[19:06:51] *** McMAGIC-- has joined ##java
[19:06:52] *** pgib has joined ##java
[19:07:02] <KarlThePagan1> but if you mean an individual data structure freeone3000 you can make some unit tests and figure it out from empirical evidence
[19:07:25] <freeone3000> Yeah, no I can't. It gets a little complex for that.
[19:07:39] <KarlThePagan1> lots of heterogenous structures eh
[19:07:40] *** Bombstone has quit IRC
[19:07:45] <freeone3000> I know it's probably the single data structure, the Map<List<Pair>,List<Map<Point, Correlation>>.
[19:08:07] *** drindt has joined ##java
[19:08:29] <pgib> hello. I have a webapp and I am adding a RESTful API for a client. We are using JAX-RS (Jersey on GF to be exact). However, most resources need to be protected by some form of authentication. REST is sessionless, so JSESSION stuff seems to be irrelevant
[19:08:49] <freeone3000> pgib: HTTP Auth may be useful here.
[19:08:52] <pgib> We are using JAAS (with our own LoginModule), so being able to leverage JAAS would be a plus.
[19:09:05] <KarlThePagan1> freeone3000: if you're hard up for memory consider packing Point into a primitive and using fastutil Long2ObjectMap
[19:09:25] *** Dunst has quit IRC
[19:09:27] *** teralaser has joined ##java
[19:09:48] *** sorabji52 has joined ##java
[19:10:23] <KarlThePagan1> and make sure you've got equals properly overridden on the List<Pair>
[19:10:27] <freeone3000> Hmm. Interesting. I'm not sure how passing around a Long would be better than passing around a Point - I only have so many points, and since I'm only copying *references*...
[19:10:29] <KarlThePagan1> equals AND hashCode
[19:10:30] *** aLeSD has joined ##java
[19:10:38] <KarlThePagan1> freeone3000: a "long" not a "Long"
[19:10:51] *** aLeSD has quit IRC
[19:10:59] <freeone3000> KarlThePagan1: Yeah. Even on a 64-bit machine, that's the same size.
[19:11:18] <freeone3000> And I think that I have few enough objects I can use the 32-bit pointer.
[19:11:25] <KarlThePagan1> freeone3000: just an option ;)
[19:11:33] <KarlThePagan1> it varies by case
[19:11:34] *** bduncan has joined ##java
[19:11:42] <KarlThePagan1> also if you're in 64-bit compressed oops
[19:13:03] *** Sliker has quit IRC
[19:13:08] <hyppias> are interfaces objects?
[19:13:31] <freeone3000> hyppias: Interfaces are types, like classes are types. You can't create an instance of an interface.
[19:14:34] <hyppias> then how can you have a reference to an nterface, as passed as an argument to a method ?
[19:14:40] <dreamreal> haha
[19:14:41] <freeone3000> hyppias: Because it's a type.
[19:15:04] <dreamreal> you create a concrete instance, then you pass around a reference to that instance. The instance is of a concrete type which can implement one or many interfaces.
[19:15:35] *** Sliker has joined ##java
[19:15:41] *** Varox has quit IRC
[19:16:14] *** daark has quit IRC
[19:16:34] <hyppias> dreamreal: yes, so the argument is a ref to a concrete thing, not an interface ...
[19:16:56] <dreamreal> yet the argument reference TYPE can still be an interface.
[19:17:06] *** BSWolf has quit IRC
[19:17:07] <hyppias> yes.ok
[19:17:08] <dreamreal> and within scope, the compiler restricts the type's definition to the interface.
[19:18:05] <dreamreal> so regardless of the actual underlying concrete type, it looks like that interface and ONLY that interface.
[19:18:22] <hyppias> I have here a method like a(...... , ToStringStrategy s). ToStringStrategy being an interface
[19:18:29] <dreamreal> sure
[19:18:43] *** new2net has joined ##java
[19:18:49] <hyppias> so what is s then ...
[19:19:05] <dreamreal> something that implements ToStringStrategy.
[19:19:05] *** tilerendering has quit IRC
[19:19:10] <hyppias> an object with that interface
[19:19:12] <jesmon> hyppias: it is an object implementing the interface
[19:19:19] <hyppias> ok
[19:19:44] *** sorabji52 has quit IRC
[19:20:23] <hyppias> IN the method then, only the interface methods are accessible ?
[19:20:47] *** aminpy has joined ##java
[19:20:53] <dreamreal> unless you cast it out of that type, yes.
[19:20:57] <hyppias> ok
[19:21:07] *** titankiller has quit IRC
[19:21:07] *** Squarism has quit IRC
[19:21:43] *** pyrony has joined ##java
[19:22:18] *** epalm has quit IRC
[19:26:15] *** yoshx has joined ##java
[19:26:19] <new2net> whats the difference between <T> T and <E> E ... I have to reask, because I don't believe it's "nothing"
[19:26:37] <sbalmos> A name?
[19:27:08] <Sou|cutter> why don't you believe it's nothing
[19:27:41] *** dcope- has joined ##java
[19:27:46] *** h6w has joined ##java
[19:27:53] <dcope-> If I have a string as 12:56 how can I parse the last two numbers?
[19:27:55] <new2net> well... it doesn't seem very java like to have them be identical
[19:28:01] <Sou|cutter> thing of <E> as a variable declaration, except it's declaring a type
[19:28:03] <dcope-> String minuteString = userInput.substring(userInput.indexOf(":") + 1, userInput.length() - userInput.indexOf(":")); never returns the correct value.
[19:28:14] *** deadbeef has left ##java
[19:28:19] <Sou|cutter> String e; String t; <-- those are the same
[19:28:33] <new2net> yes they are.
[19:28:38] <Sou|cutter> same idea
[19:28:53] <new2net> so is it just <E> and <T> or <Z> also?
[19:28:57] <freeone3000> Yes.
[19:29:02] *** titankiller has joined ##java
[19:29:59] <freeone3000> dcope-: Note the arguments for substring. You want userInput.substring(userInput.indexOf(":")+1, userInput.length());
[19:30:05] <dreamreal> hahaha
[19:30:13] <pgib> oh boy. more Java tech that isn't compatible with itself
[19:30:24] <pgib> JAX-RS + @EJB
[19:30:51] <new2net> java uses lazy logic?
[19:31:11] <freeone3000> new2net: Not in the slightest.
[19:31:16] * dreamreal sighs
[19:31:18] <freeone3000> new2net: Certain boolean operators are short-circuited.
[19:31:21] <dreamreal> what's lazy is java programmers.
[19:31:30] <Sou|cutter> dreamreal: beat me to it
[19:31:59] *** sanchaz has joined ##java
[19:32:05] <Sou|cutter> laziness is a virtue in programming to some extent, but some people are ridiculous!
[19:32:13] <h6w> n00b question: If a class instantiates a nested class, is there a way to reference the parent class?
[19:32:15] <h6w> this and super don't seem to work in this instance and, if my understanding is correct, since you can instantiate a nested class without instantiating the parent class, I guess not. Is that right?
[19:32:20] <dreamreal> hahaha
[19:32:24] <dreamreal> what is this, idiot day?
[19:32:37] <freeone3000> h6w: You're thinking "inner" for that rule, not "nested". nested has "static".
[19:32:54] <freeone3000> h6w: If it's inner, the syntax is OuterClassName.this.method();
[19:32:56] <pgib> apparently you can make a JAX-RS service that is _also_ an EJB, but no real way to just inject an EJB into the service. So.. back to JNDI lookups I guess. This sucks. It seems like the EJB camp tries to make it as cumbersome as possible to use
[19:33:10] <sbalmos> dreamreal: I've stopped facepalming. I was causing brain damage to the point where I would become one of these others
[19:33:11] <h6w> freeone3000: Oh, nice. Thanks!
[19:33:20] * freeone3000 found his heap issue - 36,000,000 pairs.
[19:33:44] *** sanchaz has quit IRC
[19:34:04] *** aaron11 has quit IRC
[19:34:28] <dreamreal> freeone3000: Hmm. That might cause a problem. :)
[19:34:36] <dblevins> pgib: not sure I understand that last bit, but I'm on the EJB EG ... happy to bring up improvements
[19:35:00] <dblevins> pgib: what specifically are you after?
[19:36:16] <new2net> h6w, if you omit the class name and if the method doesn't exist in the inner class it will invoke the outer classes method.
[19:36:43] *** terranova has quit IRC
[19:37:10] <new2net> i just made that up, but it sounds true
[19:37:19] *** tigger0jk has quit IRC
[19:38:06] <pgib> dblevins, this: http://pastie.org/1648304 The EJB is never injected, so I guess I need to fallback to JNDI lookups? but this also means adding a ton of <ejb-local-ref> for every single EJB I want to access etc.. quickly turns back into EJB2 hell.
[19:40:03] <freeone3000> Okay. Something in http://pastebin.com/xH3Uir8T is throwing off about 30,000,000 Pairs. Probably generate2Combinations() followed by correlatePointsByPairs(). My issue is that I can't think of a way of doing this such that this *doesn't* happen. Anyone else have an idea?
[19:40:43] <sbalmos> pgib: I don't think JAX-RS resource classes are "managed" by definition
[19:41:13] <sbalmos> pgib: Googling around suggests adding @Stateless, or switching to CDI, annotating the resource with @RequestScoped, and then @Inject on the EJB ref
[19:41:43] *** JohnnyDavidson has quit IRC
[19:41:53] *** KarlKFI|work has joined ##java
[19:43:07] <RLa> freeone3000, you paste 500 lines of code and expect us to optimize it?
[19:43:32] *** coalado1 has quit IRC
[19:43:35] <RLa> freeone3000, what is that code doing at all, set partition by similarity?
[19:43:42] <pgib> sbalmos, hmm I wonder if there is much overhead in making all these resources SLSBs. I notice that seems to work. I guess I can learn about CDI, I've only heard it mentioned before
[19:43:57] <RLa> freeone3000, clustering, or what was it called?
[19:44:01] <sbalmos> pgib: You're essentially already using it, in a way, with @EJB
[19:44:01] *** Steve^ has joined ##java
[19:44:17] <freeone3000> RLa: Yeah, and then determining how many of each type are in the cluster. The approach is important, so I'm not allowed to change the core algorithm.
[19:44:20] <dblevins> pgib: what is the lifecycle you need? @Singleton might be better
[19:44:28] *** abhijain has joined ##java
[19:44:41] <sbalmos> dblevins: Good point.
[19:44:49] *** Speed` has joined ##java
[19:44:49] <freeone3000> RLa: Even if it *is* overkill for anything small, and anything large is pretty much guarenteed to OOME.
[19:45:04] <dblevins> pgib: the longer term vision of the platform is that @ManagedBean will making this work in any component model (i.e. any spec)
[19:45:28] <pgib> the resource is really just an adapter. Map HTTP path and query params to EJB method parameters, run the SLSB method, possibly massage the output. So, totally stateless
[19:45:39] *** matsebc has quit IRC
[19:46:13] <freeone3000> RLa: I suppose my actual issue is how to represent a Pair<Point> without actually having to *have* a Pair<Point>, because that's a 2^x memory operation.
[19:46:36] <dblevins> @Stateless and @Singleton are equally capable of being stateless
[19:46:45] *** oen has joined ##java
[19:46:49] *** afkos has quit IRC
[19:46:53] *** oen has left ##java
[19:47:12] <dblevins> @Singleton is pretty much identical to an @Stateless with a pool size of exactly 1
[19:47:49] *** zemanel has joined ##java
[19:48:25] <h6w> new2net: Thanks. I wanted to avoid doing it that way. I've shot myself in the foot a few too many times by doing things like that. :-p
[19:48:45] <dblevins> if you are just going to delegate the call to another bean and not actually do anything in the bean itself...
[19:48:57] <RLa> freeone3000, maybe you can make pair creation lazy?
[19:49:08] *** abhijain has quit IRC
[19:49:09] <dblevins> i'd use a @Singleton with @Lock(READ) at the class level
[19:49:15] <freeone3000> RLa: Considered that, but I actually *do* perform a pairwise comparison, so I'm not sure how that would help?
[19:49:36] <dblevins> otherwise you're hitting two bean pools
[19:49:39] <RLa> oh, so you need all pairs available at a time
[19:51:13] <freeone3000> Yeah. Which is where it gets bad. See, I'm not creating any new points, but I'm creating a *lot* of Pairs. While most of them get discarded after the initial closure (when I can start knocking off pairs that don't correlate), I need to have them all available until then.
[19:51:30] *** jackwang5 has quit IRC
[19:52:12] *** queequeg1 has quit IRC
[19:52:57] *** robbyoconnor has joined ##java
[19:53:07] *** sc30317 has joined ##java
[19:53:08] <jesmon> dblevins: not quite. @Stateless beans are guaranteed to be running in only 1 thread at a time, so they cannot be run concurrently. @Singleton beans obviously have to be thread safe
[19:53:17] <sc30317> hey all, I am getting the following error in Eclipse:
[19:53:18] <sc30317> Severity Description Resource In Folder Location Creation Time Id
[19:53:18] <sc30317> 2 The project was not built since its build path is incomplete. Cannot find the class file for javax.xml.stream.XMLEventWriter. Fix the build path then try building this project STORC March 8, 2011 1:50:16 PM 103988
[19:53:29] <sc30317> how can I fix the build path?
[19:53:37] *** fr0gprince_ has quit IRC
[19:53:48] <freeone3000> sc30317: You need a Java 6 JDK on there.
[19:53:51] *** fr0gprince_ has joined ##java
[19:54:05] <pgib> dblevins, ohh.. so if I use singleton then my bean may be a bottleneck for multiple clients (since the pool size is one?)
[19:54:13] <sc30317> freeone3000, I have Java 6 JDK I think
[19:54:16] <dblevins> jesmon: right, hence the "pretty much"
[19:54:34] <freeone3000> sc30317: Does it work on the command line? If so, it's an eclipse problem, and eclipse has its own channel for its weird issues.
[19:54:35] <dblevins> jesmon: the default settings of an @Singleton make it identical in the threading regard
[19:54:55] <sc30317> freeone3000, I am actually using Weblogic
[19:54:56] <dblevins> jesmon: but you're right it is multi-threaded capable
[19:54:59] <sc30317> using an ant build
[19:55:07] <sc30317> so I am not sure how I would get it to run via command line
[19:55:10] <pgib> oh ok, great, the container doesn't perform any syncronization on @Stateless, so it shouldn't be a bottleneck as long as I make it reentrant
[19:55:17] <freeone3000> sc30317: `ant`.
[19:55:26] <sc30317> freeone3000, what about it
[19:55:42] <freeone3000> sc30317: It's in backticks. Run that command on the command line in the directory with the build.xml. Everything'll magically work.
[19:55:44] <dblevins> pgib: was trying to communicate the reverse..
[19:55:54] *** Macstheyjustsuck has joined ##java
[19:56:00] <sc30317> freeone3000, I like it when things magically work! :)
[19:56:09] <Macstheyjustsuck> Names are entirely for convenience, right? Like, I can't check if a variable name contains the name of a string?
[19:56:14] <pgib> shit, I meant to type @Singleton
[19:56:18] <dblevins> pgib: an @Singleton marked @Lock(READ) would get a fully multi-threaded routing bean you're after
[19:56:22] <paulweb515> sc30317: long and the short ... it can't find XMLEventWriter in your path. Are you building something for a JEE container, an OSGi bundle, or simply a java app
[19:56:24] <freeone3000> Macstheyjustsuck: Right. Don't do that.
[19:56:36] *** aminpy has quit IRC
[19:56:42] <pgib> dblevins, ok. @Lock(READ).. I'll need to read that one
[19:56:43] <Macstheyjustsuck> Thanks
[19:56:45] *** Macstheyjustsuck has left ##java
[19:56:45] <sc30317> java app paulweb515
[19:56:58] <freeone3000> paulweb515: With that package, it's in the core SDK as of java 6.
[19:57:08] <dblevins> pgib: i have doc for it... let me dig it up
[19:57:19] <paulweb515> freeone3000: I agree
[19:57:21] <dblevins> pgib: it's on the openejb website, but not specific to openejb
[19:57:50] <dblevins> pgib: http://openejb.apache.org/3.0/singleton-beans.html
[19:58:15] <paulweb515> sc30317: have a look at your project in your eclipse/websphere/whatever ... what does it say for the JRE System Library?
[19:58:35] <sc30317> where would I find that paulweb515 ?
[19:58:41] *** tr1p has joined ##java
[19:59:08] *** Matic`Makovec has joined ##java
[19:59:19] <paulweb515> sc30317: huh?
[19:59:40] <dblevins> pgib: side note on @Singleton is that the reentrant setting is ignored
[19:59:58] <pgib> Wondering about @Lock(READ) vs @ConcurrencyManagement(BEAN)
[20:00:03] *** X-Scale has quit IRC
[20:00:11] <dblevins> pgib: effectively the same
[20:00:21] <dblevins> in your situation at least
[20:00:59] <pgib> ok, I think I prefer the latter as self-documenting code
[20:01:00] <tr1p> whhats the differnt between all the java's like fx and the others they have. does the jde reg java work on phones too or do u need the other java?
[20:01:03] <sc30317> paulweb515, where would I find out what it says for the JRE system library
[20:01:14] <dblevins> i would use @Lock(READ) as the overhead of obtaining the read lock is near non-existent
[20:01:18] <paulweb515> sc30317: right under the project folder itself
[20:01:31] <sc30317> aha
[20:01:47] <sc30317> JRE System Library [jdk150_12]
[20:01:55] <dblevins> pgib: and then if you did want to update some state, you could just throw an @Lock(WRITE) on that one method
[20:02:11] <paulweb515> sc30317: and there you go ... :-)
[20:02:28] <sc30317> and there I go what?
[20:02:37] <pgib> ah ok. so it is a readers/writer lock. sure seems more flexible down the road
[20:02:41] <sc30317> not the right version of java paulweb515 ?
[20:03:13] <dblevins> pgib: exactly
[20:04:01] *** jtheuer has quit IRC
[20:04:42] <paulweb515> sc30317: you can't find a 1.6 javax class in a 1.5 library ...
[20:04:46] *** White_Cat has quit IRC
[20:04:58] <pgib> I'll need to read up on @ManagedBean and all these other crazy beans that are being promoted now. (WebBeans?) Seems confusing as hell, but maybe things will be clear when the dust settles.
[20:05:04] <paulweb515> sc30317: you can add 1.6 in Preferences>Java>Installed JREs
[20:05:10] *** rtdos has joined ##java
[20:05:13] *** Speed` has quit IRC
[20:05:27] <paulweb515> sc30317: or change your project build path if your system already knows about 1.6
[20:05:56] *** eyesUnclouded has joined ##java
[20:05:57] <dblevins> pgib: it is confusing as hell... for all intense purposes CDI and @ManagedBean is the same as EJB
[20:06:10] <dmlloyd> not really
[20:06:20] <dmlloyd> take it from someone who is, as we speak, implementing java ee 6
[20:06:23] <dmlloyd> they're pretty different
[20:06:35] <pgib> dblevins, "intents and purposes" btw
[20:06:54] <dblevins> i'm referring to the basic function of having a proxied bean that allows for container services to be interjected
[20:07:00] <dblevins> not the other dressing
[20:07:27] <dmlloyd> injected, not interjected
[20:07:38] <dblevins> i didn
[20:07:46] <dblevins> didn't mean injected
[20:08:01] <dblevins> perhaps interposed is a better word?
[20:08:35] <pgib> What doesn' seem clear to a user like me is "Why?" Didn't we just get EJB3.0/3.1? what is managedbeans and webbeans trying to solve?
[20:08:42] <dblevins> prior to CDI, EJB was the only component model to proxy beans and do things like interceptors and other per-invocation services (security, transaction, interceptors)
[20:09:32] <dblevins> some of that is political or rather licensing...
[20:09:50] <dblevins> redhat owns CDI, oracle owns EJB and @ManagedBean
[20:10:01] <dmlloyd> that's not really true either
[20:10:08] *** purestrain has quit IRC
[20:10:46] <dblevins> there was just a huge mess in java ee 6 in terms of spec scopes
[20:11:42] <dblevins> 330 (@Inject) essentially split out of 299
[20:11:45] *** VJTachyon has quit IRC
[20:11:46] *** yxz97 has joined ##java
[20:12:50] <dblevins> and @ManagedBean was added very late in the java ee 6 spec cycle to try and address confusion between EJB and CDI and the trend of more specs wanting to do basic "proxied" component styles that offered things like interceptors, etc.
[20:13:16] *** toki78 has joined ##java
[20:13:23] <dmlloyd> @ManagedBean is pretty useless by itself
[20:13:35] <dblevins> agreed
[20:13:43] <dmlloyd> I'm a little annoyed that we spent a disproportionate amount of time trying to implement it "right" for JBossAS7
[20:13:46] *** nacre has joined ##java
[20:13:52] <dmlloyd> but dammit we have the best @ManagedBean impl on the planet!
[20:14:03] <dmlloyd> anyway EE6 people should also be aware of this:
[20:14:06] <dmlloyd> ~@Resource problem
[20:14:07] <javabot> dmlloyd, @resource problem is http://jaitechwriteups.blogspot.com/2011/02/resource-and-new-lookup-attribute-how.html
[20:14:08] *** matsebc has joined ##java
[20:14:14] *** BSWolf has joined ##java
[20:14:17] <dblevins> i'm sure we'd all say that about our @ManagedBean impls :)
[20:14:57] *** phantomcircuit has joined ##java
[20:16:53] *** bindaas has quit IRC
[20:16:56] <pgib> Hmm. I'll probably just continue doing things the hard way until something useful emerges from the ashes.
[20:17:19] *** bindaas has joined ##java
[20:17:42] <dblevins> @Singleton would be my recommendation
[20:18:31] <new2net> any OP around?
[20:18:40] *** Ch30ps has joined ##java
[20:19:26] <pgib> I agree. but I mean the "next big java thing" We are still doing ejb3 with a bunch of ad-hoc stuff. There is so much new tech that just seems like it is going to be superseded again
[20:20:26] <dblevins> pgib: at least in EJB terms the next spec rev will be pretty minor
[20:21:07] <pgib> to me, I think CDI vs ManagedBeans. JSF vs Seam vs Wicket. Spring vs EJB. Maybe ditch it all and use Grails? who knows, too many options, not enough time to try them all, and no clear direction either (from what I've seen)
[20:21:13] *** bindaas has quit IRC
[20:21:36] *** bindaas has joined ##java
[20:21:45] <dblevins> pgib: can't help you there :)
[20:21:52] <dblevins> it's both good and bad :)
[20:22:41] <pgib> choosing a technology that becomes abandonware in 1 year is good because?
[20:23:08] <dblevins> wasn't attempting to say that
[20:23:20] <dblevins> was saying many choices is both good and bad
[20:23:28] *** [clay] has joined ##java
[20:23:48] <dblevins> certainly nothing standard will become abandonware anytime soon
[20:24:06] <dblevins> things do get deprecated, but it takes years
[20:24:23] <pgib> I thought users are already abandoning JSF
[20:24:45] <dblevins> users can certainly do that, but it's still required for vendors to support it
[20:25:20] <dblevins> vendors who are certified are required to support it and will have to for the foreseeable future
[20:25:22] <freeone3000> Through all of EE7, no less.
[20:25:36] <dblevins> right
[20:26:10] <dblevins> we're probably going to finally make CMP optional (vendors would not be required to support it) ...
[20:26:21] *** xiliax has quit IRC
[20:26:28] <dblevins> that took two spec cycles and many years
[20:27:01] <dblevins> optional in EE7/EJB3.2 i mean
[20:27:42] <RLa> abandon JSF, then what would be next step from JSF?
[20:27:46] <gtrak> say I have a client X509Certificate and a keystore configured with the root CAs public keys. How do I get the certPath for that client certificate.
[20:28:11] *** xiliax has joined ##java
[20:28:28] *** RobotCow has joined ##java
[20:30:02] *** lamdk has joined ##java
[20:30:06] *** marlaw has quit IRC
[20:30:49] *** wyvern` has quit IRC
[20:31:35] *** drindt has quit IRC
[20:32:15] *** titankiller has quit IRC
[20:32:22] *** bearded_oneder has joined ##java
[20:32:43] <bearded_oneder> .
[20:33:22] *** X-Scale has joined ##java
[20:33:23] <sbalmos> .+
[20:33:57] <pgib> Different topic, best practices. I see examples all over the place where EJBs return a JPA entity. Of course, this is problematic since the entity will no longer be within the persistent context and could possibly trigger lazy loading.
[20:34:35] <cheeser> it's only problematic if you don't hydrate that relationship
[20:34:49] *** Terabyte has joined ##java
[20:34:52] <pgib> So, is it fairly common to have EJB code like this: FooDTO getFoo(long id) { Foo f = dao.find(id); return FooDTO.fromFoo(f); } // ?
[20:35:08] <pgib> cheeser, right, but we don't want to pull the whole DB over each time we do a query ;)
[20:35:25] <cheeser> common? dunno. but it's not unheard of either.
[20:35:31] <jesmon> pgib: I choose to blame the relational model :)
[20:35:42] *** titankiller has joined ##java
[20:36:39] <pgib> I suppose we can document the EJB's interface to explain how deeply hydrated the hierarchy is. But, this is still error-prone. Especially when client code may use reflection so it is a bit harder to detect (JAXB, Wicket, etc..)
[20:36:59] <Terabyte> hi, I heard it's possible to map SQL results to java objects (with the name of each object corresponding to the entity in the domain. I think the object is called a pojo, and I think this comes under the heading java persistence, but I can't for the life of me find an example that isn't library specific. Could somebody point me in the right direction? My result set currently comes back as java.sql.ResultSet.
[20:37:40] <freeone3000> ~jpa
[20:37:40] <javabot> JPA is the Java Persistence API. For all intents and purposes, it's meant for persisting objects into a relational database, which is usually correct but let's be real, that's sometimes stupid. Lots of implementations of this - Hibernate, cocobase, Toplink Essentials, openJPA are some. Wanna learn more? Google, or read http://java.sun.com/developer/technicalArticles/J2EE/jpa/
[20:38:16] <freeone3000> It maps Entity classes to database objects transparently, which is what you want, as opposed to ResultSet parsing, which gets messy fast.
[20:38:27] *** riotz has joined ##java
[20:38:30] <pgib> and JPA gets messy fast too. let's be honest
[20:38:31] <Terabyte> oh so I do have to pick an implementation.. I chose hibernate, since that's the one I remember being mentioned.
[20:38:37] <freeone3000> pgib: Only if you have to share the database.
[20:38:38] *** bduncan has quit IRC
[20:39:00] <freeone3000> ..But if you don't, why not use a proper object db?
[20:39:38] <pgib> because most people don't know much about them and finding administrators is a problem
[20:40:47] <sbalmos> pgib: There used to be articles, I think I even wrote one of them, about having separate serialization getters for JAXB that would just return IDs of child entities instead of lazy-loading
[20:42:08] *** titankiller has quit IRC
[20:43:02] *** titankiller has joined ##java
[20:43:39] <pgib> yeah, something else I was wondering about. You may not want to serialize every field from the entities all the time. is RESTful land: /pets may return a list of Pets with brief information, and /pets/{id} may return all the fields
[20:43:45] <Terabyte> cheers chaps
[20:44:24] *** Ch30ps has quit IRC
[20:44:40] *** Ch30ps has joined ##java
[20:45:00] *** km has quit IRC
[20:45:44] *** tr1p has quit IRC
[20:46:50] *** RobotCow has quit IRC
[20:47:18] <sbalmos> pgib: It gets ugly, but I don't know of a better way than to have a separate, matched set of resource entities, and copy between as needed. *Maybe* have your service tier (e.g. the JAX-RS tier) dehydrate the entity so you don't screw with the database, and then start nulling all the non-selected fields?
[20:49:11] *** km has joined ##java
[20:50:09] <pgib> yeah. I was thinking either that solution, or needing a different DTO for each different format and having to construct the DTOs from the underlying model. Both solutions are rather annoying IMHO
[20:50:31] <RLa> sbalmos, if that's hidden in bytecode it should be quite good idea (using id's)
[20:50:45] <sbalmos> RLa: That made no sense
[20:50:58] *** lmatteis has joined ##java
[20:51:03] *** sc30317 has left ##java
[20:51:04] <RLa> sbalmos, how so
[20:51:04] <pgib> possibly better to just do all the XML and JSON serialization manually with java's XML apis and Jackson's programatic API
[20:51:04] <lmatteis> hi
[20:51:09] <lmatteis> how do i speed up maven2
[20:51:17] <lmatteis> my builds take 30 seconds on a really simple project
[20:51:24] <lmatteis> no more than 100 lines of code :/
[20:51:24] <pgib> disable online mode
[20:51:26] <sbalmos> pgib: On the upside, having separate DTOs (I guess that's what you're referring to as the ultimate entity objects that are returned in XML format) allows you to do multi-entity combining
[20:51:54] <sbalmos> RLa: What's hidden in bytecode? What IDs?
[20:52:30] <pgib> yeah by DTO I mean the trimmed-down non-JPA-managed object constructed from the values of the actual JPA entity.
[20:52:31] <RLa> sbalmos, you configure these things using annotations in a general and let compiler generate serialization code that converts entities into id's and back
[20:52:48] <pgib> not sure what multi-entity combining is though
[20:53:27] <RLa> "possibly better to just do all the XML and JSON serialization manually" <- that should get out of hand quite fast
[20:53:55] <sbalmos> pgib: Look at Amazon's XML request structure. You can request fields in your request that invariably come from separate backend database entities, combining them into one response.
[20:53:57] <wad> lmatteis, how are you building it?
[20:54:23] *** jham has left ##java
[20:54:29] <RLa> lmatteis, do not use snapshot libs
[20:54:44] <wad> lmatteis, what I mean is what command are you using to build?
[20:54:46] *** wyvern` has joined ##java
[20:55:21] *** Alundra has joined ##java
[20:55:41] <pgib> http://pastie.org/1648599 I'm just not having much luck today :( The "Event" is package visible, so MyResource should be able to access it.
[20:56:34] <lmatteis> wad: mvn -o compile
[20:56:52] *** okiwan has joined ##java
[20:57:05] <wad> lmatteis, are unit tests in there?
[20:57:06] <pgib> sbalmos, ahh, yeah, we already do that in some cases (a DTO for a particular Joined query so that we don't end up with N+1 access or really stupid generated queries that pull in way too much data.
[20:57:26] <dmlloyd> pgib, your EJB container seems to have generated an invalid proxy
[20:57:43] <pgib> ugh
[20:58:17] <pgib> let's see if @Stateless behaves differently
[20:58:25] <okiwan> Hi there...just a quick question. I'm reading on the channel's topic about "No applets". Does this mean no applet-related questions can be asked here? If so, could you be so kind to tell me on which channel, if any, can I address?
[20:58:25] <dmlloyd> my guess is that it generated the proxy in a different class loader from the original class yielding a different Package with the same name
[20:58:36] <dmlloyd> ~~ okiwan applets
[20:58:36] <javabot> okiwan, 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)
[20:58:43] *** werdan7 has quit IRC
[20:59:12] <okiwan> Got it. Thanks!
[20:59:25] <dmlloyd> pgib: easy fix, make the class & constructor public
[20:59:43] <pgib> dmlloyd, yeah seems like the package is at least right, so I guess it would be from the CL
[20:59:59] <lmatteis> wad: no, i disabeld them
[21:00:24] <wad> lmatteis, with -Dmaven.test.skip=true ?
[21:00:35] *** bulltwang has quit IRC
[21:00:51] <lmatteis> hrm DskipTests actually
[21:01:27] <wad> lmatteis, what version of maven are you using? mvn --version
[21:01:33] <Alundra> I created a program with three classes: one is a subclass of another and both are in the same package: the third is the main class that imports this package and uses the subclass of said package. I am trying to compile these source files to class files, but the subclass file won't. The terminal says that the "symbol is missing".
[21:01:54] <lmatteis> wad: what does mvn -o compile do? I dont see any changes in my target dir
[21:02:08] <pgib> dmlloyd, yes. Seems like Glassfish is broken for both @Stateless and @Singleton in this case
[21:02:14] <wad> lmatteis, I usually have good results with "mvn clean install"
[21:04:06] <lmatteis> wad: mvn -o compile takes 7 seconds - which is fine but doesn't do anything it seems - target is untouched. mvn install takes really unproductive wopping 37 seconds - but it also builds the .war which i dont need - i just need that it compiles stuff to my targe dir
[21:04:49] <wad> lmatteis, okay, cool. So what are you trying to do then?
[21:05:39] <pgib> lmatteis, mvn package
[21:05:41] * wad remembers the days when you would only start a build before you went to lunch, it took that long.
[21:05:57] <lmatteis> pgib: mvn package takes 26 seconds
[21:06:14] <pgib> cool trimmed it down by 10
[21:06:17] *** bojo has quit IRC
[21:06:22] <lmatteis> wad: 26 seconds is not fair
[21:06:23] <pgib> also, are you in offline mode?
[21:06:48] <lmatteis> as in not deploying to the network?
[21:06:51] <lmatteis> yes it's all local
[21:07:56] <lmatteis> can i mvn package, without rebuilding the .war archive?
[21:08:01] *** jesmon has quit IRC
[21:08:22] *** sebrock has joined ##java
[21:09:35] *** cyphorious has joined ##java
[21:09:58] *** bojo has joined ##java
[21:10:28] *** devkhadka has quit IRC
[21:11:08] *** Alundra has quit IRC
[21:14:44] *** bduncan has joined ##java
[21:15:16] *** X-Scale has quit IRC
[21:15:36] <lmatteis> anyone
[21:15:36] <lmatteis> ?
[21:15:36] <lmatteis> i just need to compile and assemble my webapp
[21:15:36] <lmatteis> i want to avoid the "package" process
[21:16:52] *** pchapman has joined ##java
[21:18:18] <freeone3000> Uh, compiling and assembling the webapp *is* the package process.
[21:18:45] <lmatteis> freeone3000: maven also creates the .war archive, which i dont need
[21:19:04] <freeone3000> Then choose an earlier lifecycle goal. If you just need compile, just say compile.
[21:19:23] <lmatteis> freeone3000: funny enough i tried mvn compile. it doesn't touch my target directory
[21:19:32] <freeone3000> Then all source files are up-to-date.
[21:19:47] <lmatteis> no i made changes
[21:19:55] <freeone3000> Ones that javac isn't recognizing.
[21:20:12] <lmatteis> freeone3000: where exactly does it store the project?
[21:20:34] <lmatteis> where are my classes?
[21:20:44] <pgib> lmatteis, no. I mean offline mode
[21:20:53] <freeone3000> lmatteis: target/classes/
[21:21:05] <lmatteis> pgib: what do you mean by offline
[21:21:46] <pgib> as in, maven will check remote repos for updates until you disable that
[21:22:10] *** jdolan has quit IRC
[21:22:24] <pgib> lmatteis, `mvn --help | grep offline` seriously?
[21:22:24] *** Frostix has quit IRC
[21:22:58] <lmatteis> freeone3000: ok, my bad... now how do i create a standard war folder but without the package itself. like if i do mvn package it creates a myproject-0.1/ folder and a myproject-0.1.war
[21:23:16] <lmatteis> can i avoid creating the myproject-0.1.war? as it seems like the most expensive part of my pcakaging
[21:23:24] <lmatteis> because i dont need the .war i just need the web folder.
[21:23:51] <freeone3000> It's a zip with some fancy ops. It won't be the most expensive part of packaging. Copying all your resources and dependencies to the right places in the war build folder will be.
[21:24:06] *** Somelauw has joined ##java
[21:24:29] <Somelauw> Hi, in my build.xml I wrote a manifest file
[21:24:34] <Somelauw> The file gets created
[21:24:36] <lmatteis> freeone3000: [INFO] Building war: C:\.....\target\myproject-0.1.war
[21:24:42] <Somelauw> But it won't be included in my jar.
[21:24:45] <lmatteis> that's where it *wastes* most of its time
[21:24:52] <freeone3000> lmatteis: That'll probably be process-resources, but maybe it'll be part of package.
[21:25:42] <freeone3000> lmatteis: Ah. prepare-package
[21:25:52] <freeone3000> (Assuming maven 2.1 or above)
[21:26:27] <lmatteis> maven 3.0.3
[21:26:47] <Terabyte> running "java -cp h2.jar -jar gen.jar config.txt" does that say run the java program gen.jar with parameter config.txt, with h2.jar on the classpath?
[21:26:53] <freeone3000> There you go. Maven lifecycle page is your friend.
[21:26:56] <lmatteis> pgib: can i use -o for offline?
[21:26:59] <freeone3000> Terabyte: -jar overrides -cp
[21:27:09] <Terabyte> damn
[21:27:23] <pgib> lmatteis, what did the documentation tell you?
[21:27:35] *** Tashtego has joined ##java
[21:28:26] <lmatteis> freeone3000: prepare-package doesn't create my web folder for me
[21:28:31] *** titankiller has quit IRC
[21:28:41] *** faust45 has joined ##java
[21:29:06] <freeone3000> lmatteis: That's the lifecycle phase immediately before package. So if prepare-package doesn't do what you want, you'll have to run package.
[21:29:44] <lmatteis> really the damn packaging takes like 8 seconds :(
[21:30:13] *** Prezioso has quit IRC
[21:30:22] <lmatteis> wow the default lifecycle is full of stuff
[21:30:35] <lmatteis> all those things happen sequentially?
[21:30:39] <freeone3000> Yes.
[21:30:52] <pgib> well, with a few exceptions
[21:30:54] <pgib> 'clean'
[21:30:55] <Somelauw> http://pastebin.com/xnsXKe6D
[21:31:09] <freeone3000> pgib: 'clean' has its own lifecycle, as does site.
[21:31:13] <Somelauw> Manifest gets created but jar wont include it.
[21:31:27] <Somelauw> Instead it will include a different manifest
[21:31:40] <Somelauw> For now I manually included manifest each time
[21:32:14] *** okiwan has quit IRC
[21:32:17] <Terabyte> freeone3000 i'm getting "java.lang.ClassNotFoundException: org.h2.Driver" which suggests that the driver for h2 database is not on the classpath. yet i've placed h2.jar in a folder and added this folder to the CLASSPATH env variable, and restarted the console. any ideas?
[21:32:26] *** terranova has joined ##java
[21:32:30] <freeone3000> Terabyte: -jar overrides any other classpath settings.
[21:32:41] <Terabyte> java -jar gen2.jar config.txt
[21:33:08] <freeone3000> Find the main class. (If you don't know, it's in the manifest.) Stick gen2.jar on the classpath, in addition to whatever else you have, and run the main class with the needed args.
[21:33:09] <Terabyte> was the lastest command i ran, does it still ignore the CLASSPATH environment variable?
[21:33:13] <freeone3000> Yes.
[21:33:56] <Somelauw> Nevermind, I figured it out. Manifest tag needs to be encloded in jar tag.
[21:36:03] *** camcorder has joined ##java
[21:36:11] <camcorder> hi
[21:36:50] <camcorder> I create a JPoppMenu and show it with popupmenu.setVisible(true)
[21:36:51] *** kieran491 has joined ##java
[21:36:52] <Terabyte> freeone3000 so if com.felees.hbnpojogen.HbnPojoGen is the main class, then I run java com.felees.hbnpojogen.HbnPojoGen config.txt ?
[21:37:04] <camcorder> however when I do it, highlight on menu items are not shown
[21:37:13] <camcorder> neither on windows, nor in Linux.
[21:37:19] *** syphar has joined ##java
[21:37:19] <freeone3000> Terabyte: With -"cp gen.jar:h2.jar"
[21:37:33] *** titankiller has joined ##java
[21:38:13] <pgib> man, I really do wish jax-rs (and I guess jaxb) had something simlar to Jackson's serializer concept. Would allow for some way to say "This method should return fields 1,2,3 and this other method should return fields 1,2,3,4,5,6" now I'm here doing all my own data marshalling and just returning String from each method. Seems to eliminate half the reason for using jax-rs to begin with
[21:38:25] *** Kamaran has quit IRC
[21:38:28] <Somelauw> Also, manifest doesn't need a file attribute anumore?
[21:38:49] <freeone3000> Somelauw: Not if you supply the attributes inline.
[21:39:02] *** RLa has quit IRC
[21:42:57] *** matsebc has quit IRC
[21:43:57] *** [[thufir]] has quit IRC
[21:44:41] *** yoshx has quit IRC
[21:44:54] <lmatteis> freeone3000: but really - how is this productive? 20 seconds to see code changes - this calls for extreme slacking off
[21:44:55] <Terabyte> freeone3000: still stuck, here's my "state" http://solong.co.uk/state.png
[21:45:44] *** whaley has joined ##java
[21:46:10] <Terabyte> shows the command run, the classnotfound error, the main class as shown in the manifest, and the CLASSPATH system env variable
[21:46:43] <lmatteis> freeone3000: i'll trying using ant
[21:46:44] <freeone3000> Terabyte: Use semicolon, not colon. The path separator is different on windows.
[21:47:21] <Terabyte> haha cool! it worked.
[21:47:30] <Terabyte> well it didn't work, it broke, but at least it's not a classpathexception.
[21:47:37] <Terabyte> thanks freeone3000 :D
[21:47:52] <pgib> Hmm I'll need to figure out some place to report this. I think it is a huge design flaw in jax-rs
[21:48:02] *** okiwan has joined ##java
[21:48:07] *** jdolan has joined ##java
[21:48:17] <freeone3000> pgib: Define your return types in terms of objects.
[21:49:13] <freeone3000> Not Collections, those don't serialize well due to type erasure. Actual, serializable state objects you can pass around.
[21:50:35] *** matsebc has joined ##java
[21:52:57] <bradford> Is there any way for Java to use reflection (or similar) to introspect other languages? E.g. inspect C# dlls from within Java.
[21:53:08] *** okiwan has quit IRC
[21:53:21] <dreamreal> java can call any native process you can interface to
[21:53:28] *** Behold has joined ##java
[21:53:33] *** nmx- has quit IRC
[21:53:35] <dreamreal> so "yes" although it's not likely to be pleasant
[21:53:47] *** BeholdMyGlory has quit IRC
[21:54:04] *** okiwan has joined ##java
[21:54:15] <pgib> freeone3000, right. but then I end up needing different classes for each different possible output format. class BriefFooList { List<BriefFoo> foos }; class BriefFoo { long id; String name; }; PartialFooList { List<PartialFoo> foos }; class PartialFoo { long id; String name; Owner owner; }; class FullFooList { ...
[21:54:29] <freeone3000> pgib: Perhaps you should have fewer output formats.
[21:54:34] *** okiwan has quit IRC
[21:54:50] <dreamreal> pgib: XML?
[21:55:09] <pgib> and filling those lists and stuff is just a big kludgy mess.
[21:55:22] <dreamreal> is the output format XML?
[21:55:34] <bradford> Ok, thanks dreamreal.
[21:55:39] *** bobbytek2 has joined ##java
[21:56:14] <bobbytek2> Does java preserve the order of serialized list elements upon deserialization?
[21:56:14] *** noobie25 has quit IRC
[21:56:26] <pgib> freeone3000, that particular example is make-believe. But you can imagine wanting to hide information from particular user roles. Or, at least having a different format for a listing for Foo vs doing a GET on a specific Foo
[21:56:27] <cheeser> ~tias
[21:56:28] <javabot> Try it and see. You learn much more by experimentation than by asking without having even tried.
[21:56:33] <cheeser> 8
[21:56:53] <freeone3000> pgib: Yeah. I see your point, but you could also respond with a FullFoo with some fields blank.
[21:57:19] <dreamreal> pgib: well, I'm going to assume this is XML, despite you not telling me eithe rway. Why not apply an XSL transform? The XSL sheet could strip out information not appropriate for the specific transport, and it'd be fast as hell.
[21:57:26] <pgib> dreamreal, XML is fine. XML and JSON negotiation would be preferred. Jersey supports this just fine, with the exception of customizing the serialization
[21:57:27] <freeone3000> As in, a PartialFoo is a FullFoo which has its owner field set null.
[21:57:35] *** bolt has joined ##java
[21:57:53] <freeone3000> Or yeah, you could XSL your XML and then use xjc, instead of schemagen.
[21:58:06] <bobbytek2> Let me rephrase that: does java guarantee the order of serialized list elements upon deserialization?
[21:58:13] <pgib> I don't even know what schemagen is, so I guess that isn't a problem
[21:58:21] <dreamreal> bobbytek2: not likely, although some collection types would do so.
[21:58:26] <freeone3000> schemagen generates XSD from Java classes. XJC does the inverse.
[21:58:49] <bobbytek2> dreamreal, do you know if xstream does?
[21:59:10] *** X-Scale has joined ##java
[21:59:15] <pgib> hmm. doesn't work with JSON though, I take it.
[21:59:16] <dreamreal> try it and see. I do not know if xstream would create a collection that was ordered offhand.
[21:59:34] <bobbytek2> cool, will tias :)
[21:59:34] <pgib> bobbytek2, xstream has always maintained order for things like List, but I wouldn't expect it for Set etc..
[21:59:45] <bobbytek2> sure, that makes sense
[22:00:58] <pgib> freeone3000, that solution is reasonable though. I'd still need a DTO just for using in REST-land, since the underlying Entity's fields are not all nullable.
[22:01:55] *** pchapman has quit IRC
[22:03:12] *** pulse00 has joined ##java
[22:03:38] *** terranova has quit IRC
[22:03:52] *** bolt has quit IRC
[22:05:32] *** jgomo3 has quit IRC
[22:06:06] *** bolt has joined ##java
[22:07:15] *** LordDoskias has joined ##java
[22:07:40] <LordDoskias> is it possible (and if ues how) to access the private field of a java class from withing an inner class?
[22:08:02] *** bolt has quit IRC
[22:08:30] <pgib> LordDoskias, yes
[22:08:55] <pgib> just as you described. nothing tricky
[22:10:06] <LordDoskias> i have public class Bla { private File something; private class Inner { public Inner() { File test = something; } } }
[22:10:10] <LordDoskias> so this should work with no problems?
[22:11:22] <LordDoskias> hmz, apparently my IDE was acting up
[22:11:24] *** Xzil0 has joined ##java
[22:11:50] *** cool123 has joined ##java
[22:11:56] <pgib> well, something needs to be final. But, that isn't because it is private, that is just the common case
[22:12:16] <pgib> "File something".
[22:12:30] *** bolt has joined ##java
[22:12:31] *** nolsen01 has quit IRC
[22:13:43] *** bolt has quit IRC
[22:14:09] *** BeholdMyGlory has joined ##java
[22:14:29] *** Behold has quit IRC
[22:14:40] *** bolt has joined ##java
[22:16:27] *** wolfman2000 has joined ##java
[22:16:58] *** cool123 has quit IRC
[22:17:23] * shookees gn
[22:21:16] *** jesmon has joined ##java
[22:22:25] *** surial has joined ##java
[22:23:10] *** seyfarth has joined ##java
[22:23:36] *** seyfarth has left ##java
[22:24:31] *** camcorder has quit IRC
[22:24:34] <lisak> can I load a JSP if it was already statically included in different JSP ?
[22:25:15] *** Fisiu has joined ##java
[22:25:43] <lisak> cause I'm getting ClassNotFoundException: org.apache.jsp.WEB_002dINF.jsp.customers.biddingRoomSearchContainer_jsp
[22:26:29] *** Olathe has joined ##java
[22:26:52] *** cbrock has quit IRC
[22:29:43] *** Somelauw has quit IRC
[22:31:03] <LordDoskias> can i implement the singleton design patter using inner classes since they cannot support static methods
[22:31:17] <LordDoskias> unless the class itself is defined as static
[22:31:31] <freeone3000> ~singleton
[22:31:31] <javabot> In most cases singletons should be avoided, they often make non-trivial programs clunky and difficult to maintain. If you really are considering using a singleton, you should first read http://www.ibm.com/developerworks/webservices/library/co-single.html and http://www.ddj.com/cpp/184401625 before doing so to ensure using a singleton is absolutely, positively necessary.
[22:33:16] *** Fisiu has quit IRC
[22:33:35] *** Fisiu has joined ##java
[22:35:50] <pgib> LordDoskias, why do you need inner classes for singleton?
[22:37:00] *** sebrock has quit IRC
[22:37:54] <dmlloyd> LordDoskias, that doesn't make even a little sense - the reason inner classes can't have static methods is because they're associated with an outer "enclosing" instance, which is very un-singlton-y
[22:38:21] <pgib> class Foo { private static Foo _instance = null; private Foo() { /*whatever*/ } static Foo instance() { if (_instance == null) { _instance = new Foo(); } return _instance; } } // There you go, basic singleton
[22:38:27] <dmlloyd> LordDoskias: whatever dzone or tss or whatever article you read saying that singletons are a good idea, you're better off un-reading
[22:38:53] <pgib> roseindia.net?
[22:39:24] <dmlloyd> singletons, like other design pattern constructs, are things that might appear in code, not things you should seek out, unless you actually know what you're doing (hint: if you're wondering about the best way to implement a singleton, you're not there)
[22:40:48] <pgib> attention everyone (at least freeone3000 and dreamreal) I think I basically _need_ different classes for my Restful serialization vs my existing entities. Main reason? To display URLs of objects in listings etc..
[22:40:49] <lf94> isn't a singleton using a variable like 'x'
[22:41:06] <sbalmos> uh, no
[22:41:33] <lahwran> is there a way to tell how much of the system ram java has allocated is being used for the program it's running?
[22:41:36] <freeone3000> pgib: So you need your objects to be serializable to something that can be urlencoded and deserialized.
[22:41:48] <freeone3000> lahwran: A profiler.
[22:42:02] <lahwran> will that decrease performance much?
[22:42:14] <pgib> <foos><foo url="/foo/1" id="1" name="Foo 1"/><foo url="foo/2" id="2" name="Foo 2"/></foos> Unless Jax-RS has some means of doing that
[22:42:24] <freeone3000> lahwran: Not much for sampling. A whole lot for instrumentation.
[22:42:51] <lahwran> and which of those will tell me how much allocated ram is actually in use?
[22:42:57] <freeone3000> lahwran: Both.
[22:42:59] *** bn` has quit IRC
[22:43:14] <pgib> well, because RESTful apis should have references from one resource to the next. so, just simply listing all foos is not sufficient, I need to also say how to actually reference each foo.
[22:43:18] <lahwran> ...is instrumentation more accurate? what about it is better?
[22:43:38] <lahwran> or is it better?
[22:43:57] <freeone3000> lahwran: Sampling calculates RAM usage every so often. Instrumentation gives a continuous count. You want sampling for most purposes.
[22:44:20] <lahwran> ah
[22:44:40] <lf94> !define singleton
[22:44:40] <pgib> which actually makes me yearn for some sort of "Serializer" hook again. I could just generate that value on the fly from Foo's ID. but, instead I need to build an object just for serialization then throw it away :-/ oh well.
[22:44:56] <LordDoskias> ~date
[22:44:56] <javabot> Tue Mar 08 16:43:26 EST 2011
[22:44:59] <sbalmos> ~~ lf94 singleton
[22:44:59] <javabot> lf94, In most cases singletons should be avoided, they often make non-trivial programs clunky and difficult to maintain. If you really are considering using a singleton, you should first read http://www.ibm.com/developerworks/webservices/library/co-single.html and http://www.ddj.com/cpp/184401625 before doing so to ensure using a singleton is absolutely, positively necessary.
[22:45:04] <lahwran> this will be running on a (small) production server, so probably want sampling then
[22:45:21] <lf94> Ah thanks sbalmos
[22:45:46] <freeone3000> pgib: http://www.oracle.com/technetwork/articles/javase/index-137171.html may be useful for one looking to make JAX-WS into a REST API.
[22:46:00] <lahwran> freeone3000: anywhere you can point me for this?
[22:46:08] <cbeust> sbalmos: I'm currently writing a blog post that aims at redeeming singletons. Singletons are not evil.
[22:46:10] <freeone3000> pgib: Fairly sure you could probably make your existing REST API to output XML, though.
[22:46:18] <freeone3000> ~~ lahwran profiler
[22:46:18] <javabot> lahwran, a profiler is a tool to find performance bottlenecks. VisualVM is included in JDK nowadays and is great for a free profiler; jprofiler and jprobe cost money (jprofiler has a free eval period). Some more are listed here: http://javafaq.mine.nu/lookup?169
[22:46:37] *** Xzil0 has quit IRC
[22:46:41] <lahwran> visualvm. /me looks up usage
[22:46:54] <freeone3000> It's a graphical utility, so, double-clicking.
[22:47:12] <lf94> so a singleton is a global variable
[22:47:14] <lf94> or something
[22:47:14] <lahwran> ohshit
[22:47:25] <lf94> and or class
[22:47:30] <lahwran> is there a cli version? I don't have a gui where I'll be running it
[22:47:37] <lmatteis> why are jsps automatically re-compiled by my web-server at a page refresh. whilst my java source are not?
[22:47:41] <freeone3000> lahwran: JMX can be remoted, if the proper ports are open on the server.
[22:47:48] <freeone3000> lmatteis: Because the JSP spec says so, and your other source is already compiled.
[22:48:07] <freeone3000> lmatteis: Or rather, the spec says that the server is responsible for compiling JSPs, and not for compiling anything else.
[22:48:10] <lmatteis> my other source is what?
[22:48:16] <lmatteis> oh
[22:48:33] <lmatteis> any simple reasoning behind that?
[22:48:42] <pgib> freeone3000, I don't have an existing JAX-WS or REST API. I'm trying this for the first time
[22:49:20] *** toki78 has quit IRC
[22:49:29] *** wolfman2000 has quit IRC
[22:50:10] *** cool123 has joined ##java
[22:50:13] <freeone3000> lahwran: http://visualvm.java.net/applications_remote.html has a quick guide.
[22:50:42] *** srji has quit IRC
[22:50:51] <lahwran> is there no cli option that can be run from the server entirely?
[22:50:53] <freeone3000> lmatteis: JSPs require a magic source converter which only an EE server has.
[22:51:02] <lahwran> that you know of, I suppose I should add
[22:51:46] <freeone3000> Not that I know of.
[22:51:52] <pgib> freeone3000, I guess I wasn't very clear. My app has two entities: Foo and Bar. Foo may contain multiple Bars. According to REST guidelines, if I return a list of resources, I should also provide the URL to each resource. not: <foo><bars><bar id="1" name="funny"/><bar id="2" name="man"/></bars></foo>, but instead something like: <foo><bars><bar url="http://me.com/api/bars/1"/><bar url="http://me.com/api/bars/2"/></bars></foo> Does that make sense?
[22:52:16] <freeone3000> pgib: Sort of. What do you gain by supplying the URL?
[22:52:49] <pgib> otherwise the user needs to magically figure out where to find the children Bars
[22:52:54] <pgib> user=client
[22:53:43] <nucc1> is this kind of stuff legal/possible in java? http://pastie.org/1649069
[22:54:13] <sbalmos> pgib: I forget the exact syntax, but there is a Link type that you use, and JAX-RS automagically creates the links
[22:54:28] <freeone3000> Okay, good response. JAX-WS tends to return the first. You need something which returns the second. JAX-RS will probably be more useful to you, and most implementations (like jersey) can be coerced to output XML.
[22:54:32] <sbalmos> ~~ nucc1 tias
[22:54:32] <javabot> nucc1, Try it and see. You learn much more by experimentation than by asking without having even tried.
[22:54:47] <freeone3000> ~~ nucc1 javadoc String.format(*)
[22:54:47] <javabot> nucc1: http://is.gd/jg9eQ [JDK: java.lang.String.format(Locale,String,Object[])]; http://is.gd/jg9eT [JDK: java.lang.String.format(String,Object[])]
[22:55:20] <nucc1> sbalmos, that seems like the best way to ask about statements with side effects
[22:55:30] <nucc1> freeone3000, yea, i'm just using a shortcut :p
[22:55:39] <pgib> freeone3000, I'm unsure why you keep bringing up JAX-WS. I'm not using it, and don't plan to.
[22:55:49] <freeone3000> pgib: I thought you mentioned it. My bad.
[22:55:55] <freeone3000> You can probably ignore my side of this conversation, thenh.
[22:57:33] <lf94> I which vi had nano-like controls but kept the :commands
[22:57:38] *** cool123 has quit IRC
[22:57:38] <lf94> which/wish
[22:57:41] <lf94> Wow I am tired X_X
[22:57:42] <pgib> freeone3000, that is another case where the URLS are handy. Consider paging. <bars start="1" end="20" next="http://me.com/api/bars?start=21&end=40"/><bar .../><bar .../>...</bars>
[22:57:58] <pgib> sbalmos, thanks. will look around for "Link"
[22:58:14] *** askhl has quit IRC
[22:58:15] <sbalmos> pgib: Well... Just found it for RESTEasy. :/ http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/LinkHeader.html
[22:58:22] <sbalmos> Don't know about Jersey
[22:58:23] <pgib> freeone3000, I may have goofed and type WS, apologies
[22:58:26] <lmatteis> freeone3000: i've setup my jetty to load a war folder. if i change the .class file to a new class file - i've changed things in it - how do i make jetty show the changes without restarting the server:
[22:58:37] <sbalmos> redeploy
[22:59:26] <sbalmos> pgib: http://stackoverflow.com/questions/4325010/jax-rs-resolve-uri-of-linked-resources-on-the-server
[23:00:23] *** BSWolf has quit IRC
[23:00:43] <sbalmos> scratch that last one, sorry
[23:00:46] *** Zwei has joined ##java
[23:02:34] *** drindt has joined ##java
[23:04:27] *** askhl has joined ##java
[23:05:24] *** Behold has joined ##java
[23:05:35] *** aymak has joined ##java
[23:05:36] *** BSWolf has joined ##java
[23:07:31] *** tnzr has quit IRC
[23:08:20] *** BeholdMyGlory has quit IRC
[23:08:31] *** Xzil0 has joined ##java
[23:08:33] <hyppias> JAXB/toString question: http://pastebin.com/au04kr4t
[23:08:59] *** bangolio has joined ##java
[23:09:18] <bangolio> Hi, can a thread have more than one handler?
[23:09:36] *** Luc1fel has joined ##java
[23:10:18] *** glcrazy has quit IRC
[23:10:23] <cheeser> what?
[23:10:43] <cheeser> threads don't have handlers.
[23:10:56] *** Fisiu has quit IRC
[23:11:48] *** Charrit has joined ##java
[23:11:58] <Charrit> hi
[23:12:01] *** xiliax has quit IRC
[23:12:11] *** xiliax has joined ##java
[23:12:24] <pgib> sbalmos, http://jersey.java.net/nonav/documentation/latest/user-guide.html#d4e380 Looks like making the Resource classes @Singleton or @Stateless is actually a bad idea. Guess I need to punt injection in favor or JNDI :/
[23:12:48] <pgib> dblevins, ^^ that was meant for you
[23:13:21] <bangolio> hrm
[23:13:58] <bangolio> thanks then I guess :P
[23:14:00] *** bangolio has left ##java
[23:14:39] *** Fisiu has joined ##java
[23:15:06] <aymak> Any info on jdbc prepared statements handling parameters in subqueries?
[23:15:17] <dblevins> pgib: glanced at the doc but nothing is jumping out at me
[23:15:19] *** pipeep has joined ##java
[23:15:28] <aymak> jdbc4 just seems to skip them.
[23:16:08] <dblevins> pgib: which part is the part that says it's bad?
[23:16:18] <sbalmos> pgib: Unrelated, but the next section down mentions UriBuilder, which I completely forgot about
[23:16:20] *** X-Scale has quit IRC
[23:16:21] <pgib> dblevins, that code on line #7, it returns a new instances of another resource
[23:17:00] <pgib> sbalmos, yeah just now looking into UriBuilder stuff. which seems to support my "Screw JAX-WS's automatic marshaling" opinion
[23:17:00] *** c_axis has joined ##java
[23:17:31] <sbalmos> ah! Wait... Well, kinda
[23:17:37] <sbalmos> pgib: Section 6, declarative linking
[23:18:40] <dblevins> pgib: shouldn't be a problem if ItemContentResource doesn't need any Java EE injection
[23:18:59] <pgib> right, but the whole point of making the resources EJBs was to support injection ;)
[23:19:16] <dblevins> if it does you could make it a Singleton also and just return a ref to it
[23:19:32] <dblevins> @EJB ItemContentResource subsection;
[23:19:44] <pgib> ah good point
[23:20:00] <dblevins> then getItemContentResource() just becomes a normal getter
[23:20:04] *** barq has quit IRC
[23:21:35] <tieTYT> what has a bigger following: axis, jaxws, something I've never heard of?
[23:22:13] <wyvern`> ~~ tieTYT axis
[23:22:14] <javabot> tieTYT, what does that even *mean*?
[23:22:18] <wyvern`> hm, we lost that one i guess
[23:22:23] <wyvern`> axis is pain, generally
[23:22:31] <wyvern`> jaxws is slightly less painful
[23:23:03] <tieTYT> here's my current complaint: I'm trying to get a specific tag of the header. When I get down to it, I get an XMLStreamReader which is neither a stream nor a reader
[23:23:10] <tieTYT> getting the data out of it is a bitch
[23:23:11] *** rjohnson19 has joined ##java
[23:23:20] *** sebersole has quit IRC
[23:23:30] <wyvern`> ah, haven't tried doing that.
[23:23:39] <tieTYT> yeah it sucks
[23:23:58] <sbalmos> tieTYT: Axis is a *bitch*
[23:24:47] <Charrit> How can I retrieve the cell component in a custom tableCellRenderer?
[23:24:48] <Charrit> http://pastie.org/1649175
[23:25:12] <Charrit> I'm getting all the table instead the cell selected
[23:25:16] *** Johannes13 has quit IRC
[23:25:17] <wyvern`> tieTYT, here's how I got some stuff out of headers in jax ws: http://bazaar.launchpad.net/~genius.com/genius/trunk/view/head:/java/sf-api-connector/sf-soap-api-connector/src/main/java/com/teamlazerbeez/crm/sf/soap/ApexConnectionImpl.java
[23:26:20] <tieTYT> wyvern`: yeah, that looks shitty
[23:26:33] <tieTYT> i want header.toString() :T
[23:26:44] <wyvern`> partly because i'm ripping apart an undocumented xml format
[23:26:52] <tieTYT> not your code, their api
[23:27:13] <wyvern`> what can i say, it's sun's idea of an xml parser
[23:27:51] *** barq has joined ##java
[23:27:56] <sbalmos> o_O
[23:28:03] <freeone3000> I think that's the W3C SAX WG, though.
[23:28:39] <sbalmos> tieTYT: Looked into doing a JAX-WS Handler and rooting through the SOAPMessageContext? You can get down to the SOAPHeader eventually through that
[23:28:43] <freeone3000> Ah. Nevermind, that's XML-DEV mailing-list stuff.
[23:29:12] <tieTYT> sbalmos: get down to it as a shitty api or as a string?
[23:29:28] <sbalmos> Possibly both
[23:29:47] <sbalmos> Personally, I've never done a Handler. Never needed to. Just tossing suggestions
[23:30:48] *** fuzzygroove has joined ##java
[23:31:36] *** eyesUnclouded has quit IRC
[23:32:32] <sbalmos> time for me to go
[23:32:35] *** sbalmos has quit IRC
[23:34:11] *** Tashtego has quit IRC
[23:34:37] *** DerHorst has joined ##java
[23:35:07] *** cbeust has quit IRC
[23:35:12] *** LyQuid has quit IRC
[23:35:25] *** Teckla is now known as ZombieTeckla
[23:35:32] *** ZombieTeckla is now known as Teckla
[23:35:52] *** Behold has quit IRC
[23:36:48] *** zhulikas has quit IRC
[23:40:49] *** pantsman has joined ##java
[23:40:50] *** lmatteis has quit IRC
[23:40:53] <pantsman> j #csharp
[23:40:56] <pantsman> oops
[23:41:03] *** djbpython has quit IRC
[23:41:40] <pgib> Hmmm I might be able to limit which fields are serialized through JAXBContext
[23:42:01] *** aymak has left ##java
[23:42:02] <pgib> pantsman, that kind of language is offensive here
[23:43:07] <cheeser> ~obscenity
[23:43:07] <javabot> cheeser, obscenity is the crutch of inarticulate motherfuckers.
[23:43:08] *** echosystm has joined ##java
[23:43:19] <echosystm> whats the best way to mock JPA ?
[23:43:29] <pantsman> sorry, I just can't help it, it's my dirty pleasure... mmmm LINQ
[23:44:04] <pgib> echosystm, tell it that you'd rather use iBatis or plain JDBC. no seriously, what do you mean?
[23:44:13] <echosystm> in unit tests
[23:44:30] <echosystm> whats the best way to test your controllers etc. without having to have the database there
[23:44:56] <pgib> well, with the little bit of unit testing we do here, we use mock DAOs
[23:45:01] <yogi> echosystm: inject mocks?
[23:45:16] <echosystm> unit testing web applications seems pretty futile
[23:45:41] *** freeone3000 has quit IRC
[23:45:43] <echosystm> should i just be writing integration tests?
[23:45:48] <Charrit> How can I change the selected cell background implementing TableCellRenderer interface?
[23:46:09] <Charrit> I can't retrieve the cell component
[23:46:10] <Charrit> http://pastie.org/1649175
[23:46:23] <pgib> all our JPA code is behind DAO objects "StudentDAO.find(long id) etc.." so, we just pass mock DAOs into our Controllers (EJBs) instead of the JPA-backed ones
[23:49:07] *** Steve^ has quit IRC
[23:49:18] *** Fx21 has joined ##java
[23:49:28] *** PhoenixSTF has quit IRC
[23:49:31] <echosystm> at some point you need to have integration tests though
[23:49:42] <echosystm> ie. how do you know your DAOs are having the right effect on the db?
[23:49:53] <echosystm> so why not just write all your tests as end-to-end integration tests?
[23:49:57] <cheeser> you test your DAOs
[23:50:25] <cheeser> because isolating failures becomes more difficult the wider net you cast.
[23:50:34] <Sou|cutter> cheeser: eloquently put
[23:50:39] <cheeser> danke
[23:51:06] <echosystm> another thing... have you seen arquillian?
[23:51:11] <cheeser> yes
[23:51:19] <echosystm> how is that not integration testing?
[23:51:32] *** robbyoconnor has quit IRC
[23:51:40] *** wchun has joined ##java
[23:52:18] *** Ch30ps has quit IRC
[23:52:35] *** cool123 has joined ##java
[23:52:57] <echosystm> i mean, youre not unit testing your servlets, youre loading them into a container and then testing that
[23:53:37] *** jdolan has quit IRC
[23:53:44] <cheeser> sure
[23:54:04] *** Najjah has joined ##java
[23:55:25] *** LordDoskias has quit IRC
[23:55:32] *** cbeust has joined ##java
[23:55:40] <echosystm> so does that mean arquillian is actually for integration testing?
[23:56:01] <dmlloyd> call it what you want
[23:56:05] <dmlloyd> testing is testing to me
[23:56:07] <Najjah> hello everyone. I hope anyone can help me. I have an abstract class containing a Properties variable. This variable is setup only on the extended class. Then I try to use this variable in a method which is implemented on the abstract class. I got a null pointer exception and I believe it's happening because I'm setting the variable on the extended class. Anyone can confirm and provide a solution?
[23:56:11] *** pipeep has quit IRC
[23:56:30] <cbeust> ~~ Najjah pastebin
[23:56:30] <javabot> Najjah, http://eugeneciurana.com/pastebin - Paste the final url after you've pasted your stuff there.
[23:56:39] *** riotz has quit IRC
[23:57:14] *** hyppias has quit IRC
[23:58:22] *** pulse00 has quit IRC
[23:58:26] <Najjah> http://eugeneciurana.com/pastebin/pastebin.php?show=43936

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