Switch to DuckDuckGo Search
   March 5, 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:02:20] *** kbotnen has joined ##java
[00:04:39] <gener1c> integers can still be compared to one another just the same as strings right?
[00:04:52] <gener1c> "1" > "2" false
[00:05:01] <gener1c> "10" < "20" true
[00:05:13] <gener1c> and so on
[00:07:06] *** cythrawll has quit IRC
[00:07:06] <gener1c> nah i cant
[00:07:06] <gener1c> :S
[00:07:06] <cbeust> ~ gener1c tias
[00:07:06] <javabot> cbeust, what does that even *mean*?
[00:07:08] <cbeust> ~~ gener1c tias
[00:07:08] <javabot> gener1c, Try it and see. You learn much more by experimentation than by asking without having even tried.
[00:07:29] *** rchern has joined ##java
[00:08:02] <gener1c> the problem is
[00:08:11] <gener1c> if i give an int as a key to a node
[00:08:29] <gener1c> how do i override toString and return int as a string?
[00:08:36] <gener1c> just do return ""+int ?
[00:08:40] *** Clete2 has quit IRC
[00:09:02] <cbeust> That's one way
[00:09:13] <gener1c> int doesnt have .toString
[00:09:14] <gener1c> so i cant do
[00:09:28] <cbeust> Also new Integer(n).toString()
[00:09:36] <gener1c> oh
[00:10:03] *** armyriad has quit IRC
[00:10:13] <kbotnen> why do you compare "1" against "2" in the first place?
[00:10:36] <gener1c> long story
[00:10:43] <kbotnen> its really strings, which you try to reassign a numberical meaning to.
[00:10:44] <kbotnen> ok.
[00:10:50] <gener1c> i am writing an avl tree and i need strings for testing
[00:11:11] <gener1c> following so many nodes with numbers is pretty tiring
[00:11:12] *** Clete2 has joined ##java
[00:11:13] <cbeust> Note that you can compare strings lexicographically with "".comparesTo(""). But that's not the same as integer comparison
[00:11:37] <gener1c> i guess ill have to do it
[00:11:50] <gener1c> because the btr insertion is numeral
[00:11:52] <kbotnen> or do the trick with the Integer object.
[00:13:43] *** choongii has quit IRC
[00:14:22] *** armyriad has joined ##java
[00:15:02] *** xianny has joined ##java
[00:15:07] <Wyvern666> hey why the read() method in Reader returns an int and not a character?
[00:15:24] *** ldh has quit IRC
[00:15:28] *** anaconda has quit IRC
[00:15:39] <Wyvern666> and InputStreamReader the same read()
[00:15:51] *** cschneid has quit IRC
[00:16:17] *** cschneid has joined ##java
[00:18:09] *** anaconda has joined ##java
[00:18:56] <mapreduce> Wyvern666: Because they use -1 to mean end of the stream, iirc.
[00:19:54] *** Johannes13 has joined ##java
[00:20:09] *** Lone_Rifle has left ##java
[00:20:19] *** lt232 has quit IRC
[00:20:37] <Wyvern666> thanks
[00:20:56] *** hex` has joined ##java
[00:21:03] *** youdonotexist has quit IRC
[00:21:32] *** cbeust has quit IRC
[00:22:57] *** blackswan has joined ##java
[00:23:19] *** Rayne has quit IRC
[00:23:26] <blackswan> i am having a problem with perl blowing up in perl_destruct when I try to use SWIG to create a member of a C++ class which uses JNI to create a JVM.
[00:23:40] <blackswan> do I just need to shoot myself in the head instead?'
[00:25:35] *** youdonotexist has joined ##java
[00:26:00] *** bitshuffler_ has quit IRC
[00:27:07] *** mhahe has joined ##java
[00:27:13] *** meeper has joined ##java
[00:36:14] *** jesmon has quit IRC
[00:37:34] <cheeser> yes
[00:39:03] *** Johannes13 has quit IRC
[00:39:30] <blackswan> thx. will do.
[00:39:52] <Cher> Why do you want to shoot yourself in the head? It's quite uncommon. When C++ is involved, people usually shoot themselves in the foot.
[00:40:18] <Fanook> sure, but the bullets usually ricochet and hit you in the head
[00:40:51] <blackswan> neither the C++ nor the Java were my idea.
[00:41:02] <TomyLobo> is there something that has readLine AND unread
[00:41:13] *** Auv5 has quit IRC
[00:41:26] <TomyLobo> a Reader, to be precise
[00:41:31] <Cher> Perl will just as happily load the gun, offer you a drink to steady your nerves, and help you aim like C++ or Java will do :)
[00:41:37] *** floppyears has joined ##java
[00:42:23] <blackswan> drinking. that's what i'll do. i'll take up drinking. *then* shoot myself in the head.
[00:42:38] <floppyears> hi guys, do you know if there are any good open source or free plugins, modules or classes to do permission/role management? Similar to how rails has plugins/gems to handle permissions?
[00:43:27] *** cbrock has quit IRC
[00:44:31] *** t0rc has quit IRC
[00:44:51] <cheeser> ~jaas
[00:44:51] <javabot> cheeser, jaas is Java Authentication and Authorization Services, a standard java API with pluggable authorization and access control modules. Authorization modules exist for various systems such as LDAP, Kerberos, NTLM, simple password files, etc. See http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html for details.
[00:44:59] <cheeser> ~spring security
[00:44:59] <javabot> cheeser, what does that even *mean*?
[00:45:02] *** cbeust has joined ##java
[00:45:03] <cheeser> ~acegi
[00:45:03] <javabot> cheeser, what does that even *mean*?
[00:45:06] <cheeser> javabot: you suck
[00:45:06] <javabot> Thanks for noticing!
[00:45:31] <cheeser> goddammit wabash
[00:45:50] <dmlloyd> noting that jaas is completely worthless for dovetailing into network authentication like SASL, NTLM, or any other challenge/response mech
[00:46:07] <cheeser> which is a shame really
[00:46:23] <dmlloyd> they tried to fix it with jsr-196 (iirc) but that's even more useless
[00:46:43] <cheeser> a common problem with JSRs
[00:46:55] <dmlloyd> the language is so utterly abstract and disconnected from reality
[00:46:56] <floppyears> thank you cheeser
[00:47:03] <cheeser> sure
[00:47:23] <dmlloyd> all I can say is all the JSRs whose expert groups I am on, are not like that!
[00:47:24] <dmlloyd> (yet)
[00:47:34] <cheeser> of course!
[00:47:36] * dmlloyd is changing the system!@!
[00:47:38] * dmlloyd not really
[00:47:54] *** pht has quit IRC
[00:47:54] *** jaskal has quit IRC
[00:48:37] <floppyears> I will be working on a java webapp, and I already have user authentication taken care of. I just want to be able to define roles such as: students can view/edit xyz, teachers can add/delete xy
[00:49:03] <TomyLobo> <dmlloyd> the language is so utterly abstract and disconnected from reality
[00:49:03] <TomyLobo> finally someone agrees with me
[00:49:26] *** Charrit has quit IRC
[00:49:27] <dmlloyd> not Java you ninny
[00:49:33] <dmlloyd> I'm talking about the language used in JSRs
[00:49:33] <TomyLobo> :D
[00:51:06] <TomyLobo> yeah
[00:51:07] *** frangiz has quit IRC
[00:51:14] <TomyLobo> but it fits so well
[00:51:24] <cheeser> it doesn't really.
[00:51:41] <cheeser> if it didn't fit with reality it wouldn't as well as it does
[00:51:52] <cheeser> but i know you're just here to troll and whine so i'll let it go.
[00:51:53] <cheeser> 8^)=
[00:51:58] <TomyLobo> right now my reality needs a Reader that can both readLine and unread
[00:52:06] <TomyLobo> however, there isn't one in the API
[00:52:10] <TomyLobo> so i'd have to make my own#
[00:52:11] <Cher> TomyLobo: Why not just code one yourself...
[00:52:29] <cheeser> because that's more work than whining
[00:52:50] *** wessel has joined ##java
[00:53:06] *** Auv5 has joined ##java
[00:53:31] *** Lone_Rifle has joined ##java
[00:54:34] *** Fanook has quit IRC
[00:54:46] <Lone_Rifle> ~javadoc HashTable
[00:54:47] <javabot> Lone_Rifle: http://is.gd/eDKwXo [JDK: java.util.Hashtable]
[00:55:04] *** psst has quit IRC
[00:55:05] <wessel> I wish to create a "Best" data structure, which is a sorted list of k elements, when the list is not yet full, the elements are simply added to the list, then the list is full, the element with the lowest score is thrown out
[00:55:14] <wessel> what data structure should I use for this?
[00:55:28] <TomyLobo> wessel priority queue :D
[00:55:44] <cheeser> subclass list
[00:55:49] <cheeser> override add
[00:55:49] *** freeone3000 has joined ##java
[00:55:56] *** glcrazy has quit IRC
[00:56:04] <Lone_Rifle> isnt there a sorted list?
[00:56:04] *** fisted_ has joined ##java
[00:56:05] <cheeser> oh, but it's sorted.
[00:56:14] <cheeser> there's a SortedSet but not List
[00:56:20] <wessel> well, yes I like it to be sorted
[00:56:22] <TomyLobo> one plus for java: it actually has one: http://download.oracle.com/javase/6/docs/api/java/util/PriorityQueue.html
[00:57:02] <wessel> why does a queue help me here? because I want it to never get bigger then size k
[00:57:02] <Lone_Rifle> you have to implement Comparable<E> though, if memory serves
[00:57:06] <wessel> can a queue do this?
[00:57:19] <cheeser> yes and no
[00:57:29] <Lone_Rifle> or rather, your elements have to implement Comparable<E>. I can
[00:57:32] <Candle> wessel: Have a look at teh javadoc for some of the queue implementations.
[00:57:45] <Lone_Rifle> I can't check now because the OS/client/PC i'm on is crap
[00:57:54] <TomyLobo> wessel a priority queue lets you remove the lowest element
[00:58:06] <TomyLobo> in what was it? constant time?
[00:58:13] <cheeser> personally, i'd subclass List, override add(), sync, insert sort, if size > k remove(0);
[00:58:21] <cheeser> List does
[00:58:36] <wessel> its possible to insert with log n, average time I believe
[00:58:39] <wessel> when using stacks
[00:58:50] <TomyLobo> cheeser PQ has O(log n) insertion, your list has O(n)
[00:58:53] *** fisted has quit IRC
[00:58:56] <cheeser> inserts are O(1) on inserts
[00:59:01] <Lone_Rifle> List is an interface TomyLobo
[00:59:12] <Lone_Rifle> LinkedList is O(1)
[00:59:12] <cheeser> 8^)=
[00:59:13] <TomyLobo> Lone_Rifle i said his list
[00:59:28] <cheeser> you still have to traverse on a PQ
[00:59:31] <Lone_Rifle> k whatever, i can't scroll up on this client
[00:59:51] <Lone_Rifle> wessel, will the items always be unique?
[00:59:55] <Lone_Rifle> s/items/elements
[00:59:56] <TomyLobo> no ctcp version either?
[01:00:01] <Lone_Rifle> you can try..
[01:00:03] <wessel> cheeser how can you have O(1) on insert? :-/ does the insert include the find and delete element with lowest score?
[01:00:03] <TomyLobo> what is it? telnet.exe?
[01:00:13] <TomyLobo> wait, that would have scrolling
[01:00:13] <Lone_Rifle> http://www.kolibrios.org
[01:00:13] <cheeser> if you don't need indexed access, i'd use TreeSet instead of ArrayList
[01:00:33] <cheeser> wessel: insert on a stack? you add to the end/top. simple
[01:01:16] <Lone_Rifle> ~javadoc Set#get
[01:01:16] <javabot> I don't know of any documentation for Set#get
[01:01:21] *** grh2g has joined ##java
[01:01:26] <cheeser> ~javadoc Set.get(*)
[01:01:26] <javabot> I don't know of any documentation for Set.get(*)
[01:01:28] <wessel> Lone_Rifle: I think so
[01:01:30] <TomyLobo> treeset has logn lookup
[01:01:33] <cheeser> no soup for you!
[01:01:43] <Lone_Rifle> SortedSet or TreeSet, as cheeser recommends
[01:01:43] <TomyLobo> compared to constant time lookup on a PQ
[01:01:48] <wessel> I only need the result when I'm done
[01:01:56] <wessel> I want to get the k best elements
[01:02:11] <TomyLobo> well constant time poll()
[01:02:14] <wessel> after observing n elements that come 1 by 1 in a stream like manner
[01:02:44] <cheeser> TreeSet.last() should be O(1)
[01:02:50] <grh2g> very noob ish question and this might not be the bast place to ask but, what is the difference between java and javascript? i just looked at some javascript and the syntax looks the same
[01:02:54] <cheeser> and TreeSet.first()
[01:03:04] <Lone_Rifle> ~~grh2g javascript
[01:03:04] <javabot> grh2g, Java is to javascript as ham is to hamster. http://www.ericgiguere.com/articles/javascript-is-not-java.html See ##javascript
[01:03:19] <wessel> ham and hamster, haha
[01:03:26] *** arborist has quit IRC
[01:03:31] <TomyLobo> need to copy that for nolyc
[01:03:35] *** io2 has quit IRC
[01:04:13] <TomyLobo> C is to C++ as Java is to Javascript etc :D
[01:04:34] *** kinks has joined ##java
[01:04:40] <grh2g> javabot: thnx
[01:04:41] <javabot> grh2g, what does that even *mean*?
[01:04:49] <Lone_Rifle> grh2g, javabot is a bot
[01:04:51] <kbotnen> javascript is a clientside scripting language, java is not.
[01:04:56] <grh2g> just realised that
[01:05:02] <grh2g> i did say i was a noob
[01:05:09] <Lone_Rifle> it contains a lot of commands that could come in handy to you
[01:05:11] <kbotnen> learning by doing. thats good :)
[01:05:16] <TomyLobo> kbotnen google Node.js and java applets
[01:05:42] <Lone_Rifle> ~tutorials and ~javadoc can come in handy if you need those
[01:05:48] *** Carnage\ has quit IRC
[01:06:23] <wessel> cheeser: can you wrap up? tree is better then queue? to get the k best elements, after observing n elements that come 1 by 1 in a steam like manner?
[01:06:59] <wessel> I think tree is better, when I look at the run time, but I find it hard to estimate
[01:07:02] *** fisted_ is now known as fisted
[01:07:05] <Lone_Rifle> grh2g: ~ask , ~homework , ~testcase and ~pastebin should more or less cover eti
[01:07:10] <wessel> since I want fast insert
[01:07:13] <Lone_Rifle> etiquette. I can
[01:07:26] <TomyLobo> wessel tree behaves worse, runtime-wise
[01:07:27] <Lone_Rifle> I can't believe this client can't send lines longer than n characters.
[01:07:37] <TomyLobo> than priority queue
[01:07:41] <wessel> TomyLobo: how do you see this?
[01:07:46] <TomyLobo> this thing was *made* for this task
[01:08:17] <Lone_Rifle> wessel, should you go down the priority queue route, read the javadoc first
[01:08:19] <TomyLobo> priority queues were invented for the sole task of retrieving the lowest element from an otherwise not completely ordered set
[01:08:23] <Lone_Rifle> ~javadoc PriorityQueue
[01:08:23] <javabot> Lone_Rifle: http://is.gd/k6R5Y [JDK: java.util.PriorityQueue]
[01:08:29] *** rtdos has joined ##java
[01:09:09] <grh2g> Lone_Rifle: showing my noobishness even more here, but i have no what that means
[01:09:18] <Lone_Rifle> well, type the commands for yourself
[01:09:43] <Lone_Rifle> start with ~tutorials, if you so wish
[01:09:46] <Lone_Rifle> ~tutorials
[01:09:46] <javabot> Please see http://download-llnw.oracle.com/javase/tutorial/
[01:09:50] <cheeser> PQ has the same performance as a tree for removing from either end.
[01:09:50] <wessel> Lone_Rifle: Implementation note: this implementation provides O(log(n)) time for the enqueing and dequeing methods (offer, poll, remove() and add); linear time for the remove(Object) and contains(Object) methods; and constant time for the retrieval methods (peek, element, and size).
[01:10:02] <grh2g> ~tutorials
[01:10:03] <javabot> Please see http://download-llnw.oracle.com/javase/tutorial/
[01:10:24] <grh2g> Lone_Rifle: oh i see, they are commands for the bot
[01:10:33] <Lone_Rifle> wessel: there should be something written about how it prioritises elements
[01:10:35] <TomyLobo> cheeser didnt you pay attention in your algorithms class?
[01:10:36] <wessel> I guess I want to enque n elements, en deque k
[01:10:40] <Lone_Rifle> grh2g: correct
[01:10:44] <wessel> so I think a tree is faster :-/
[01:10:57] <Lone_Rifle> TomyLobo, i wouldn't venture so far as that, if i were you
[01:11:15] <grh2g> Lone_Rifle: thnx
[01:11:23] <Lone_Rifle> no problems. welcome to ##java
[01:11:24] <cheeser> TomyLobo: i did. *and* i read the javadoc.
[01:11:43] <TomyLobo> wait... java didnt pay attention in its algorithms class
[01:11:43] *** grh2g has left ##java
[01:11:46] <cheeser> Implementation note: this implementation provides O(log(n)) time for the enqueing and dequeing methods (offer, poll, remove() and add); linear time for the remove(Object) and contains(Object) methods; and constant time for the retrieval methods (peek, element, and size).
[01:12:20] <Lone_Rifle> TomyLobo: you're free to read the source up to explain why the javadoc disagree
[01:12:29] <Lone_Rifle> s with your expectations
[01:12:35] <cheeser> and you're free to cut out the wise ass comments
[01:12:40] <Lone_Rifle> i wish i could, but KolibriOS won't let me
[01:13:17] <wessel> ye, so a sorted tree is faster, since you same insert time, and faster get best k time
[01:13:23] <wessel> also the tree needs less memory
[01:13:27] <wessel> it just stores k elements
[01:13:29] <wessel> not n
[01:13:56] <TomyLobo> it's not faster, but apparently as fast
[01:14:06] *** bearded_oneder has joined ##java
[01:14:12] <wessel> should be faster! :(
[01:14:16] <TomyLobo> and how would a tree be smaller if both contain the same elements
[01:14:17] <cheeser> i suspect the PQ uses both a queue and a tree internally.
[01:14:41] <wessel> TomyLobo: if you observe n elements
[01:14:45] <wessel> and you wish to get the best k
[01:14:47] *** chomping has joined ##java
[01:14:55] <wessel> you enque n elements, then deque k elements
[01:14:55] <cheeser> call first() k times
[01:14:56] <wessel> right?
[01:15:19] <TomyLobo> wessel you'd put k times 0 into the queue
[01:15:32] <wessel> what?
[01:15:32] <cheeser> so 0 times?
[01:15:37] <wessel> that makes no sense..
[01:15:48] <TomyLobo> you put k zeros into the PQ
[01:15:49] <TomyLobo> dammit
[01:15:56] <cheeser> uh. why?
[01:16:01] <wessel> ye why?
[01:16:03] <Lone_Rifle> haven't been following and can't scroll... is first() O(log n) ?
[01:16:07] <TomyLobo> then, for every element, you put the new element into the queue and poll()
[01:16:12] <cheeser> Lone_Rifle: lg n yeah
[01:16:21] <cheeser> uh. why?
[01:16:24] <wessel> let me give an example
[01:16:36] <wessel> lets say you observe 1 4 5 2 3
[01:16:44] <wessel> where lower number is better
[01:16:46] <cheeser> well, time to go read the bed time book for the girls.
[01:16:49] <cheeser> have fun storming the castle.
[01:16:50] <TomyLobo> i know it can be optimised by inserting the first k elements into the PQ instead of the zeros
[01:16:58] <wessel> so 5 elements, and lets say I want to get the best 3, sorted
[01:17:00] <TomyLobo> but zeros make for easier explanation
[01:17:07] <Lone_Rifle> night
[01:17:25] <wessel> I need to enque(1) enque(4) enque(5) enque(2) enque(3)
[01:17:38] <wessel> en then poll(), poll(), poll()
[01:17:40] <wessel> right?
[01:17:57] *** magentar has quit IRC
[01:18:18] <wessel> that will result in 1 2 3
[01:18:31] <cheeser> that's what i'd expect.
[01:18:45] <wessel> so you have to store n elements in memory
[01:18:57] <cheeser> of course
[01:19:04] <wessel> but TomyLobo just said k :P
[01:19:09] <cheeser> where n < bounded size
[01:19:19] <cheeser> i think it's safe enough to ignore his "advice"
[01:19:30] *** xeer has quit IRC
[01:19:48] <TomyLobo> for (i = 0; i < n; ++i) { if (i >= k) pq.poll(); pq.add(...element...); }
[01:20:12] <cheeser> you don't enfore the size outside the container.
[01:20:16] <cheeser> offer()/add() does that.
[01:20:23] <cheeser> anyway, bbaib.
[01:20:45] <wessel> TomyLobo: if the best element, is observed last, you will store n elements in your queue
[01:21:01] <TomyLobo> wessel not at the same time
[01:21:19] <wessel> what?
[01:21:38] <TomyLobo> for (i = 0; i < n; ++i) { pq.add(...element...); if (i >= k) pq.poll(); }
[01:21:39] <TomyLobo> slight mistake
[01:21:44] *** terranova has joined ##java
[01:21:46] <TomyLobo> didnt follow my own algo :)
[01:22:06] <wessel> for example, you observe 5 2 3 4 1
[01:22:10] <TomyLobo> there are only ever at most k+1 elements in the queue
[01:22:16] <wessel> where lower is better, so 1 is best
[01:22:17] *** Lone_Rifle has quit IRC
[01:22:24] <wessel> why?
[01:22:26] <wessel> k+1? :-/
[01:22:37] <TomyLobo> if lower is better, you need an according comparator
[01:22:58] <wessel> why max k+1 elements?
[01:23:03] <wessel> you remove stuff?
[01:23:10] <wessel> as a mid result?
[01:23:12] <TomyLobo> because i add before polling
[01:23:19] <TomyLobo> so it's k+1 briefly
[01:23:48] <TomyLobo> if less is better, go with the tree
[01:23:49] <wessel> so you keep track of the worst element in the queue
[01:24:05] <TomyLobo> otherwise you need a comparator, which means more code and probably worse runtime behaviour
[01:24:07] <wessel> and then when you get a better then worse element you add it, and then poll, to get rid of the worst ?
[01:24:51] <TomyLobo> wessel a priority queue always "knows" which element is the least
[01:24:55] <wessel> yes, I go with what cheeser said, I understand his argument :P
[01:25:18] <wessel> TomyLobo: yes but that's really slow
[01:25:21] <Cher> Does someone have a URL to why it was decided to have 0 as the first enum ordinal instead 1 + map null to 0?
[01:25:23] <wessel> to remove all the time elements
[01:25:32] <wessel> I don't need an intermediate result
[01:25:45] <wessel> I just need the best k, after I'm done observing
[01:25:47] *** Speed` has quit IRC
[01:26:35] <TomyLobo> lagspike
[01:26:47] <TomyLobo> what do you mean by slow?
[01:27:03] <TomyLobo> getting the lowest element is O(1)
[01:27:04] <wessel> I just need the best k, after I'm done observing
[01:27:21] <wessel> ye but you need the highest (worst)
[01:27:42] <wessel> you remove the highest
[01:27:47] <TomyLobo> removing it is doable in O(log n), but for some reason the java people chose not to
[01:27:47] *** blackswan has left ##java
[01:28:31] <wessel> ye, so when k is a small number compared to n, you are doing a lot of removing
[01:28:49] <wessel> whereas with a tree, you only add if your element is better then the worst
[01:29:19] <wessel> and when you done observing, you simply get all the elements in the tree, which is also O(1)
[01:29:49] <wessel> well O(1) for each element, so O(k) if you like
[01:30:29] *** tewecske has quit IRC
[01:32:36] *** EricInBNE has joined ##java
[01:34:24] <cheeser> TomyLobo: no. getting the lowest element is O(lg n)
[01:35:14] <TomyLobo> wrong, but you're right :)
[01:35:27] <cheeser> no, it's not wrong. PQ's docs are very clear
[01:35:30] <TomyLobo> removing it is indeed O(lg n), oops
[01:35:43] *** Radu-Mihail has quit IRC
[01:35:47] *** shaunren has quit IRC
[01:35:49] <TomyLobo> yes they are: peek is O(1)
[01:38:59] <TomyLobo> hmm fusion tree, O(sqrt(log n)) add/poll
[01:39:25] <TomyLobo> O(1) peek
[01:40:28] *** gelignite has quit IRC
[01:42:29] *** poccha has joined ##java
[01:42:40] <TomyLobo> wessel you can do the same optimization for the PQ
[01:42:56] <TomyLobo> you have O(1) peek()
[01:44:29] <wessel> I'm using SortedMap at the moment
[01:44:42] *** PrimeZ has quit IRC
[01:44:47] <wessel> so far so good, bit tricky to get the best k, very easy to get the best 1
[01:45:14] <wessel> also very easy to get the worst, so you never have more then k elements in memory
[01:46:03] *** Wyzard has joined ##java
[01:46:08] *** davidmogar has joined ##java
[01:46:59] <davidmogar> hello. I need to set the color in a canvas. I have a String variable containing a color and I need to something like Color.thatstring. Is this posible?
[01:47:27] *** Symbi0nt|GER has quit IRC
[01:49:22] <TomyLobo> a map? so you have more than just keys?
[01:49:22] <TomyLobo> otherwise you could just use a set
[01:50:10] <wessel> I have the index of the element and the score
[01:50:24] <TomyLobo> davidmogar what does your color look like?
[01:50:58] <davidmogar> TomyLobo: do it, thanks anyway
[01:51:44] *** wessel has quit IRC
[01:52:02] <TomyLobo> wessel ah
[01:53:08] <TomyLobo> so not just a bunch of scores or score objects then?
[01:54:12] <Wyvern666> what are the proposits of wrapping System.out with OutputStreamWriter?
[01:55:57] *** bitterman has quit IRC
[01:56:54] *** lamdk has quit IRC
[01:56:57] <freeone3000> Not a lot. It's already a PrintStream.
[01:57:41] *** push[RAX] has quit IRC
[01:57:50] *** kriko has joined ##java
[01:58:31] *** DJClean has quit IRC
[01:59:30] <Wyvern666> [freeone3000] but if normally out is a 8-bit stream, when you wrap with OutputStreamWriter you have a 16-bit stream?
[01:59:58] *** xiliax has quit IRC
[02:00:25] <Wyvern666> so then you can use a PrintWriter, but i dont see for what can be useful
[02:01:20] <freeone3000> That doesn't make sense. Things are either byte streams or character streams. A PrintStream is already a character stream.
[02:01:24] *** push[RAX] has joined ##java
[02:01:43] <whoever> what the... i am gettting name cannot be resolved with String name = files[x].getName();
[02:01:59] <freeone3000> whoever: What's the type of 'files'?
[02:02:36] *** davidmogar has quit IRC
[02:02:52] <whoever> freeone3000: `it is a FIle[] but getName is a string
[02:05:30] *** lahwran has quit IRC
[02:05:30] <Wyvern666> [Free_Bullets] if PrintStream is made to add funcionality to OutputStream, that are not byte streams?
[02:05:48] <Wyvern666> all this is confusing me xD
[02:05:54] *** Cher has quit IRC
[02:05:57] *** kercyr has quit IRC
[02:06:18] *** Matic`Makovec has quit IRC
[02:06:24] <freeone3000> Wyvern666: OutputStream and DataOutputStream are byte streams. PrintStream is a character stream. PrintWriter is a Writer, which is a character writer. (Writers are generally buffered, Streams generally are not.)
[02:06:58] *** jcp has quit IRC
[02:07:36] <whoever> freeone3000: i am reading one name from it files[]
[02:07:38] *** jcp has joined ##java
[02:08:00] *** lahwran has joined ##java
[02:08:10] <freeone3000> whoever: Something you mentioned isn't lining up. Could you post your code?
[02:08:20] <whoever> ya
[02:08:27] <Wyvern666> [freeone3000] so there is no difference in using out thats is a PrintWriter, with wraping it in a OutputStreamWriter
[02:08:33] *** terranova has quit IRC
[02:09:08] <freeone3000> Wyvern666: You lose printf(), and other methods defined on PrintStream but not OutputStreamWriter.
[02:10:30] <whoever> freeone3000: http://pastebin.com/eVetyyiQ
[02:10:58] *** Sliker has quit IRC
[02:11:11] <RLN> the hell is this " Object String;"
[02:11:51] *** epalm has quit IRC
[02:12:16] *** Sliker has joined ##java
[02:12:31] <RLN> whoever, this doesn't make sense " Object String;"
[02:12:47] <Sou|cutter> also, whoever is a terrible nickname
[02:13:13] <freeone3000> whoever: You misbraced. Put all statements in the if in brackets.
[02:13:58] *** scottj has joined ##java
[02:14:34] <Wyvern666> [freeone3000] can you tell me in this link for what is wrapping it? http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Supplements/Chapter09/charIO.html
[02:14:46] <Wyvern666> normally i dont se that kind of code
[02:15:03] <freeone3000> Wyvern666: Because normally people don't code to the "new introductions in Java 1.1".
[02:15:29] *** epalm has joined ##java
[02:15:43] <RLN> lmao, Wyvern666 use NIO like a real man
[02:15:47] <Wyvern666> so that is too old?
[02:16:14] <freeone3000> That's amazingly old, so the information is not proper, but the code is still valid.
[02:16:34] <Wyvern666> so in that JDK wrapping whas for something
[02:16:41] *** PigFlu has quit IRC
[02:16:47] <Sou|cutter> that's 12 years old, java has advanced a bit
[02:17:04] <whoever> freeone3000: i am getting a folder name, so how is object string not a object since i am only get a single name
[02:17:36] <freeone3000> whoever: Because that line doesn't do anything.
[02:17:38] <RLN> whoever, every String is an object already
[02:18:02] <freeone3000> whoever: Okay. To be more precise, it declares an Object named "String" which is never used.
[02:19:05] <whoever> freeone3000: but not in this class i am going to use it in another class
[02:19:14] <freeone3000> whoever: Scope doesn't work like that.
[02:20:05] <Wyvern666> [RLN] what you call NIO? that stands for "New I/O"?
[02:20:21] <RLN> Wyvern666, yes
[02:20:32] <Wyvern666> so there was important changes in IO
[02:20:58] *** poccha has quit IRC
[02:21:07] <RLN> it supports async and whatnot
[02:21:16] <RLN> i like it much better
[02:21:16] <whoever> freeone3000: than i must have misunderstood somthing then, to get a class obj don't i need to put it in an object then send it to the new class object ?
[02:21:23] <freeone3000> whoever: No.
[02:22:16] <whoever> freeone3000: can you explain
[02:22:29] *** hex` has quit IRC
[02:22:39] <freeone3000> ~oo
[02:22:39] <javabot> The term "object-oriented" has different meaning to different people; in a Java context it refers to a combination of polymorphism, interface inheritance, and behavioral inheritance. See http://java.sun.com/docs/books/tutorial/java/concepts/ for more info. In general, saying things like "good object-oriented design" doesn't really mean anything and is not conducive to constructive conversation.
[02:22:44] <Wyvern666> [RLN] if NIO is java.nio, the other IO is still in java.io package?
[02:22:54] <RLN> Wyvern666, yes lol
[02:23:02] <Wyvern666> the usual code is using java.io
[02:23:15] <RLN> Wyvern666, you can still use FileInputStream or something
[02:23:21] <RLN> but then you just get the FileChannel wrapper
[02:23:41] <RLN> which is lovely
[02:23:52] <RLN> and working with ByteBuffer is a treat
[02:24:42] <RLN> it feels more native, you can have pointers and such to offsets in the bytebuffer
[02:25:48] <Wyvern666> [RLN] i think i had never seen code using nio
[02:26:00] *** PigFlu has joined ##java
[02:26:02] *** alexandernst has joined ##java
[02:26:04] *** zemanel has quit IRC
[02:26:44] *** chomping has quit IRC
[02:30:38] *** ds_creamer has joined ##java
[02:31:01] *** KWhat_Work has quit IRC
[02:31:29] *** zatan has quit IRC
[02:32:07] *** nchaimov has joined ##java
[02:33:04] *** caverdude has joined ##java
[02:33:09] <carutsu> C++ developer here, how do I pass something so that it can be changed in a function and that change is kept?
[02:34:04] <freeone3000> carutsu: You can't do it otherwise.
[02:34:34] *** chomping has joined ##java
[02:34:41] <carutsu> freeone3000: may be, would end up way uglier but certanly doable
[02:36:09] *** [[thufir]] has joined ##java
[02:36:19] <freeone3000> carutsu: Okay. Alternate explaination. Java's "Object o = new Object();" is the same as "object* o = new object;". Java only does pass-by-value, so the only way to get that into a function is to pass the pointer to the object by value.
[02:36:27] *** Luc1fel has quit IRC
[02:36:40] <freeone3000> carutsu: 'final Object o;" is the same as "object * const o;", in that the reference is final, not the object.
[02:36:53] *** emet has joined ##java
[02:37:39] <carutsu> freeone3000: oh, so any non-primitive passed is passed by reference
[02:37:55] *** defascat has joined ##java
[02:38:02] <carutsu> ?
[02:38:14] <freeone3000> If you wish to interpert it as such, sure. (Pedantically, the reference to the non-primitive is passed by value, but it results in the same outcome.)
[02:38:39] *** Skyec has joined ##java
[02:38:40] <carutsu> sure, I pass by value a reference to an object
[02:38:47] <carutsu> got it! thanks, freeone3000
[02:47:17] *** guidj0s has joined ##java
[02:49:37] *** E-sense has quit IRC
[02:50:00] *** Free_Bullets has left ##java
[02:51:28] <ds_creamer> The Really Big Index is awesome
[02:51:45] <ds_creamer> no wonder it's so quiet
[02:52:04] <ds_creamer> it gave me the example code i needed to see regarding KeyEvents
[02:55:26] *** dwilliamii has joined ##java
[02:56:24] <ds_creamer> so, are keyTyped, keyPressed, and keyReleased handled automatically when I add them?
[02:59:31] *** fisted_ has joined ##java
[03:02:06] <RLN> ~KeyListener
[03:02:07] <javabot> RLN, what does that even *mean*?
[03:02:08] *** javawizard has joined ##java
[03:03:18] *** TomyLobo has quit IRC
[03:03:18] *** TomyLobo2 has joined ##java
[03:03:18] *** TomyLobo2 is now known as TomyLobo
[03:03:28] <RLN> how to use the bot?
[03:03:33] <RLN> ~help
[03:03:34] <javabot> for a FAQ and a quick tutorial on how to use javabot, see: http://kenai.com/projects/javabot/pages/Home
[03:03:35] <ds_creamer> yes, I'm talking about KeyListener
[03:04:17] *** Rubarb has quit IRC
[03:04:29] *** Rubarb has joined ##java
[03:04:51] *** chomping has quit IRC
[03:05:50] <cheeser> it doesn't result in the same outcome, though.
[03:06:00] <cheeser> Frogprince, that is.
[03:06:03] <cheeser> er, freeone3000
[03:06:13] *** AMcBain has joined ##java
[03:06:19] *** PigFlu has quit IRC
[03:06:20] *** jcp has quit IRC
[03:06:21] *** fisted has quit IRC
[03:06:21] *** BlGene has quit IRC
[03:06:21] *** raek has quit IRC
[03:06:21] *** javawizard is now known as jcp
[03:07:11] *** PigFlu has joined ##java
[03:07:11] *** raek has joined ##java
[03:08:33] <RLN> ~info scheduledthreadpoolexecutor
[03:08:33] <javabot> I have no factoid called "scheduledthreadpoolexecutor"
[03:08:49] <RLN> ~info ScheduledThreadPoolExecutor
[03:08:50] <javabot> I have no factoid called "scheduledthreadpoolexecutor"
[03:09:28] <RLN> derp
[03:09:33] <cheeser> ~javadoc scheduledthreadpoolexecutor
[03:09:33] <RLN> ~javadoc ScheduledThreadPoolExecutor
[03:09:34] <javabot> cheeser: http://is.gd/5RW7DF [JDK: java.util.concurrent.ScheduledThreadPoolExecutor]
[03:09:34] <javabot> RLN: http://is.gd/5RW7DF [JDK: java.util.concurrent.ScheduledThreadPoolExecutor]
[03:09:47] <RLN> lol thx
[03:09:53] <RLN> just in time
[03:11:05] *** caverdude has quit IRC
[03:14:50] *** Wyvern666 has quit IRC
[03:15:28] *** Fallout2man has quit IRC
[03:16:38] *** lt232 has joined ##java
[03:20:57] *** teralaser has quit IRC
[03:22:09] *** harry_ has joined ##java
[03:22:28] *** titankiller has quit IRC
[03:22:32] *** Planck_ has joined ##java
[03:23:12] *** titankiller has joined ##java
[03:24:58] *** rjohnson19 has quit IRC
[03:25:07] *** devkhadka has joined ##java
[03:27:00] *** lt232 has quit IRC
[03:28:23] *** harry_ has quit IRC
[03:30:50] *** L-----D has joined ##java
[03:31:21] *** cbrock has joined ##java
[03:34:36] *** Rubarb has quit IRC
[03:36:13] *** guidj0s has quit IRC
[03:42:28] *** emet has quit IRC
[03:45:05] *** harry_ has joined ##java
[03:46:29] *** meling has quit IRC
[03:47:36] *** lt232 has joined ##java
[03:48:47] <lt232> ~freeone
[03:48:48] <javabot> lt232, what does that even *mean*?
[03:48:50] *** Naith has quit IRC
[03:50:13] *** cbeust has quit IRC
[03:50:40] *** cbeust has joined ##java
[03:51:29] *** t0rc has joined ##java
[03:56:31] *** Auv5 has quit IRC
[03:57:19] *** Matuku has quit IRC
[03:59:13] *** Auv5 has joined ##java
[04:00:47] *** queequeg1 has joined ##java
[04:03:03] *** smw has quit IRC
[04:10:55] *** nous1024 has joined ##java
[04:14:35] *** ds_creamer has quit IRC
[04:19:49] *** Naith has joined ##java
[04:22:20] *** queequeg1 has quit IRC
[04:22:24] *** Auv5 has quit IRC
[04:24:12] <whoever> trying to instatiate a class Category CategoryObj = new Category(); and i don't see how Category cannot be resolved to a type
[04:24:36] *** werdan7 has quit IRC
[04:25:43] <lt232> test
[04:27:46] <whoever> lt232: who u talkin to
[04:28:26] <AMcBain> whoever, definitely someone who knows how to use their full keyboard.
[04:28:38] <AMcBain> and the English language proper.
[04:29:48] <whoever> AMcBain: you type one hand and one eye and see how good u are
[04:30:04] <AMcBain> whoever, you aren't going to get pity out of me.
[04:30:13] *** meling has joined ##java
[04:30:20] <cheeser> ~~ whoever aolbonics
[04:30:20] <javabot> whoever, 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.
[04:30:29] *** karstensrage has joined ##java
[04:30:40] <whoever> AMcBain: i am not trying to , just letting you know
[04:31:40] <whoever> wow ... now who is controlling javabot tonight
[04:31:43] <whoever> ?
[04:32:07] <AMcBain> whoever, the guy that runs him :)
[04:32:19] *** Martin8412 has quit IRC
[04:32:26] <whoever> AMcBain: OK
[04:32:40] *** [[thufir]] has quit IRC
[04:33:14] *** [[thufir]] has joined ##java
[04:33:22] <cheeser> that was weird.
[04:33:25] <bearded_oneder> whoever: what is the exact error message you're getting?
[04:33:27] *** eyesUnclouded has joined ##java
[04:34:04] <whoever> so, I am trying to instantiate a class: Category CategoryObj = new Category();. The class name is Category but I keep getting Category cannot be resolved to a variable, can some one assist? thanks
[04:34:25] <cheeser> ~show us
[04:34:25] <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.
[04:34:30] <cbeust> What's the exact error message?
[04:36:02] *** werdan7 has joined ##java
[04:36:40] *** tishammer has quit IRC
[04:38:37] <whoever> the error is a http://pastebin.com/JdmUb3R3
[04:42:26] <cheeser> well, you never import Category
[04:44:24] *** BeholdMyGlory has quit IRC
[04:44:51] <whoever> cheeser: I just tried to import Category, but I still get the same error "Category cannon be resolved to a type"
[04:45:15] <cheeser> do you have a Category.class file somewhere?
[04:45:46] *** eyesUnclouded has quit IRC
[04:48:51] <whoever> cheeser: no, have a Category.java. there isn't a main() in Category
[04:49:15] *** caverdude has joined ##java
[04:49:17] <whoever> but there is a System.out
[04:49:31] <cheeser> i'll bet Category.java doesn't have a package statement either does it?
[04:49:43] * bearded_oneder cocks an eye @ whoever
[04:49:47] *** icecream has joined ##java
[04:50:18] *** nawk has quit IRC
[04:52:03] <whoever> cheeser: probably not there is a static public() that contains my System.out-
[04:52:17] <cheeser> ~~ whoever packages
[04:52:17] <javabot> whoever, Please see http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/java/package/packages.html or http://en.wikipedia.org/wiki/Java_package if you prefer
[04:52:21] <cheeser> ~~ whoever classpath
[04:52:21] <javabot> whoever, 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].
[04:59:32] <TomyLobo> http://download.oracle.com/javase/6/docs/api/java/io/DataInputStream.html does readUTF() stop at null characters?
[05:00:28] <TomyLobo> if it doesnt, it would only stop at EOF, in which case throwing an EOFException wouldnt make a lot of sense
[05:00:33] <TomyLobo> so what does it do?
[05:01:27] *** lt232 has quit IRC
[05:02:35] *** TzilTzal has joined ##java
[05:03:15] *** kermit has quit IRC
[05:04:31] <cheeser> TomyLobo: a byte can't be null. nor can a char not that it matters here.
[05:04:38] *** RobotCow has quit IRC
[05:05:06] <TomyLobo> http://en.wikipedia.org/wiki/Null_character
[05:06:09] *** kieran491 has joined ##java
[05:07:01] <cheeser> ultimately the question is "can UTF-8 handle 0 bytes?"
[05:07:35] <cheeser> i'm thinking yes. though i'm no expert on the matter.
[05:07:46] <TomyLobo> no it isnt
[05:07:57] <cheeser> but it's valid ASCII and iirc all ASCII is valid UTF-8.
[05:08:15] *** RobotCow has joined ##java
[05:08:25] <cheeser> java doesn't treat 0 as a special value as such.
[05:08:30] *** Sliker has quit IRC
[05:08:34] <cheeser> it's just a byte value that gets read in.
[05:08:35] <TomyLobo> it is: will readUTF stop at bytes with the value 0 in the input stream?
[05:08:49] <cheeser> write a test case and see.
[05:08:57] <cheeser> buy why would it stop?
[05:09:01] <cheeser> s/buy/but/
[05:09:25] <TomyLobo> because a lot of C-inspired things stop on 0
[05:09:35] *** pZombie has joined ##java
[05:09:43] <cheeser> this isn't C so ...
[05:09:52] <TomyLobo> and because that function doesnt otherwise know when to stop
[05:10:29] <TomyLobo> unless it encodes the length somewhere
[05:10:35] <TomyLobo> but that isnt documented either
[05:10:37] <cheeser> http://download.oracle.com/javase/6/docs/api/java/io/DataInput.html#readUTF()
[05:10:49] *** epalm has quit IRC
[05:10:59] <cheeser> turns out, there's a length encoded there.
[05:11:06] <pZombie> so, i was looking onto how to make my inner class wait and be notified, and composed a testcase, after barely grasping what synchronized does exactly. Can someone check the testcase and tell me if there is something inherently bad about it?
[05:11:07] <pZombie> http://www.pastebin.se/203332
[05:11:08] <TomyLobo> oh
[05:11:15] <TomyLobo> damn skim reading
[05:11:36] <TomyLobo> i had those 2 bytes not as the length but as the first group
[05:11:45] <cheeser> 8^)=
[05:12:08] *** Cymage has quit IRC
[05:12:21] <bearded_oneder> TomyLobo: you have to stay after class and clean cheeser's keyboard. ;-)
[05:12:31] <TomyLobo> eww
[05:13:03] <cheeser> luckily it's a new laptop. not too much deli detritus in there yet.
[05:13:15] *** c_axis has joined ##java
[05:15:51] <paissad_> lucene is really sexy
[05:16:04] <paissad_> i'm surprised
[05:16:39] *** pr3d4t0r has quit IRC
[05:17:14] *** Sou|cutter has quit IRC
[05:18:20] *** sakekasi has joined ##java
[05:18:36] <sakekasi> Is anyone here experienced with JFreeChart?
[05:19:50] <tjsnell> ~anyone
[05:19:50] <javabot> Chances are someone has, so why not just ask your question and save some time? If someone knows and wants/has time to help, perhaps he/she will.
[05:21:02] *** Naith has left ##java
[05:21:57] <sakekasi> How do I organize the domain in a stacked bar chart by the range values?
[05:23:20] *** k_sze has joined ##java
[05:23:48] <k_sze> What are, say, 3 of the most popular barcode libraries for Java?
[05:25:58] <cheeser> ~google java barcode
[05:25:58] <javabot> http://letmegooglethatforyou.com/?q=java+barcode
[05:26:09] <cheeser> the first 3 libraries listed there.
[05:27:20] <k_sze> I did google it. I'm just checking.
[05:27:29] <sakekasi> so does anyone have an answer to my qtn?
[05:27:36] <sakekasi> sorry to be annoying or anything
[05:27:41] <sakekasi> i just really need to fix this
[05:27:41] <cheeser> sakekasi: no clue
[05:29:52] *** harry_ has quit IRC
[05:33:36] *** ernimril has quit IRC
[05:36:00] <cbeust> sakekasi: try Stackoverflow
[05:36:07] <sakekasi> ok
[05:41:32] *** harry_ has joined ##java
[05:42:33] *** homie has quit IRC
[05:42:42] *** aLeSD has quit IRC
[05:44:02] *** whoever has quit IRC
[05:44:31] *** sakekasi has quit IRC
[05:51:07] *** cschneid has quit IRC
[05:54:00] *** TomyLobo has quit IRC
[05:54:36] *** paissad_ is now known as paissad
[05:58:40] *** homie has joined ##java
[05:59:56] *** boringwall has joined ##java
[06:03:28] *** mhahe has quit IRC
[06:11:43] *** kbotnen has quit IRC
[06:14:14] *** Yekram has joined ##java
[06:15:24] <Yekram> hello
[06:15:46] <Yekram> Anyone awake tonight?
[06:19:21] <Yekram> hello?
[06:19:40] <L-----D> ~parsexml
[06:19:40] <javabot> L-----D, what does that even *mean*?
[06:20:26] <Yekram> great, I have a bot to talk with
[06:20:36] <LtHummus> you have me!
[06:20:43] <wyvern`> L-----D, if you're trying to parse xml, try a stax implementation like Woodstox
[06:20:45] <Yekram> there we go, lol
[06:21:35] <Yekram> Hi LT, I don't code in java and had a few guestions that I thought someone might be able to easily answer
[06:22:00] <Yekram> questions... this is weird. I have not used irc in over 10 years
[06:22:44] <Yekram> i have this project of different bulds of opensource code for doing surfboards / cnc
[06:22:48] *** mistik1 has quit IRC
[06:23:30] <Yekram> I can javac the java file in the main root folder, but the other folders are missing the java file
[06:23:36] <L-----D> ´Ż×xmlparser
[06:23:55] <L-----D> wyvern`, I will look into that, thanks
[06:23:59] <wyvern`> ~~ Yekram firstcup
[06:23:59] <javabot> Yekram, firstcup is a beginner's tutorial for getting started with Java available at http://java.sun.com/tutorial/getStarted/cupojava
[06:24:05] <Yekram> can I just put that file in those other folders and should it work?
[06:24:11] <wyvern`> ~~ Yekram classpath
[06:24:11] <javabot> Yekram, 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].
[06:24:12] <Yekram> k
[06:24:18] <LtHummus> cats make it hard to program
[06:24:35] *** mistik1 has joined ##java
[06:24:35] <Yekram> i had a bad bug from a cat
[06:24:45] <LtHummus> i just had a bad compile
[06:25:10] <Yekram> sry about that
[06:25:37] <Yekram> my understanding is that I need to make a new jar file
[06:26:10] <Yekram> the files extracted from the tarball all have the same date and I think the source is mess
[06:26:28] <Yekram> it is hard to patch it back together without skill
[06:26:46] <Yekram> let me bring up those pages and bookmark them, 1 sec
[06:27:33] <wyvern`> Yekram, you're trying to fix up someone else's code?
[06:28:04] <Yekram> i am trying to make some minor, but important changes
[06:28:44] <Yekram> commenting out lines in files being written, changing default hard coded values,etc.
[06:29:28] <Yekram> i can compile the main project, buts its an earlier version
[06:29:49] <wyvern`> so you want to use the result of your changes somewhere else?
[06:29:51] <Yekram> tthen newer source folder, that has a valid working jar in it, will not compile
[06:30:05] <wyvern`> paste the errors.
[06:30:06] <Yekram> its missing symbols, etc
[06:30:07] <wyvern`> ~~ yekram paste
[06:30:07] <javabot> The user yekram is not on ##java
[06:30:08] *** sorabji52 has joined ##java
[06:30:11] <wyvern`> ~~ Yekram paste
[06:30:11] <javabot> Yekram, http://eugeneciurana.com/pastebin - Paste the final url after you've pasted your stuff there.
[06:30:27] <Yekram> k
[06:30:54] *** CodeWar has joined ##java
[06:31:03] *** Dragonai has joined ##java
[06:32:12] *** mxweas has quit IRC
[06:34:51] <Yekram> my mistake. I can stick the file boardcad.java, from the root folder to the newer build folder
[06:35:34] <Yekram> a copy of it anyway, and then I can run javac boardcad.java
[06:36:01] <wyvern`> i'm surprised the project doesn't have an ant build.xml or maven pom to do the building for you
[06:36:06] <Yekram> however, there is nothing to run, as it does not generate the jar file
[06:36:32] <Yekram> ti guess I missing something and tried to get a manifest in there, these is one alreeady in the src
[06:36:44] <wyvern`> is there a build.xml file or a pom.xml file?
[06:36:48] <Yekram> i hate my keyboard, sry
[06:36:50] <LtHummus> maybe there's a makefile!
[06:36:54] * wyvern` shudders
[06:37:06] <Yekram> 1 sec
[06:37:32] * LtHummus refreshes the FedEx website...again
[06:37:54] <Yekram> no xml files
[06:38:51] <wyvern`> any files that don't end in .java ?
[06:39:01] <Yekram> svn co https://boardcad.svn.sourceforge.net/svnroot/boardcad boardcad
[06:40:50] <wyvern`> ah, i see.
[06:40:56] <wyvern`> The problem is that the software is packaged very poorly
[06:40:59] <wyvern`> sorry :/
[06:41:26] <Yekram> I kinda figured...
[06:41:41] *** rigved has joined ##java
[06:41:43] *** c_axis has quit IRC
[06:42:16] <Yekram> I amjsut rying to be able to rebuild the jar after some minor edits, but folders seem to be missing files
[06:42:19] *** ztj has joined ##java
[06:42:39] <Yekram> I can upload the source to my server if either of you want to look
[06:42:45] *** TR2N has joined ##java
[06:43:00] <wyvern`> Yekram, you're just modifying one file?
[06:43:23] <Yekram> Maybe two or three
[06:43:47] <Yekram> until I can rebuild it I am not editing a thing
[06:44:09] <wyvern`> have you successfully compiled the existing .java source
[06:44:16] <wyvern`> like, do you have .class files for everything
[06:44:27] *** X-Scale has quit IRC
[06:44:48] <wyvern`> if so you should be able to create a jar with jar cf foo.jar path/to/*.class
[06:44:50] <wyvern`> (more or less)
[06:44:53] <wyvern`> see the jar man page.
[06:44:54] <Yekram> It makes those class files yes
[06:45:18] <wyvern`> though ideally something like ant would do this for you :/
[06:45:36] <wyvern`> honestly it might just be easier to set up a basic ant script to do it
[06:45:42] <wyvern`> anyway, i'm out. good luck with that
[06:45:50] <Yekram> thnak you
[06:47:57] <L-----D> wyvern`, can I do something like Document.valueOf("/foo/bar/") in StAX
[06:48:47] *** srk9 has joined ##java
[06:50:01] *** osaka has joined ##java
[06:52:40] <Yekram> lt, you still there?
[06:53:10] <Yekram> http://Smartlsiter.com/Boardcad-source.zip
[06:53:12] <pZombie> what happens if i notify a thread which is not waiting?
[06:53:41] *** phantomcircuit has joined ##java
[06:54:25] <pZombie> is it harmful in any way, or will it just be ignored ?
[06:54:51] <Yekram> I dont understand your question
[06:55:17] <Yekram> http://SmartLister.com/Boardcad-source.zip
[06:55:38] <Planck_> pZombie: do you mean notify on a Thread's monitor?
[06:56:02] *** scottj has quit IRC
[06:56:04] <pZombie> http://www.pastebin.se/203333 i am doing this
[06:56:22] <pZombie> in my main code however, it will be slightly different
[06:57:11] <pZombie> The thread which is waiting, might not be waiting, because it is finishing work still which has be sent to it by the second thread, but it was for whatever reason a bit slow to finish the work
[06:57:42] <pZombie> So the second thread sends it a notify that there is more work to be finished, yet it has not finished the other work yet.
[06:57:58] <pZombie> does that make sense?
[06:58:06] *** Yekram has quit IRC
[06:58:35] <pZombie> been*
[06:59:49] <Planck_> notify is harmless if there's no threads waiting on the monitor, yes
[07:00:40] <Planck_> It doesn't queue up notifications though, if that's what you're asking
[07:00:49] *** pythonirc101 has quit IRC
[07:00:54] <pZombie> good
[07:01:11] <pZombie> so it just ignores the notify i take it, if it s already working and not waiting
[07:01:21] <Planck_> Yes
[07:02:12] <Planck_> It is possible you could get a race condition whereby Thread1 sees new work and notifies, then Thread2 finishes up and waits (with work still pending)
[07:02:53] <pZombie> yes
[07:03:06] <pZombie> i have to think about that too
[07:03:42] <pZombie> but it won t happen because my while loop is checking if there are new frames to write
[07:03:48] <Planck_> Building producer/consumer systems is much easier with java.util.concurrent than raw threading primitives though
[07:04:36] <pZombie> i think i checked this, but did not understand a bit of it
[07:04:41] <pZombie> wait notify comes natural
[07:04:43] <Planck_> pZombie: Still a race condition. While loops exits, then new frames arrive, then monitor is notified, then worker thread waits.
[07:04:54] *** matsebc has quit IRC
[07:05:09] <pZombie> only the synchronized was a bit weird, but i read that it just tells other threads to stay the fuck out of the code following the brackets until this one has finished
[07:05:51] <pZombie> i have a framecounter. The framecounter of the inner class checks if the framecounter of the outer class is on par.
[07:05:55] <Planck_> That code, and all other code synchronized on the same object
[07:05:59] *** Patt has quit IRC
[07:06:02] <pZombie> only if all frames have been processed it will go to sleep
[07:06:10] <Planck_> That's what I'm saying.
[07:06:34] <Planck_> There's a (probably) small but (definitely) nonzero interval between checkign and sleeping.
[07:06:41] <pZombie> oh, you mean it would happen at exactly that nanosecond it exits
[07:06:55] <pZombie> yet has not reached the waiting code
[07:06:59] <Planck_> yes
[07:07:29] <Planck_> Doesn't need to be a nanosecond - threads can reach the end of their timeslice any time, and could be milliseconds in between or more.
[07:07:31] <pZombie> that s why i have a buffer of frames, which is even bigger than actually needed
[07:07:51] <pZombie> so even if this rare animal happens, it won t mean the end of the world
[07:08:00] <pZombie> just a bit performance on writing is lost
[07:08:17] <Planck_> It's not so bad if there's an infinite stream of frames, yes
[07:08:39] *** hd1 has joined ##java
[07:08:50] <hd1> JDBC isn't thread-safe is it?
[07:08:52] <Planck_> If it's finite, the last frames may never be processed.
[07:09:06] <pZombie> it s 5 frames
[07:09:15] <pZombie> the buffer i mean
[07:09:22] <hd1> I suppose that isn't a very clear statement
[07:10:00] <hd1> I can't open a connection in one thread, build a transaction through my code and commit/close the connection in a different thread, can I?
[07:10:05] <pZombie> damn, you are right. luckily this application is not crucial to a rocket launch, and therefore can afford to lose one frame of the video
[07:10:07] <ztj> hd1: sure
[07:10:21] <ztj> hd1: just don't try to use the same connection at the same time in two threads
[07:10:26] <Planck_> pZombie: Okay :-)
[07:11:15] <hd1> ztj: even if it's just for reading?
[07:11:15] *** sorabji52 has quit IRC
[07:11:16] *** CodeWar has quit IRC
[07:11:47] <ztj> hd1: yeah, it's a connection, you don't want to read or write to/from a given I/O stream from two threads at once in like 99% of cases. JDBC is no exception.
[07:12:01] <ztj> hd1: you could always just open another connection
[07:12:10] <hd1> ztj: suppose I could
[07:12:26] <ztj> even the most limited db should handle ~8 simultaneous connections without issue
[07:12:30] <ztj> most will handle a lot more
[07:12:56] <hd1> ztj: this is postgres
[07:13:07] <hd1> and we're configured for 100 simultaneous connections
[07:13:20] <ztj> well there you go
[07:13:25] <hd1> however, some of our programmers are lazy about closing which connections they open
[07:13:33] * hd1 looks in the mirror and smiles
[07:13:46] <ztj> well that's an issue you need to deal with, and can't count on any jdbc-level magic to avoid the associated problems
[07:14:08] <hd1> well, not so much me, my boss is far guiltier than I am
[07:14:22] <Planck_> ztj: This task sounds fairly well suited for Executors.newSingleThreadExecutor. You feed it tasks, they get scheduled in a queue and worked on by a background thread sequentially.
[07:14:35] <ztj> Planck_: what are you talking about? I don't have any task.
[07:14:37] *** titankiller has quit IRC
[07:14:45] <Planck_> Whatever you're doing with the frames
[07:14:48] <hd1> I think he's talking about my task?
[07:14:56] <ztj> Planck_: I'm not doing anything with any frames
[07:14:56] <hd1> no, Planck_?
[07:15:03] <ztj> Planck_: smoke less pot my friend
[07:15:28] * hd1 queues mitch benn's song about the Somali pirates
[07:15:50] *** KarlThePagan has quit IRC
[07:16:09] <Planck_> ztj: Oh, you were talking about buffering frames of video and having a thread working on them. Did I misread?
[07:16:17] <ztj> no, I never said anything about that
[07:16:23] <hd1> heh
[07:16:23] <Planck_> Doh, pZombie
[07:17:02] <Planck_> Someone with a z near the start of their name, how many can there be!?
[07:17:13] *** rigved has quit IRC
[07:17:45] <Planck_> Sorry :-)
[07:18:15] <hd1> ok,everyone, quick rename yourselves inserting a "z" as the second letter in your nicks now! :)
[07:18:19] *** hd1 is now known as hzd1
[07:18:27] * hzd1 smiles at Planck
[07:18:30] <hzd1> _
[07:18:32] *** hzd1 is now known as hd1
[07:19:11] *** hd1 has left ##java
[07:23:44] *** xQuasar has joined ##java
[07:30:29] *** phantomcircuit has quit IRC
[07:32:44] *** Dragonai has quit IRC
[07:34:54] *** yoshx has joined ##java
[07:38:03] *** meoblast001 has joined ##java
[07:38:14] <meoblast001> hi
[07:38:52] <meoblast001> is int possible in Ant to define variables of some sort, that will be compiled with the project... i know it's sort of against the typical java conventions, but with the use of Android, it would be best if i could do some conditional compilation
[07:39:33] *** blbrown_win3 has joined ##java
[07:39:38] *** harry_ has quit IRC
[07:43:54] *** K4mirox has quit IRC
[07:45:06] *** sorabji52 has joined ##java
[07:45:28] *** glcrazy has joined ##java
[07:45:46] <AMcBain> meoblast001, if you mean preprocessing type stuff then no.
[07:45:55] <AMcBain> If you mean variables within an ant build script, then yes ant supports that.
[07:46:17] <meoblast001> i mean, like exporting some .java file containing variables
[07:46:35] *** ab500 has quit IRC
[07:46:53] <AMcBain> ah, not that I know of, at least by default. You could probably write some sort of add-on/plugin/extension/whatever-ant-calls-them that does it though.
[07:47:00] *** k_89 has quit IRC
[07:47:01] *** ab500 has joined ##java
[07:47:02] <meoblast001> perhaps i could create a few additional files with those variables, and create a different one for each build profile, and build with each one in Ant depending on what profile i need
[07:47:03] <AMcBain> and use that in your ant-script.
[07:47:09] <meoblast001> like AndroidConfig.java and PCConfig.java
[07:47:16] <AMcBain> meoblast001, well, why not use a Properties file or some such?
[07:47:20] *** glcrazy has quit IRC
[07:47:22] <AMcBain> ant can build those.
[07:47:25] <meoblast001> hm?
[07:47:30] <meoblast001> oh, i think i've seen those
[07:47:33] <meoblast001> i'll have to read more into those
[07:47:43] <AMcBain> They're just simple files with key=value pairs.
[07:47:54] <meoblast001> and those get exported for Java to use?
[07:48:04] <AMcBain> and you could either build it in the script or do the write X and copy appropriate over.
[07:48:11] <AMcBain> meoblast001, well you can read them in with the Properties class.
[07:48:16] <meoblast001> ah
[07:48:31] <AMcBain> or, short of that, a simple split by \n and indexOf("=") per line ...
[07:48:46] *** t0rc has quit IRC
[07:49:06] *** yoshx has quit IRC
[07:54:32] *** Glavata has joined ##java
[08:02:39] <Planck_> Is TCP packet corruption something that ever happens in practice? E.g. if I'm designing an application that may transmit a few gigabytes of compressed and encrypted data, should I break it into shorter blocks with checksums per block?
[08:03:05] <Planck_> Or is TCP's checksum enough in practice that it really never happens?
[08:03:38] *** AMcBain has quit IRC
[08:03:42] *** brig has joined ##java
[08:04:05] *** McMAGIC-- has joined ##java
[08:06:09] *** cyrusyrus has joined ##java
[08:06:19] *** sorabji52 has quit IRC
[08:06:39] *** McMAGIC-- has quit IRC
[08:08:05] *** kieran491 has left ##java
[08:11:48] *** plarsen has quit IRC
[08:12:44] *** choongii has joined ##java
[08:20:43] *** icecream has quit IRC
[08:24:38] *** xQuasar has quit IRC
[08:29:40] *** glcrazy has joined ##java
[08:29:52] *** DJClean has joined ##java
[08:30:01] *** stevenhong has joined ##java
[08:30:01] *** glcrazy has quit IRC
[08:30:35] *** srk9 has quit IRC
[08:31:52] *** carutsu has quit IRC
[08:33:37] *** pr3d4t0r has joined ##java
[08:35:08] *** devkhadka has quit IRC
[08:38:05] *** dmiles_afk has quit IRC
[08:38:47] *** dmiles_afk has joined ##java
[08:39:56] *** platzhirsch has joined ##java
[08:42:27] *** kriko has quit IRC
[08:46:50] *** CodeWar has joined ##java
[08:47:29] *** nuvolari has joined ##java
[08:48:49] *** squeakytoy has joined ##java
[08:53:23] *** glcrazy has joined ##java
[08:56:52] *** tewecske has joined ##java
[08:57:00] *** riotz has joined ##java
[08:58:39] *** webczat has joined ##java
[08:59:03] <webczat> Hey, are members/classes without a modifier package private or private?
[09:00:21] *** freeone3000 has quit IRC
[09:00:48] *** platzhirsch has left ##java
[09:02:48] <cbeust> package private
[09:05:15] <webczat> Also, can you initialize non-final variable in it's declaration in the class? I meant field.
[09:05:28] *** bearded_oneder has quit IRC
[09:06:23] *** rretzbach has joined ##java
[09:07:05] <CodeWar> yse
[09:09:03] <webczat> Hmm, but their values must be constants?
[09:10:08] <cbeust> ~~ webczat tias
[09:10:08] <javabot> webczat, Try it and see. You learn much more by experimentation than by asking without having even tried.
[09:14:57] *** k_sze has quit IRC
[09:18:32] *** io2 has joined ##java
[09:19:25] *** xQuasar has joined ##java
[09:19:44] *** glcrazy has quit IRC
[09:19:56] <Planck_> You can also download the Java Language Specification, if you want definitive answers rather than the opinions of random internet strangers like me.
[09:20:03] *** Kamaran has joined ##java
[09:21:05] *** pen has quit IRC
[09:21:45] *** meoblast001 has quit IRC
[09:22:23] *** CodeWar has quit IRC
[09:23:53] *** sd1074_2 has joined ##java
[09:24:12] *** sd1074_2 has left ##java
[09:27:52] *** squi has joined ##java
[09:29:35] *** staar2 has joined ##java
[09:29:38] <staar2> hello
[09:29:55] <Planck_> Hello
[09:30:50] <pZombie> hEllo
[09:30:54] *** frangiz has joined ##java
[09:32:23] <blbrown_win3> hello you guys!!!
[09:32:38] <squi> heyho
[09:32:48] <squi> anyone here having experience compiling javac from the opensdk?
[09:32:51] <squi> i mean
[09:32:57] <squi> openjdk, sorry
[09:33:09] <squi> the thing is, it seems like the current version can't compile itself
[09:33:15] <squi> and in general contains a big bug
[09:33:41] <blbrown_win3> what is the bug
[09:33:44] <squi> it cant compile enums... anyone experienced that?
[09:33:44] *** frangiz has quit IRC
[09:34:07] <squi> the thing is that it adds the name and ordinal value parameters to the ctor
[09:34:12] <squi> the default ctor*
[09:34:22] <squi> but doesnt reach them down to the super() call
[09:34:42] <squi> so there is still super() but the Enum base class has no default ctor, but expects those arguments
[09:35:50] *** cbeust has quit IRC
[09:37:46] *** frangiz has joined ##java
[09:44:09] *** squi has quit IRC
[09:44:10] *** caverdude has quit IRC
[09:47:45] *** msieradzki has joined ##java
[09:48:05] <staar2> where i could find some normal path finder ?
[09:48:12] <staar2> recursive
[09:49:34] <Planck_> What's some normal path finder?
[09:50:45] <staar2> i cant find recursive algorithm for path finding where it's used linked graph, not 2d array
[09:51:48] <Planck_> Most of the standard pathfinding algorithms work on arbitrary graphs, just not as efficiently
[09:53:18] <staar2> well i just implemented the depth first search recursive, but the problem is i don't know how to remove the vertices which are dead ends
[09:53:39] <staar2> all the steps which it goes through adds to path
[09:55:13] <selckin> just use a* ?
[09:55:38] <Planck_> A* is fine if there's a useful heuristic to use
[09:57:09] <Planck_> staar2: you just return a failure to the caller and it continues on
[09:57:24] <Planck_> Using whatever initial fragment of path it was trying
[09:58:25] <Planck_> Failure could be represented as a path of infinite cost (Double.POSITIVE_INFINITY), for example.
[09:58:38] *** magentar has joined ##java
[09:59:20] *** irenicus09 has joined ##java
[09:59:34] <staar2> well i post my code, then you will see my problem
[10:00:30] <Planck_> It's worth a try, sure
[10:00:42] *** tty1 has joined ##java
[10:00:55] <staar2> http://pastebin.com/hz5Bwa1u as you can see each vertice is room, and the connections are made with referencing to other room
[10:01:00] <staar2> it's maze
[10:02:00] <staar2> currently the only problem is that it needs to remove the dead ends which are added to list and won't be removed
[10:05:10] <Planck_> Well, and the fact that it continues to search every room *after* it's found the one you want
[10:05:28] <staar2> yes
[10:05:52] <staar2> that's also problem
[10:06:35] *** zatan has joined ##java
[10:07:40] <Planck_> You don't appear to have any object representing a path
[10:08:35] *** frangiz has quit IRC
[10:08:38] <Planck_> So it would appear difficult to use your code to find a path.
[10:09:51] <staar2> you mean separate list for that ?
[10:10:00] *** frangiz has joined ##java
[10:10:06] <staar2> for path
[10:10:16] <Planck_> Yes. Also, I'd use a Set for visited rooms.
[10:11:54] *** kriko has joined ##java
[10:12:14] <staar2> yes it would be better, but i don't get how would i use the path list
[10:12:35] *** harry_ has joined ##java
[10:12:38] *** jjido has joined ##java
[10:14:06] <Planck_> That would be your final result.
[10:15:36] <Planck_> You return it if you find a path, and return null or something if you don't.
[10:15:40] <staar2> yes but how i know which room to add in path and which not
[10:16:49] *** rigved has joined ##java
[10:16:50] <Planck_> There's a few ways to go on that.
[10:17:45] <Planck_> You can either pass it into the dfs() as an initial segment, making a copy and extending it, or just reconstruct it on the way out.
[10:19:13] <Planck_> In the latter case, the state of the call stack implicitly holds the path.
[10:20:26] *** homie has quit IRC
[10:20:48] <staar2> it s good idea
[10:21:05] *** tewecske has quit IRC
[10:21:46] *** squi has joined ##java
[10:21:57] <Planck_> In either case, you will want to check a return value from dfs().
[10:22:13] *** ninan has joined ##java
[10:22:26] <staar2> the call stack holds the path ok, but the problem arises then in my code with ending on right path, which currently wont exit
[10:22:42] <Planck_> That's why you check the return value.
[10:23:07] <Planck_> There's no point doing dfs(south, ...) if the dfs(north, ...) already found a path.
[10:23:22] *** Guyman has joined ##java
[10:23:32] <blbrown_win3> what is the point of Boolean.TRUE and Boolean.FALSE. I see that used a lot...don't understand why though
[10:24:15] <Planck_> In all the cases I've seen, there was no reason at all.
[10:24:35] <blbrown_win3> seems like a waste of 8 keystrokes
[10:24:40] <blbrown_win3> 8 extra keystrokes
[10:24:54] <Planck_> It's really only useful for when you definitely want the Boolean object for true or false, and not the boolean primitive
[10:25:01] <Planck_> Which is almost never.
[10:25:32] <Planck_> It may have been more useful before autoboxing
[10:25:34] <squi> i dont know if anyone remembers me mentioning this javac bug in the latest openjdk
[10:25:44] <staar2> Planck_, so you mean i should make the dfs to return boolean ?
[10:25:57] <squi> but i think i was able to fix it
[10:26:05] <blbrown_win3> Planck_, that was what, 10 years ago? hehe
[10:26:16] <Planck_> Well, Boolean dates back to Java 1.0
[10:26:32] <blbrown_win3> I meant introduction of autoboxing
[10:26:40] <squi> it tried to verify and box method-call arguments before synthesizing
[10:26:45] <Planck_> Yes, ages ago. But Boolean.TRUE is older still
[10:27:22] <selckin> back when ppl did things to save memory
[10:27:31] <Planck_> staar2: No, the Boolean discussion related to blbrown_win3's comment.
[10:27:34] <squi> should i post it at bugs.sun.com?
[10:27:45] <Planck_> selckin: Like omit letters from "people"! :-)
[10:28:11] <selckin> welcome to the internet
[10:28:35] <Planck_> Thank you. I am sure I will enjoy the bounty of insight and enhanced communication it brings.
[10:28:50] <selckin> don't forget the porn
[10:30:19] *** FrozenKnight has joined ##java
[10:30:58] <blbrown_win3> heh
[10:31:04] *** srji has joined ##java
[10:31:11] <blbrown_win3> I have this theory, that I think the Internet is mostly pointless...what is a theory of course
[10:31:24] <blbrown_win3> and iPads, smart phones too
[10:31:41] *** arborist has joined ##java
[10:31:50] <selckin> welcome to life
[10:32:00] <blbrown_win3> exactly
[10:32:02] <Planck_> I suppose the porn has to be filed under "educational materials". That's what the internet is really all about after all.
[10:32:14] <Planck_> Better access to educational materials.
[10:32:43] <blbrown_win3> the Internet provides for a better printing press. Outside of that, you have mostly porn and spam
[10:32:44] <blbrown_win3> hehe
[10:32:51] *** supercosmonaut has quit IRC
[10:33:16] *** jonkri has joined ##java
[10:34:23] <blbrown_win3> I am actually hoping for big things with HTML5, better web applications. Of course, you are still reliant on browsers ability to handle HTML5
[10:34:31] <blbrown_win3> And the server
[10:37:20] *** xiliax has joined ##java
[10:37:27] *** homie has joined ##java
[10:37:33] *** ninan has quit IRC
[10:39:24] *** xQuasar has quit IRC
[10:39:48] *** jaskal has joined ##java
[10:40:35] *** cyrusyrus has quit IRC
[10:40:45] *** jjido has quit IRC
[10:41:23] *** jaskal has quit IRC
[10:42:05] *** jaskal has joined ##java
[10:43:03] *** jjido has joined ##java
[10:44:33] *** Behi has quit IRC
[10:45:01] *** winux has joined ##java
[10:45:47] <Guyman> why did eclipse stop creating for me "default package" when creating a new project?
[10:45:47] *** RLa has joined ##java
[10:46:18] *** Martin8412 has joined ##java
[10:46:28] <Planck_> It's often a bad idea to use a default package
[10:51:13] *** sd1074_2 has joined ##java
[10:51:25] *** sd1074_2 has left ##java
[10:51:49] *** ninan has joined ##java
[10:52:34] <blbrown_win3> ...Guyman also, could you clarify your question
[10:53:29] <Guyman> blbrown_win3 , eclipse used to make a defulat package every time i created a java project. now it doesnt, why?
[10:53:35] <Guyman> default*
[10:53:59] <Guyman> never mind
[10:54:03] <Guyman> problem solved
[10:54:52] <blbrown_win3> if you have a src folder, you should have a "default package"
[10:55:01] *** squi has quit IRC
[10:55:09] <blbrown_win3> but like Plank_ said, no one really uses the default package
[10:56:35] <Planck_> Any classes in the default package can't be accessed from anywhere else.
[10:57:11] *** jjido has quit IRC
[10:58:13] *** squi has joined ##java
[10:58:39] *** jjido has joined ##java
[10:59:18] *** Indigenous has joined ##java
[11:01:52] *** harry_ has quit IRC
[11:04:53] *** [[thufir]] has quit IRC
[11:05:00] *** jjido has quit IRC
[11:05:05] *** VaNNi has quit IRC
[11:06:45] *** jjido has joined ##java
[11:08:14] <RLa> how are resources and packages releated?
[11:08:24] *** Tashtego has joined ##java
[11:08:28] <blbrown_win3> They aren't
[11:08:58] <RLa> i see lot of .properties files dropped in source and classpath root
[11:09:06] <blbrown_win3> OK
[11:09:14] <RLa> yet they can be accessed
[11:09:20] <blbrown_win3> OK
[11:09:23] <RLa> classes cannot tho
[11:09:48] *** frangiz has quit IRC
[11:10:07] <blbrown_win3> ~~RLa packages
[11:10:08] <javabot> RLa, Please see http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/java/package/packages.html or http://en.wikipedia.org/wiki/Java_package if you prefer
[11:10:30] <blbrown_win3> RLa, it makes sense when you understand packages.
[11:10:41] *** miha has joined ##java
[11:10:43] *** frangiz has joined ##java
[11:11:21] <miha> hello, does anyone know how to do license files properly with java? i want the code to work in "demo mode" when no license / invalid license... interested in any opinion..
[11:11:25] <RLa> ok, looks like despite programming java for over 10 years i'm not still understating packages
[11:11:48] <blbrown_win3> RLa, resource files aren't necessarily related to Java packages. In the case of property files, you can think of them as just simple text files sitting on the filesystem or in some cases a part of the classpath
[11:11:56] *** squi has quit IRC
[11:12:22] <blbrown_win3> RLa, it is a way to organize Java classes.
[11:12:36] <blbrown_win3> there are quirks which you found out, the default package is to be avoided.
[11:12:49] <Planck_> miha: IMO, there isn't a right way to do license files.
[11:13:01] *** Caleb-- has joined ##java
[11:13:06] <RLa> MyClass.class.getResource("something.properties") <- this relates resources and packages
[11:13:14] *** jjido has quit IRC
[11:13:27] <miha> Planck_: well thinking if i should try license4j or just use RSA and hashes to sign my text files
[11:13:40] <miha> and obfuscator for code
[11:13:54] <RLa> blbrown_win3, neither of your links mention resources
[11:14:02] <blbrown_win3> RLa, because they aren't related
[11:14:18] *** winux has quit IRC
[11:14:23] *** apexi200sx has joined ##java
[11:14:53] *** EyesIsMine|iPod has joined ##java
[11:14:56] <blbrown_win3> RLa, what are you trying to do and what is the issue
[11:15:01] *** EyesIsMine|iPod has left ##java
[11:15:40] *** squi has joined ##java
[11:15:49] <RLa> i'm just asking, there are no issues
[11:15:57] <Planck_> miha: When looking for License4J on Google, I had to wade through about 50 warez sites offering License4J for free. What does that say about how well it works?
[11:16:04] <miha> hehe
[11:16:08] <miha> yeah...
[11:16:30] <miha> so using RSA (max key length supported...) and hashes is ok?
[11:17:05] *** ninan has quit IRC
[11:17:10] <Planck_> Sure, just so long as you keep in mind that anyone who wants to run the code without a license, will.
[11:18:01] <RLa> just do it as web app next time and you can solve such problems because code won't run on user computer
[11:18:09] <Planck_> All you can do is make it difficult for people who can't program.
[11:18:19] <Planck_> E.g. by forcing them to download it from a warez site
[11:19:34] <miha> Planck_: i understand that yes... thing is using android market for update would be most convinient.. but most vulnarable..
[11:19:49] <miha> i guess i'll abandon the idea altogether
[11:19:55] <selckin> nobody cares about your app to pirate it anyway
[11:20:02] <miha> and just display dialog ("new version is available, download it")
[11:20:21] <miha> selckin: it's not user app, it's made for certain type of business...
[11:20:32] <selckin> those definitly don't care
[11:20:48] <miha> :)
[11:23:03] <miha> selckin: you have a point, but we are past that...
[11:23:10] *** Carnage\ has joined ##java
[11:23:21] <miha> Planck_: i agree with you 100%, that was my idea too...
[11:23:29] *** devkhadka has joined ##java
[11:23:43] *** EricInBNE has quit IRC
[11:24:29] *** bindaas has quit IRC
[11:24:56] *** bindaas has joined ##java
[11:25:10] *** ninan has joined ##java
[11:27:08] *** Lone_Rifle has joined ##java
[11:27:22] *** E-sense has joined ##java
[11:28:08] *** forneus has quit IRC
[11:28:51] *** Kamaran has quit IRC
[11:28:52] *** forneus has joined ##java
[11:35:30] *** Kamaran has joined ##java
[11:37:01] *** apexi200sx has left ##java
[11:40:31] *** squi has quit IRC
[11:43:03] *** srm has joined ##java
[11:45:33] *** srji has quit IRC
[11:46:06] *** jaskal has quit IRC
[11:47:02] *** hex` has joined ##java
[11:48:00] *** srji has joined ##java
[11:51:22] *** squi has joined ##java
[11:52:46] *** srji has quit IRC
[11:53:02] *** srji has joined ##java
[11:54:17] *** sandstorm has joined ##java
[11:55:19] *** srji has quit IRC
[11:56:06] *** jaskal has joined ##java
[11:57:06] *** Lone_Rifle has left ##java
[11:57:30] *** irenicus09 has quit IRC
[11:58:23] *** Behi has joined ##java
[11:59:00] *** sandstorm has quit IRC
[12:00:20] *** srji has joined ##java
[12:02:57] *** blbrown_win3 has quit IRC
[12:03:09] *** [[thufir]] has joined ##java
[12:03:27] *** top^ has quit IRC
[12:08:59] *** miha has left ##java
[12:09:05] *** squi has quit IRC
[12:10:15] *** kriko has quit IRC
[12:10:30] *** TzilTzal has quit IRC
[12:11:02] *** frangiz has quit IRC
[12:11:46] *** frangiz has joined ##java
[12:12:55] *** Charrit has joined ##java
[12:16:39] *** javobiwan has joined ##java
[12:19:58] *** supercosmonaut has joined ##java
[12:22:23] *** wessel has joined ##java
[12:24:00] <wessel> When I do map.put(index, value) into a SortedMap, is there any way to retrieve my indexes ?
[12:24:29] <selckin> ~javadoc map
[12:24:29] <javabot> selckin: http://is.gd/iNT0X [JDK: java.util.Map]
[12:24:44] <wessel> Else I need to create a new class, class it element, which holds index value pairs
[12:24:54] *** msieradzki has quit IRC
[12:26:15] <wessel> "An object that maps keys to values. A map cannot contain duplicate keys; each key can map to at most one value. "
[12:26:31] <wessel> But when I test this, the sorted map changes my keys!
[12:26:42] <selckin> your question makes no sense to me
[12:26:53] <selckin> define changes keys?
[12:28:28] <wessel> { .5, .2, .4, .3, .1};
[12:28:47] <wessel> k wait bad example
[12:28:57] <selckin> try complete questions that do not assume we can read your mind
[12:28:57] <wessel> { .2, .4, .3, .1};
[12:29:24] <Guyman> when implementing Comparator, it doesnt supposed to have a ctor, right?
[12:29:26] <wessel> I wish to get, the index, of the highest value in this array
[12:29:45] <wessel> { .2, .4, .3, .1}; <== here the highest value is .4 and the index is 1
[12:30:17] <wessel> so if I where to put(0, .2) and put(1, .4)
[12:30:35] <wessel> I need some way to retrieve the index 1, after I put it
[12:30:59] <selckin> batshit crazy
[12:31:46] <selckin> Guyman: there will always be a constructor
[12:31:55] <Guyman> the default one
[12:32:03] <selckin> wessel: how is that not a list/array again?
[12:32:04] <Guyman> but actually i dont need more than that usally, right?
[12:32:32] <selckin> Guyman: you don't need one no, it can be completely stateless etc
[12:32:43] <wessel> I'm asking how to get the mapping
[12:32:48] <wessel> if I simply sysout map
[12:32:49] <wessel> I get
[12:32:56] <wessel> {0=0.2, 1=0.4, 2=0.3, 3=0.1}
[12:33:01] *** ninan has quit IRC
[12:33:09] <wessel> so the mapping is there
[12:33:34] <selckin> loop over entrySet if you want the pairs, but you're probably doign something stupid
[12:33:59] <Guyman> and does it make sense to do a "NewClass implements compartor { public static compareSize {...} public static compareLength{..} ..... more comparing ways }
[12:34:00] <Guyman> ?
[12:34:23] <wessel> selckin: I want to get the k highest elements, after observing n elements
[12:34:32] <Guyman> and then creating NewClass.compareSize sizeComp = new NewClass.compareSize() ?
[12:34:35] <selckin> wessel: why do you need a map at all?
[12:34:52] <Guyman> notice the static
[12:35:12] <wessel> so if I observe [3 4 5 1 2], I want to get highest had index 2, second highest has index 1, third highest has index 0, etc
[12:35:58] <selckin> Guyman: i usually just have like MyClass { public static finall Comparator<MyClass> BY_SIZE = new Compara() { blabalbla}; public static final Comparator<MyClass> BY_NAME = new Comparator<MyClass>() { public int compare() { blablalbal} }
[12:36:14] <selckin> wessel: so just keep it as a list and sort it
[12:36:20] <wessel> no, not fast enough
[12:37:11] <Guyman> selckin, whats the meaning of Comparator<MyClass> ?
[12:37:13] <wessel> I'm using a SortedMap because it auto sorts
[12:37:24] <selckin> Guyman: variable type?
[12:37:32] <Guyman> didnt learn that yet
[12:37:45] <Guyman> would my way be acceptable too?
[12:38:12] <selckin> don't think your ways can work
[12:38:19] <Guyman> why not?
[12:38:22] <selckin> or too much incorrect pseudo code
[12:38:22] *** Sliker has joined ##java
[12:38:27] *** brundlefly has joined ##java
[12:38:32] <Guyman> just inner static classes
[12:38:41] <selckin> thats basicly my example
[12:39:04] <Guyman> alright, so what about the way i wrote it? because i dont understand yours =\
[12:39:24] <wessel> selckin: "just keep it as a list and sort it" has the same problem
[12:39:29] *** chomping has joined ##java
[12:39:39] <wessel> I want to get back the indexes of the original unsorted list
[12:39:55] <selckin> wessel: you probably just want entrySet() and and loop over the first x
[12:40:10] <Guyman> NewClass implements compartor { public static compareSize {public int compareSize(object o, object m) { .. } } public static compareLength{..} ..... more comparing ways } }
[12:40:10] <wessel> I don't wish to get the k highest values, I wish to get the k old indexes associated with these highest values
[12:40:20] <frimend> Have anyone done some sideproject that turned out profitable?
[12:40:25] *** bindaas has quit IRC
[12:40:36] <selckin> that minecraft guy was pritty successfull at it
[12:40:44] <frimend> yes, but that requires luck.
[12:40:52] <frimend> I am looking for a more realistic aproach.
[12:40:52] *** javobiwan has quit IRC
[12:41:00] <frimend> I don't really like my job, too little freedom.
[12:41:22] <frimend> experimenting with some sideproject while working would be stimulating.
[12:41:36] <frimend> but I have no idea what could be profitable.
[12:42:06] <frimend> I don't really have the energy to play around with something that isn't worth anything all evenings of the week. :>
[12:42:18] *** frangiz has quit IRC
[12:42:21] <selckin> Guyman: http://pastie.org/1635827
[12:43:02] *** frangiz has joined ##java
[12:43:03] <selckin> don't quit your day job then
[12:43:25] <frimend> not a chance.
[12:43:59] <frimend> I am just curious what sidejobs people here have found, that could have been profitable.
[12:44:00] <Guyman> selckin , thanks :)
[12:44:03] *** kaemo has joined ##java
[12:44:12] <frimend> making homepages for people I have heard is a classic.
[12:44:17] <frimend> but apart from that..?
[12:44:59] <frimend> Or are you guys just a bunch of codemonkeys like me?
[12:45:17] <selckin> Guyman: http://pastie.org/1635835 you where probably talking about this, but it's the same thing
[12:45:25] <frimend> go to work, push the buttons, get bananas, repeat.
[12:45:52] <selckin> find a job where you get a lot of input and technical decision input
[12:45:59] <selckin> bad sentance is bad
[12:46:35] <wessel> double[] scores = { .2, .4, .3, .1, .5}; print entry set: [0=0.2, 1=0.4, 2=0.3, 3=0.1, 4=0.5] print map.firstKey() 0
[12:46:47] <Guyman> selckin , yep
[12:47:18] <wessel> I wish to print "highest: index 4 = value .5
[12:47:31] <selckin> wessel: maps sort by key not value
[12:47:37] <wessel> ah!
[12:47:56] <wessel> okay, that explains all, hahaha
[12:48:00] <selckin> really just make a list<IndexScore> and sort it
[12:48:27] <frimend> A construction worker can do construction work at the construction site on the weekdays.
[12:48:37] <Guyman> o1.getName().compareTo(o2.getName());
[12:48:50] <frimend> And then go and work at his friends houses, constructing there.
[12:48:55] <Guyman> selckin , it doesnt return 1 or 0 or -1 ..
[12:49:01] <frimend> but what can a developer do?
[12:49:07] <selckin> Guyman: exercise for the reader
[12:49:22] <Guyman> selckin, what do you mean?
[12:49:27] <selckin> frimend: make iphone/android apps, find people with bussness that needs stuff developed, freelance stuff
[12:49:55] <selckin> Guyman: was just silly example, implement the compare however you want
[12:50:00] *** Johannes13 has joined ##java
[12:50:15] <Guyman> oh alright
[12:50:31] <RLa> frimend, first find people who need work/apps/projects to be done
[12:50:41] *** jonkri has quit IRC
[12:50:59] <selckin> like my friend had a store, made a website for it
[12:51:06] <selckin> same as construction worker thing
[12:51:11] <RLa> frimend, first creating apps then finding customers does not work well
[12:51:18] <frimend> yes
[12:51:38] <RLa> i'm doing full-time freelance work
[12:51:49] <wessel> a map can not contain duplicate keys :-/
[12:52:14] <selckin> wessel: thats why it's a map
[12:52:16] <frimend> I am not entierly confident at my production capacity, nor the quality of what I produce.
[12:52:24] <RLa> wessel, keep List of values
[12:52:26] <wessel> so if I observe [.1 .1 .5 .2 .4 .3] I can't sorted it with a map?
[12:52:33] *** kvarley has joined ##java
[12:52:49] <frimend> So I find it difficult to find people who need work done, since I am not confident I can satisfy their demands.
[12:52:50] <selckin> you can do Map<Key, List<Value>> if you want
[12:52:53] <wessel> I guess I could just create elements that are index value tuples
[12:52:56] <wessel> and sort these
[12:53:13] <RLa> frimend, try to get hourly rates not fixed budget
[12:53:14] <selckin> wessel: told you todo that like 10min ago
[12:53:38] <frimend> RLa: When you freelance, do you do alot of small project, or few large ones?
[12:53:45] <kvarley> I'm using JTextPane. How do I set the caret position to the end of the contents within the Pane? I'm using "outputTextPane.setCaretPosition(outputTextPane.getText().length());" but it isn't working.
[12:53:46] <frimend> typical timespan for a project?
[12:53:53] <wessel> I did not understand
[12:54:09] *** winux has joined ##java
[12:54:11] <RLa> frimend, i want to do small projects but i have ended up with large ones
[12:54:18] <frimend> =)
[12:54:28] <RLa> frimend, because each successful project can be further developed
[12:54:40] <frimend> What tools, skills and abilities do you find high in demand?
[12:54:41] * selckin always thinks red lobster army when i see rla, wonder why
[12:54:55] <RLa> hm
[12:55:29] <Tashtego> what is the status of entities selected in JPA via named query? "new" ??
[12:55:32] <winux> selckin: uhh
[12:55:33] *** ker has joined ##java
[12:55:44] <RLa> frimend, you need to know your tools, languages, libraries, technologies
[12:56:08] <frimend> Yes, I realize that.
[12:56:14] <Tashtego> trying to select a newsgroup entity, then make a new news object, insert the selected newscategory as attribute to news, and save the news entity. this leads to an insert of newscategory, too. which is not neccesary??
[12:56:15] <frimend> But I find myself in a big jungle here.
[12:56:19] <frimend> I have no clue what to focus on.
[12:56:29] <RLa> frimend, you also need communication skills
[12:56:29] <winux> frimend: fyi, there is a 'problems' view in eclipse
[12:56:38] <frimend> And since it's so big, I find it hard to motivate me to learn loads about some certain tool.
[12:57:06] <frimend> I feel very confident I have good comminucation skills.
[12:57:20] <RLa> frimend, it's impossible to learn everything
[12:57:24] <frimend> in fact, that is the only part that I feel confident about.
[12:57:33] <frimend> yes, it is. I must focus on certain things.
[12:57:41] <frimend> And I don't really have a good clue what is good.
[12:58:07] <frimend> there is alot of projects going on here at work, and I can likely take any task I prefer, but I have no clue what skills might be usefull for me in the future!
[12:58:33] <frimend> I am working abit on a project involving web services and java server faces / java prime faces now.
[12:58:46] <frimend> Could this be a good thing to focus on?
[12:58:46] <ker> hi all
[12:58:52] <frimend> hello ker.
[12:58:56] <ker> how do I avoit buttons to auto-resize when text length changes?
[12:59:04] <ker> I'm using NetBeans 6.9 with Swing
[12:59:05] <RLa> frimend, so choose projects where you can use these things
[12:59:17] *** Johannes13 has quit IRC
[12:59:55] *** Johannes13 has joined ##java
[13:00:02] <frimend> I am trying to figure out what skills are high in demand, so that I can choose projects in which I can improve that type of skills. :)
[13:00:27] <RLa> frimend, also, you will usually have lot of freedom when it comes to choosing technology
[13:00:40] <frimend> too much freedom. :<
[13:00:46] <frimend> I am lost.
[13:01:04] <selckin> sounds like want to use this a way to learn to get a better day job or what?
[13:01:20] *** bojo has joined ##java
[13:02:07] <frimend> I want to be able to contribute efficiently, whereever I might find myself.
[13:02:14] <RLa> if you take small projects you could try out different things on each project
[13:02:16] *** gelignite has joined ##java
[13:02:19] <frimend> right now, I don't feel especially productive.
[13:02:28] *** Vikash has joined ##java
[13:03:09] <frimend> is java server faces something that many people use?
[13:03:11] <RLa> my experience has been that technology, expecially frameworks etc. do not matter much productivity wise
[13:03:38] *** Charrit has quit IRC
[13:03:41] <frimend> I get tangled up in these issues, I get lost easy.
[13:03:47] <RLa> most of time still goes on communication and coding functionality
[13:04:31] <frimend> I don't understand what the beans are, I don't understand jsf, prime faces, whats that? ant build scripts, tomcat, apache, databases.. arrgh.
[13:04:46] <frimend> It is causing a total overload, I have no clue what monster to stare down.
[13:05:42] <selckin> i had the same problem, in the end you have a project/problem and you just have to pick something, and see if you like it, swap if you don't, and take advice from experienced people, but the frameworks in the end don't mather that much, just pick one really :/
[13:06:16] <frimend> all this things are included in the project I am assigned on.
[13:06:49] <selckin> like rla said (i think) find a problem first, then a solution
[13:06:51] <selckin> not the other way around
[13:07:04] <frimend> problem: a icon is to small.
[13:07:14] *** bitshuffler has joined ##java
[13:07:34] <frimend> just as a example. :>
[13:07:40] <frimend> I have loads of other problems.
[13:07:59] <frimend> but I can't scale this icon up, since I don't know what tool is responsible for the icon in the first place.
[13:08:26] <frimend> Is this a html issue? jsf issue? primefaces issue? Should I find the icon and edit it in paint?
[13:08:35] *** bindaas has joined ##java
[13:08:54] <Guyman> how does String implements comparator? it doesnt have compare method
[13:08:57] <selckin> too small scale
[13:09:20] *** rigved has quit IRC
[13:09:26] <frimend> yes, but I don't need a solution for this specific problem.
[13:09:29] <selckin> Guyman: you can compartor and compareable 2 diffrend interfaces
[13:09:37] <frimend> I need to learn how to tackle this type of problems.
[13:09:41] *** wessel has quit IRC
[13:09:58] <Guyman> oh right, my bad
[13:09:59] <selckin> "i need highy dynamic websites" "a website with mostly static content", would be something to decide if jsf is good or not
[13:10:37] *** nodie has joined ##java
[13:10:55] <RLa> for image problem, the solution is to scale it up, not worry about all those other things :) you need to start think less about technical details
[13:11:15] <selckin> showing an image is css/html in the end no mather what you use
[13:11:22] *** Vikash has quit IRC
[13:11:23] <selckin> you need to know those basics if you want to make a website
[13:11:45] <selckin> then find what support you framework has to alter those
[13:12:00] *** frangiz has quit IRC
[13:12:32] <webczat> Does java jre take a lot of memory?
[13:12:57] <selckin> no, yes and maybe
[13:13:15] *** frangiz has joined ##java
[13:13:48] *** Tashtego has quit IRC
[13:13:50] <frimend> ok, further about this picture.
[13:13:59] <frimend> <p:commandButton action="#{filterBean.getXSDasFile}" ajax="false" title="Last Ned" image="ui-icon ui-icon-arrow-1-s">
[13:14:02] <frimend> <f:setPropertyActionListener value="#{xsd}" target="#{filterBean.selectedXSD}" />
[13:14:05] <frimend> </p:commandButton>
[13:14:07] *** brundlefly has quit IRC
[13:14:29] *** halhorn has quit IRC
[13:14:31] <frimend> How on earth do I "scale" this up.
[13:14:52] <selckin> i have never used jsf in my life so i don't know, but ui-icon looks like some css class name (guessing)
[13:14:58] *** harry_ has joined ##java
[13:15:02] *** halhorn has joined ##java
[13:15:21] <frimend> Do I bypass the primefaces and jsf things alltogether? If I try to add a attribute scale, that would probably be attached to the button, and not to the image I guess?
[13:15:59] <frimend> selckin: your guess is probably better than mine. :D
[13:18:09] <selckin> so the image is a name to the file, you can size that, or supply like a css attribute i guess, depends if you want to change everything or only in this case etc
[13:18:16] <selckin> read documentation
[13:18:18] <frimend> It's like when you are trying to solve a multi-variable ecuation.
[13:18:34] <frimend> if you set some variables to a fix value, you can better understand the other variables.
[13:18:59] <frimend> but in my case, I feel unable to pin down any of all these variables.
[13:22:49] *** [[thufir]] has quit IRC
[13:22:54] <webczat> Do java programs take much memory?
[13:23:22] <RLa> when you have two maps what would be the nicest way to iterate over keys that are in either of map?
[13:23:49] *** halhorn has quit IRC
[13:24:10] *** Myth17 has joined ##java
[13:24:15] *** halhorn has joined ##java
[13:25:02] <frimend> iterating over one, and then the other for all keys that the other map does not contain?
[13:25:43] <RLa> yeah, that would work
[13:25:51] <Guyman> comparator doesnt have to return either -1,0,1 , right?
[13:26:12] <selckin> for (Key key : Sets.intersecton(map1.keySet(), map2.keySet())) { map[1|2].get(key) }
[13:26:13] <selckin> :/
[13:26:34] <selckin> Guyman: no it only cares if it's equal langer or smaller then 0
[13:26:58] *** [[thufir]] has joined ##java
[13:27:13] <frimend> oh, it seems that it's yet another tool that is responsible for the icon.
[13:27:16] <frimend> jQuery.
[13:27:33] <Guyman> selckin, if doing classes hirarchy like i've mention, the super class doesnt have to have "implements comparator", only the inner classes should, right?
[13:27:49] <frimend> I think there are more tools involved in this project, than there is lines of code. :(
[13:27:55] *** Edulix has joined ##java
[13:28:01] <Edulix> hi people
[13:28:01] <selckin> Guyman: notting needs to have implements compartor
[13:28:17] <selckin> Guyman: comperable is the one you implement on your objects
[13:28:34] <selckin> frimend: this where you ask a college
[13:29:07] <Edulix> how can I create a DataInputStream out of a RandomAccesFile instance?
[13:29:36] <Guyman> selckin i want to have different comparing methods for the same objects..
[13:30:05] <selckin> Guyman: then don't implement compareable, and just have comperators
[13:30:29] <frimend> selckin: :)
[13:30:49] <frimend> What tools do you find usefull generally?
[13:30:58] <frimend> Is there some things that comes back over and over again?
[13:31:57] <Edulix> I have a nuch of classes that depend on having a DataInputStream, and I want to give one to them, but first want to be able to do a seek in the file
[13:32:39] *** teralaser has joined ##java
[13:32:39] <selckin> so basicly uo want a datainputstream that skips x bytes?
[13:32:43] *** srm has quit IRC
[13:32:49] <selckin> which would be easier
[13:34:39] *** TomyLobo has joined ##java
[13:34:56] <Edulix> selckin: seek != skip
[13:34:59] <Edulix> big difference
[13:35:07] <Edulix> I want it to be *fast*
[13:35:29] <RLa> selckin, where is Sets class from?
[13:35:36] <selckin> RLa: google guava
[13:36:43] <TomyLobo> http://codepad.org/ylH1dHQz Can anyone tell me why the first assignment works and the 2nd does not? Does that mean Map<String,List<...>> extends Map<String,? extends Iterable<...>>?
[13:36:44] <selckin> Edulix: probably have to inmplement DataInput on top of your Random then
[13:37:15] <selckin> ~generics faq
[13:37:15] <javabot> selckin, what does that even *mean*?
[13:37:18] <Edulix> selckin: selckin: DataInput is already implemented there
[13:37:33] <selckin> ~generics faq is http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html
[13:37:34] <javabot> OK, selckin.
[13:37:56] <selckin> Edulix: then problem solved?
[13:38:09] <Edulix> selckin: can I create a DataInputStream from a DataInput?
[13:38:28] <selckin> it's an inmplementation of DataInput iirc, so change you api to accept datainput
[13:39:11] <selckin> been ages since i used those, probably remember wrong, afk
[13:39:15] <Edulix> selckin: what if I can't? extenal lib
[13:39:27] <Edulix> external*
[13:39:50] *** frangiz has quit IRC
[13:39:52] <TomyLobo> ok i'm confused
[13:40:08] <selckin> TomyLobo: don't worry, we all are
[13:40:08] <TomyLobo> that faq explicitly states that List<Object> is not a supertype of a List<String>
[13:40:56] <TomyLobo> but in my case Map<...,? extends Iterable> is a supertype of Map<...,List>?
[13:41:13] <Edulix> selckin: it seems you're right, seems like DataInputStream is an implementation of DataInput and Closable, both also implemented by RandomAccessFile so.. .can't I just do a casting?
[13:41:31] <selckin> Edulix: no, bad library is bad
[13:41:31] <Planck_> List<? extends Object> isn't the same type as List<Object>
[13:41:42] <Edulix> selckin: can't do a casting?
[13:42:16] <selckin> Edulix: same way you can't pass a LinkedList to a method taking an ArrayList no
[13:42:21] <Edulix> selckin: well I can inherit from DataInputStream and reimplement all the methods
[13:42:22] <Edulix> ok
[13:42:33] <selckin> yes you can do that
[13:42:43] <TomyLobo> Planck_ i know, but doesnt still List somehow extend the ? extends Iterable thing?
[13:42:44] <selckin> should probably be simple forwards
[13:42:50] <Edulix> selckin: yeah
[13:42:54] <Edulix> ok I'll do that thanks
[13:44:12] *** supercosmonaut has quit IRC
[13:44:31] *** frangiz has joined ##java
[13:45:37] *** Myth17 has quit IRC
[13:46:28] <TomyLobo> Wildcard parameterized type can NOT be used [...] as supertypes
[13:46:32] <TomyLobo> confusion++;
[13:46:56] <TomyLobo> i guess that means in class declarations
[13:49:20] *** aLeSD has joined ##java
[13:49:22] <aLeSD> hi all
[13:49:34] <aLeSD> what does mean to declare an inner class as static ?
[13:50:09] <selckin> doesn't have a reference to the outer class, basicly just like any other class
[13:50:43] <aLeSD> ok
[13:51:23] <TomyLobo> there's a whole lot about arrays in that section but nothing about assignment
[13:51:31] <TomyLobo> i.e. automatic conversion
[13:52:29] <L-----D> Is that correct I need TemporalType.TIMESTAMP if I need both date and time?
[13:52:41] <L-----D> in JPA
[13:55:09] <selckin> TomyLobo: foo<T> extends bar<T>, if T in the earlier one is ? extends, it has to be ? extends in bar, in the 2nd you are changing the type there, (i don't know formal wording, just how made it sense of it in my brain), the type is inherrited and has to remain the same
[13:55:54] <selckin> where foo is Map and bar iterable
[13:56:01] <selckin> err list
[13:56:06] <selckin> i need sleep
[13:56:14] *** rjohnson19 has joined ##java
[13:57:05] <TomyLobo> ok, that makes some sense :)
[13:57:10] <TomyLobo> thanks
[13:58:16] *** epure_ has quit IRC
[14:00:36] <RLa> map = new HashMap<K, V>(oldMap) <- will modifications to map reflect in oldMap too?
[14:01:17] <selckin> no
[14:01:42] <TomyLobo> if you want that, just do map = oldMap; :)
[14:01:43] <selckin> if you change the value objects sure, but if you put or remove
[14:01:50] <selckin> diffrend maps
[14:02:01] *** deSilva has joined ##java
[14:02:24] <dreamreal> morning
[14:02:37] *** Meta234234 has joined ##java
[14:02:43] *** Meta234234 is now known as Metz
[14:03:31] *** bitshuffler_ has joined ##java
[14:03:33] *** Metz has left ##java
[14:04:45] *** bitshuffler has quit IRC
[14:05:55] *** lidel has joined ##java
[14:07:33] *** sebrock has joined ##java
[14:07:47] *** brig has quit IRC
[14:10:24] *** lidel has quit IRC
[14:10:56] *** pen has joined ##java
[14:10:56] *** pen has quit IRC
[14:11:05] *** sarg has joined ##java
[14:11:21] *** pen has joined ##java
[14:11:21] *** pen has quit IRC
[14:11:27] *** lidel has joined ##java
[14:11:45] *** pen has joined ##java
[14:11:45] *** pen has quit IRC
[14:12:04] *** zatan has quit IRC
[14:12:10] *** pen has joined ##java
[14:12:10] *** pen has quit IRC
[14:12:36] *** pen has joined ##java
[14:12:36] *** pen has quit IRC
[14:13:00] *** pen has joined ##java
[14:13:00] *** pen has quit IRC
[14:13:29] *** pen has joined ##java
[14:13:30] *** pen has quit IRC
[14:13:54] *** pen has joined ##java
[14:13:54] *** pen has quit IRC
[14:14:22] *** pen has joined ##java
[14:14:22] *** pen has quit IRC
[14:15:07] *** al80 has joined ##java
[14:15:13] *** pen has joined ##java
[14:15:13] *** pen has quit IRC
[14:15:38] *** pen has joined ##java
[14:15:38] *** pen has quit IRC
[14:16:03] *** pen has joined ##java
[14:16:03] *** pen has quit IRC
[14:16:27] *** pen has joined ##java
[14:16:27] *** pen has quit IRC
[14:16:51] *** pen has joined ##java
[14:16:51] *** pen has quit IRC
[14:17:16] *** pen has joined ##java
[14:17:16] *** pen has quit IRC
[14:17:39] <Martin8412> wtf
[14:17:41] *** pen has joined ##java
[14:17:41] *** pen has quit IRC
[14:17:57] <kaemo> wanted to ask same thing
[14:18:06] *** pen has joined ##java
[14:18:06] *** pen has quit IRC
[14:18:26] *** supercosmonaut has joined ##java
[14:18:30] *** cheeser sets mode: +b *!~pen@g1pc2n126.g1.ntu.edu.tw
[14:22:08] <Martin8412> Thanks :P
[14:24:24] *** sarg has quit IRC
[14:25:03] *** asiekierka has joined ##java
[14:25:07] <asiekierka> hi
[14:25:18] *** harry_ has quit IRC
[14:25:57] <asiekierka> i'm using an OutputStream and a Socket to send packets, but i'm having a weird issue
[14:26:07] <asiekierka> if i give it a packet, it won't send it until i give it another packet
[14:26:19] <asiekierka> the other packet won't be then sent when it's given yet another packet
[14:26:23] <asiekierka> and i have no idea why's that
[14:27:04] *** Alundra has joined ##java
[14:27:06] <selckin> things can be buffered for one
[14:27:46] <asiekierka> the point is i don't want them buffered
[14:28:03] <asiekierka> it's a game and it can't really have such an issue
[14:28:05] <selckin> impossible, you can flush the buffer tho
[14:28:37] <asiekierka> tried
[14:28:41] <asiekierka> does not really help :[
[14:28:58] <Alundra> I have a JTextField and a JTextArea. I want the string written in the JTextField to copy over to JTextArea when the user press Enter. What kind of event listener should I use?
[14:29:19] <selckin> asiekierka: then provide more info
[14:29:33] <asiekierka> like what? i can't copy-paste the entire game here
[14:29:44] <vengeancex32> Maybe you can setTcpNoDelay on the socket to true?
[14:29:45] <asiekierka> it's open-source though
[14:30:09] <selckin> ~test case
[14:30:10] <javabot> selckin, sscce is a minimal independently runnable program, which demonstrates the problem; see http://www.pscode.org/sscce.html for details and a HOWTO
[14:30:59] <dreamreal> is it minecraft?
[14:31:05] <asiekierka> dreamreal no
[14:31:06] <asiekierka> it's 64pixels
[14:31:10] <asiekierka> http://github.com/asiekierka/64pixels
[14:31:13] <dreamreal> thank goodness :)
[14:31:25] <asiekierka> setTcpNoDelay IS set
[14:31:26] <asiekierka> to true
[14:31:29] <asiekierka> but that doesn't help
[14:31:50] <selckin> could be on the reading side too.
[14:31:53] <asiekierka> maybe it's the fact the problematic packets are... well, one-byte?
[14:34:28] *** DerHorst has joined ##java
[14:35:10] *** harry_ has joined ##java
[14:37:24] *** srm has joined ##java
[14:39:02] *** winux has quit IRC
[14:40:10] *** winux has joined ##java
[14:40:47] *** supercosmonaut has quit IRC
[14:42:50] *** staar2 has quit IRC
[14:43:32] *** eidolon has joined ##java
[14:44:04] *** PelleTut has joined ##java
[14:45:10] *** tewecske has joined ##java
[14:45:21] *** ferret_ has quit IRC
[14:45:31] *** frangiz has quit IRC
[14:45:31] *** ferret_ has joined ##java
[14:45:51] *** frangiz has joined ##java
[14:51:09] *** blackswan has joined ##java
[14:53:18] <blackswan> i have a JNI application that calls FindClass to load a class. with sun's JRE, it works. with the OpenJDK JRE, FindClass returns NULL, but there is no exception raised. any ideas, explanations, or thoughts about how i might debug this besides looking at the source for FindClass?
[14:53:51] *** Neremor has joined ##java
[14:54:02] <selckin> does the class exist?
[14:54:27] <blackswan> yes. it works just fine using sun's JRE.
[14:54:39] <selckin> and it's a sun.com class?
[14:54:41] <selckin> :)
[14:55:00] <blackswan> no, it's org.opencyc.api.CycAccess, actually
[14:56:05] *** aaron11 has joined ##java
[14:59:07] <aaron11> Hey guys im kinda working on a game here and I am working on the refresh rate of the jframe but every time i give timer(5, Action); it wont accept those parameters. Am I doing something wrong? What is a work around to this?
[14:59:10] <blackswan> any idea where the source for (*env)->FindClass() is?
[14:59:14] *** Optic has left ##java
[15:00:24] <selckin> blackswan: http://www.google.com/codesearch?as_q=openjdk+findclass
[15:01:32] <al80> Hibernate question. From documentation "AFTER_STATEMENT (also referred to as aggressive release): releases connections after every statement execution" does this means that aggressive release mode we have many transaction as in autocommit mode?
[15:01:43] *** PrimeZ has joined ##java
[15:02:59] <aaron11> Anybody?
[15:03:43] <aaron11> After learning game programing for Java applications i can do it for Android
[15:04:02] <selckin> your question does not include enough information for a sane awnser
[15:04:15] <aaron11> sebrock, What do you desire?
[15:04:30] *** Snicksie has joined ##java
[15:04:45] <aaron11> Does it accept parameters still?
[15:05:16] *** cool123 has joined ##java
[15:05:18] <eidolon> aaron11: did you look at the javadocs for the method?
[15:05:25] <aaron11> Yes
[15:05:27] <eidolon> that will tell you what parameters it takes.
[15:05:40] <aaron11> It says it accepts, but when i do in eclipse it acts bad
[15:05:50] <eidolon> 'acts bad'?
[15:05:59] <aaron11> Yeah as in doesnt accept
[15:06:03] <selckin> ~doesn't work
[15:06:03] <javabot> selckin, doesn't work is useless. Tell us what it is, what you want it to do, and what it is doing. Consider putting some code and any errors on a pastebin. (use ~pastebin for suggestions)
[15:06:05] *** L-----D has quit IRC
[15:06:23] <aaron11> Ok
[15:06:23] <eidolon> then the method you're using in eclipse is not the one you're looking at in the javadocs. make sure you've imported the right class.
[15:06:34] *** supercosmonaut has joined ##java
[15:06:42] <Snicksie> while trying to run a test (junit4 test) i'm getting this error: java.lang.ClassNotFoundException: SquareTest ; i assume it is because i created this project within svn with subclipse, but i have no idea how to fix this. can anyone help me? :)
[15:06:46] <eidolon> a good test is to hover over the method and see what package it's actually coming from.
[15:06:53] <eidolon> ~tell snicksie about classpath
[15:06:54] <javabot> The user snicksie is not on ##java
[15:07:09] <eidolon> ~tell Snicksie about classpath
[15:07:10] <javabot> Snicksie, 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:07:29] <eidolon> wtf? javabot is case sensitive?
[15:07:33] <blackswan> selckin: FindClass is the name of a struct member containing a function pointer; i think the actual function is named something completely else, and i can't find it in the openjdk source tree
[15:07:52] <selckin> blackswan: try #openjdk
[15:07:52] <aaron11> eidolon, java.util.Timer, but did import it
[15:07:58] <blackswan> thx
[15:08:05] <selckin> blackswan: on oftc tho
[15:08:14] <blackswan> oftc/
[15:08:17] <blackswan> oftc?
[15:08:42] <selckin> diffrend network
[15:08:42] <blackswan> oh. thx
[15:08:53] *** _bugz_ has quit IRC
[15:10:06] *** blackswan is now known as quarkbuddha
[15:10:17] *** Cymage has joined ##java
[15:11:10] *** psst has joined ##java
[15:12:02] <Snicksie> eidolon, what part of my classpath is wrong then? :$ i didn't change anything, so i have no idea why it doesn't work
[15:12:34] <aaron11> http://paste.ubuntu.com/575978/
[15:12:37] <aaron11> Here thats the code
[15:12:46] <eidolon> read the paste again. your compiler is saying class not found error, and telling you waht class it can't find. classes are found on the classpath. that class is not being found on the classpath.
[15:12:52] <eidolon> it's a fairly simple problem :)
[15:13:13] <aaron11> ^You typed that that fast?!
[15:13:25] <Snicksie> well, i dont see why it wouldn't be found :(
[15:13:35] <aaron11> Oh to that dude :P
[15:13:49] * eidolon types very fast :)
[15:13:56] <aaron11> eidolon, Was that to me or him?
[15:14:37] *** PrimeZ has quit IRC
[15:14:46] <aaron11> eidolon, http://paste.ubuntu.com/575978/ thats the code with Timer having no parameters but when i add them it acts up
[15:15:36] <Snicksie> eidolon, when i'm copying the classes into another (not svn) project, it works perfectly. i compared the .classpath and i dont see anything missing...
[15:15:55] *** frangiz has quit IRC
[15:15:58] <eidolon> the .classpath is only used in eclipse.
[15:16:05] *** BeholdMyGlory has joined ##java
[15:16:13] <Snicksie> well, i am using eclips eidolon :)
[15:16:19] <eidolon> then fix the problem in eclipse, man :)
[15:16:37] <Snicksie> i have no idea what the exact problem is, that is the second problem ^^
[15:16:45] <eidolon> if this is an eclipse problem, try #eclipse - if eclipse is aying 'class not found', then your project has a misconfigured classpath or the class is spelled wrong. you could also try doing a rebuild project, eclipse sometimes gets confused.
[15:17:02] *** frangiz has joined ##java
[15:17:25] *** nodie has left ##java
[15:17:25] <aaron11> hmmmm... anyone have a "sane" answer?
[15:17:53] *** bitshuffler__ has joined ##java
[15:18:26] <selckin> wrong import?
[15:18:36] <selckin> java.util.Timer javax.swing.Timer
[15:19:07] *** tigger0jk has quit IRC
[15:19:30] *** merunner has joined ##java
[15:20:33] <eidolon> selckin: i've told him that, he's not listening :)
[15:20:36] <Guyman> why do i get this weird error? Cannot invoke compareTo(long) on the primitive type long
[15:21:02] <Guyman> when a and test are File objects, test.lastModified().compareTo(a.lastModified())
[15:21:03] *** bitshuffler_ has quit IRC
[15:21:08] <selckin> eidolon: sorry, didn't read most of it
[15:21:18] <eidolon> selckin: 'sok. neither did he :)
[15:21:58] <selckin> Guyman: the return value of lastmodified() is not a file object
[15:22:15] <Guyman> its a number
[15:22:20] <Guyman> how can i compare between those two?
[15:22:34] <Guyman> umm probably using subtraction.. lol
[15:22:44] <selckin> you can just subtrack one from the other to have compareTo() behavior
[15:22:53] <Guyman> yes.. stupid me, thanks
[15:23:24] <Guyman> but im suposed to switch the signs, right?
[15:23:38] *** Neremor has quit IRC
[15:23:47] <Guyman> oh nvm
[15:25:26] *** Alundra has left ##java
[15:34:56] *** cool123 has quit IRC
[15:36:41] *** anaconda has quit IRC
[15:37:32] *** bn` has quit IRC
[15:37:45] *** anaconda has joined ##java
[15:37:50] *** Alundra has joined ##java
[15:38:16] <Guyman> if i build a program and implement compartor in it, and then use the implementation, does it make sense i wont have to import java.util.comparator? it looks weird for me
[15:38:45] *** `moebius` has joined ##java
[15:39:17] <selckin> if you don't have "Comparator" in your java file you don't need the import
[15:39:36] <selckin> imports are just name aliases to make them shorter, so you don't have to type the full thing
[15:40:14] *** kermit has joined ##java
[15:41:09] <Guyman> alright
[15:41:12] *** bitshuffler has joined ##java
[15:41:38] *** E-sense has quit IRC
[15:41:39] *** tilerendering has joined ##java
[15:41:42] <Guyman> and regarding to the way we talked about , with nester classes, it makes me be forced to import also the outer class AND the inner classes
[15:41:46] <Guyman> anyway to go around this?
[15:41:55] <Guyman> import orders.FileComparator;
[15:41:56] <Guyman> import orders.FileComparator.*;
[15:42:14] <dreamreal> those aren't nested classes
[15:42:14] <selckin> ~star imports
[15:42:14] <javabot> selckin, star imports is http://en.wikibooks.org/wiki/Java_Programming/Packages#Wildcard_imports
[15:42:19] <dreamreal> you don't import things that way
[15:44:30] *** bitshuffler__ has quit IRC
[15:46:54] <Guyman> ok, thank you
[15:47:15] *** riotz has quit IRC
[15:47:23] *** frangiz has quit IRC
[15:47:26] <TomyLobo> what kind of phony argument is that?
[15:47:46] <TomyLobo> there are much better arguments for not using wildcard imports
[15:48:15] *** frangiz has joined ##java
[15:48:24] *** lolsuper_ has joined ##java
[15:48:33] <selckin> used to link to somethign else anyway
[15:49:15] *** riotz has joined ##java
[15:50:15] *** LouisJB has joined ##java
[15:50:19] <TomyLobo> typography... the import statement basically is one more place to spell wrong
[15:51:17] <selckin> doesn't mather much anyway
[15:52:10] *** glcrazy has joined ##java
[15:52:16] *** harry_ has quit IRC
[15:52:33] *** harry_ has joined ##java
[15:56:22] *** cool123 has joined ##java
[15:56:51] *** matsebc has joined ##java
[15:57:00]
[15:57:11] *** hyppias has quit IRC
[15:57:13] <Guyman> it did made me import it to the outer class where i had my inner class implementing the compartor
[15:57:17] <Guyman> it didnt work without that
[15:57:37] <TomyLobo> Guyman you dont import to classes
[15:57:41] <TomyLobo> you import to translation units
[15:57:41] * selckin throws parse error
[15:57:59] <TomyLobo> throw new Up();
[15:58:56] <TomyLobo> doesnt quite cut it as much as "throw up();" or "emit vomit();" (Qt)
[15:59:19] *** srm has quit IRC
[15:59:38] *** srm has joined ##java
[16:01:52] *** bitshuffler_ has joined ##java
[16:01:54] *** deSilva has quit IRC
[16:03:41] *** bitshuffler has quit IRC
[16:03:57] <Guyman> its not a good idea to downcast the object recieved at compare(Object o, Object o2) to a specific object which i need this comparator just for it?
[16:04:23] *** fisted_ is now known as fisted
[16:04:35] <TomyLobo> can you formulate that as a statement+a question
[16:04:42] <selckin> use generics
[16:05:04] <TomyLobo> state what you are doing and then your question about it... well next time
[16:07:09] <Guyman> TomyLobo i was assuming selckin will answer me , and he knows what im trying to do
[16:07:22] <Guyman> we didnt learn generics yet (yeah , stupid, i know)
[16:07:46] <TomyLobo> you're supposed to use generic interfaces without having learned generics?
[16:08:05] <selckin> then just cast it
[16:08:35] <TomyLobo> they should just teach you some collections first, then introduce generics with them, then move on to more advanced stuff
[16:08:50] *** supercosmonaut has quit IRC
[16:09:08] <selckin> they'd probably teach vector anyway
[16:09:13] <TomyLobo> :D
[16:09:48] <Guyman> i also dont know why we didnt learn those stuff yet.. its the second simester already
[16:09:59] <Guyman> anyway, downcasting would be fine ?
[16:10:07] <selckin> just learn on you're own if you every wanna do this for a living
[16:10:13] <selckin> else you won't get anywhere
[16:10:30] <Guyman> if they wont teach me that properly then i guess i will..
[16:10:39] <TomyLobo> i dont know why you spend 2 semesters *learning* java
[16:10:53] <Guyman> just 1 in the mean time :D
[16:10:56] *** supercosmonaut has joined ##java
[16:11:06] <Guyman> anyway its a very repsected university, i trust them
[16:11:10] <Guyman> respected*
[16:11:12] <selckin> well don't
[16:11:13] <selckin> trust me
[16:11:15] <dreamreal> you do?
[16:11:16] <Guyman> lol
[16:11:16] <TomyLobo> after 1 semester, we had opal (a functional language) and some virtual machine assembler
[16:11:33] <Guyman> ..
[16:11:52] <dreamreal> "Sure, they are teaching me stuff that real programmers laugh at, but I trust them"
[16:11:53] <TomyLobo> 2nd semester was java and, iirc, another assembler
[16:12:23] <dreamreal> "When I spout the rubbiush they teach me, it's always right, but none of it compiles and I can't get it to match what everyone else suggests... but I trust them"
[16:12:35] <dreamreal> "Sure, they're always wrong, but I TRUST THEM"
[16:12:44] * dreamreal sighs
[16:12:51] *** Speed` has joined ##java
[16:12:53] <TomyLobo> 3rd was algorithms (taught in a generic way, but by the example of java) and yet another assembler :D
[16:14:51] <TomyLobo> 4th was concurrency (java again) and m68k asm
[16:15:23] *** wchun has joined ##java
[16:15:37] *** Fuco has joined ##java
[16:15:48] <selckin> sounds like a good one, most of the school courses i've seen are really bad and don't teach you anything usefull
[16:15:50] <TomyLobo> dreamreal i think it's more like "I paid them money, so I TRUST THEM"
[16:16:28] *** supercosmonaut has quit IRC
[16:16:42] <TomyLobo> selckin the best part: it's a public university, which means it was free
[16:17:07] <TomyLobo> except for some management fees or something
[16:17:31] *** Carnage\ has quit IRC
[16:19:27] <webczat> Why servers having one thread for each user are bad?
[16:20:08] <selckin> contex switches used to be really expensive & other stuff, it's a less of a problem now
[16:20:16] *** bobbytek has joined ##java
[16:20:34] <TomyLobo> this server here has 2 for each user
[16:21:00] <TomyLobo> but it's a game server, so it's like 20 users at the same time on a big server
[16:21:27] <TomyLobo> webczat what kind of server are you dealing with?
[16:22:04] <bobbytek> What is the recommended serialization technology for persisting java objects across processes? xstream? native java serialization? Something else entirely (kyro)?
[16:22:08] <selckin> if you have 20 users you can basicly do whatever you want
[16:22:30] *** harry_ has quit IRC
[16:22:37] <TomyLobo> not quite. there is some heavy lifting going on
[16:22:46] <TomyLobo> sending map changes to users
[16:22:57] <selckin> bobbytek: i like xstream over java serial, because i can still edit it if the classes change etc, what exactly is the use case?
[16:23:25] <webczat> I need something that can carry thousants of users if needed.
[16:23:46] <TomyLobo> webczat how many simultaneously?
[16:24:12] <TomyLobo> how many of them are doing a request at the same time
[16:24:14] <RLa> webczat, main case against threads is also stack memory each thread requires
[16:24:26] <webczat> thousants. i mean i'm creating a chat server that's open-source so it should be good for usage for small or large userbases.
[16:24:59] <webczat> and that means it's unpredictable
[16:25:06] <selckin> complexity goes up by a million tho, have you writen things like this before?
[16:25:13] <RLa> webczat, have you looked at netty or mina?
[16:25:19] *** tilerendering has quit IRC
[16:25:36] <TomyLobo> webczat what's wrong with IRC? :)
[16:25:41] <webczat> i don't want to use any frameworks. I can do low level things if needed
[16:25:52] <webczat> TomyLobo: I have reasons.
[16:25:53] <bobbytek> selckin: I need to dump state at the end of a run. We want to reinitialize state at the start of the next run (batch processing). So there is only ever 2 interactions with serialization files per run.
[16:25:53] *** quarkbuddha has left ##java
[16:26:03] <selckin> webczat: then go read up on nio
[16:26:06] <RLa> TomyLobo, some people want to reinvent wheel
[16:26:15] <webczat> ahh, async/nio?
[16:26:36] <webczat> I was looking on some other approach that is in the standard library, but if no...
[16:26:50] <selckin> non blocking is the keyword
[16:27:09] <webczat> selckin: async too due to use of selectors
[16:27:37] <selckin> bobbytek: don't think it mathers much then?, if it's just serialize once/read & throw away, make test performance or whatever you do care about :/
[16:28:23] <bobbytek> Right, and I've read that xstream is actually faster than native serialization. Is this your experience?
[16:28:40] <selckin> never tested it
[16:28:50] <bobbytek> It will be archived as well. So, not thrown away
[16:29:03] <bobbytek> Just incase we want to rerun for a past date
[16:29:13] <webczat> When do you use nio and when .io, if you don't do nonblocking io?
[16:29:35] <webczat> Or maybe should you wrap the nio channel somehow in a reader/writer (it's possible) and use the channel for selecting?
[16:30:39] <selckin> xstream makes it a lot easier to still load the data if the classes change, which is my main motivation to using it
[16:31:31] <webczat> Is it a good idea?
[16:31:45] *** terranova has joined ##java
[16:31:51] <selckin> it makes no sense what so ever
[16:31:55] *** terranova has quit IRC
[16:32:05] <bobbytek> Cool, thanks for your input selckin :)
[16:32:25] *** terranova has joined ##java
[16:32:47] <webczat> selckin: if my protocol is line-oriented, i must wait for any of my user sockets to be ready for reading and read a line.
[16:33:05] <RLa> webczat, no
[16:33:13] *** tilerendering has joined ##java
[16:33:39] <webczat> so what?
[16:33:50] <RLa> webczat, you read as much as you can, and when you have read whole line, then fire event
[16:34:53] <webczat> RLa: so what? read single bytes until it'll tell that it needs more data?
[16:35:04] *** Develman has joined ##java
[16:35:17] <selckin> or you can go read the documentation first
[16:36:31] <webczat> selckin: I currently don't have one, and I'm reading something else related to java, so it's impossible currently.
[16:37:01] * selckin explodes
[16:39:42] *** Yekram has joined ##java
[16:39:48] <Yekram> Morning
[16:40:20] *** Versuchen has joined ##java
[16:40:49] <Yekram> I have some source that is not set up as a project and I have tried eclipse and netbeans
[16:40:55] *** asiekierka has quit IRC
[16:41:27] <Yekram> It seems the source is amess I cannot seem to get any builds of certain versions out, especially the latest
[16:41:59] <Yekram> Is there anyone here willing to download and look at this source and possibly give me some pointers?
[16:44:07] *** riotz has quit IRC
[16:45:55] <_W_> no, but you can describe the problem in more detail
[16:46:11] <Yekram> No problem
[16:46:11] <_W_> are there dependencies not found? A specific error in the build file? Straight up compile errors?
[16:46:16] <_W_> oh ok
[16:46:18] <_W_> ~next
[16:46:18] <javabot> Another satisfied customer. Next!
[16:46:31] <Yekram> You eanted deatil, first, I am not a java programmer
[16:46:46] <Yekram> my experience is just some basic vb 6
[16:46:49] <selckin> this better not be minecraft
[16:46:49] <_W_> then you're in the wrong place to get help I am afraid
[16:47:12] *** al80 has quit IRC
[16:47:19] *** Tuplanolla has joined ##java
[16:47:44] <Yekram> well I was kind of hoping someone here would take a look at the source structure
[16:47:50] <_W_> ~tech support
[16:47:50] <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:48:22] <Tuplanolla> May I ask what's wrong here?
[16:48:24] <Tuplanolla> http://pastebin.com/BFda7Syd
[16:48:25] <Yekram> I already did that and I am still waiting on a response
[16:48:34] <_W_> wait more
[16:48:42] *** matsebc has quit IRC
[16:48:43] <Yekram> I did spend 17 hours straight poking a it :(
[16:49:09] *** matsebc has joined ##java
[16:49:15] <_W_> Tuplanolla, your manifest
[16:49:27] <_W_> Tuplanolla, specify the main class with dots, not slashes
[16:49:35] <Yekram> I am really interewsted in learning more coding in java, atm though, I think I just need to better organize the code
[16:49:37] <_W_> oh wait no
[16:49:44] <_W_> that's just a really confusing error message ><
[16:50:31] * selckin wonders if th ere is a dir named .
[16:50:34] <Yekram> The original coders did not set up project file of any kind.
[16:50:45] <Yekram> thats funny
[16:50:48] <_W_> Tuplanolla, to rule out some problem with the manifest, try java -cp piestalk.jar tuplanolla.piestalk.Piestalk
[16:51:35] <Tuplanolla> That gives the same error.
[16:51:41] <Yekram> I guess I will just put up a post for coder to make a quick grand in 30 mins...
[16:51:51] <Yekram> thank anyway..
[16:51:56] *** Yekram has quit IRC
[16:52:09] *** plarsen has joined ##java
[16:52:11] <Tuplanolla> That's strange.
[16:52:29] <_W_> Tuplanolla, no idea then - I am not familiar with that kind of error from the compiler. Perhaps it means your native dependencies could not load?
[16:52:59] <_W_> try making the main class trivial - just instantiating and calling out to another class
[16:53:16] * Tuplanolla tries it with -Djava.library.path etc.
[16:53:17] <_W_> (assuming it is not already)
[16:54:17] <Tuplanolla> Okay. That was really stupid.
[16:54:23] <Tuplanolla> I forgot -cp ..
[16:54:29] <Tuplanolla> This is the second time over I do this.
[16:54:59] *** E-sense has joined ##java
[16:58:07] *** PelleTut has quit IRC
[16:58:33] *** caverdude has joined ##java
[16:58:48] <Tuplanolla> java -cp .;.\tuplanolla\piestalk\jar\piestalk.jar tuplanolla.piestalk.Piestalk works, but java -cp . -jar .\tuplanolla\piestalk\jar\piestalk.jar does not.
[16:59:04] *** c_axis has joined ##java
[16:59:38] *** pZombie has quit IRC
[16:59:40] <Guyman> object File doesnt have a method to check the size of the file?!
[16:59:42] <Tuplanolla> That's nice.
[17:00:05] <Tuplanolla> My manifest has Class-Path: ., shouldn't that be super effective?
[17:00:09] <selckin> ~javadoc file.length()
[17:00:10] <javabot> selckin: http://is.gd/DSTA5L [JDK: java.io.File.length()]
[17:00:26] <selckin> Tuplanolla: it super duper error prone & evil
[17:00:27] <Guyman> thats one smart bot
[17:00:43] <Guyman> google should hire him
[17:00:43] <eidolon> Guyman:   Returns the length of the file denoted by this abstract pathname.
[17:00:48] <eidolon> .length()
[17:00:52] <eidolon> read the javadocs.
[17:00:58] <Guyman> how was i supposed to guess "length " = "size "?
[17:01:02] <Guyman> i did read
[17:01:13] <eidolon> no, you didn't.
[17:01:13] <Guyman> i did
[17:01:13] <eidolon> if you had read, you would have read that line.
[17:01:20] *** zemanel has joined ##java
[17:01:24] <Guyman> i did read it, and i didnt know length means size
[17:01:25] <eidolon> and woudl have gone "Oh look, that's how i find out the size of a file."
[17:01:33] *** kUrld has joined ##java
[17:01:36] <tjsnell> what did you think length meant?
[17:01:38] * eidolon moves on.
[17:01:44] <Guyman> well, since when length is size?
[17:01:48] <Guyman> i dont know, but not size
[17:01:48] <tjsnell> what did you think length meant?
[17:01:51] <Guyman> why isn't it size then?
[17:02:05] <_W_> the length of the file could obviously be less than the size of the file, if the file is laid out in multiple rows, for instance*!
[17:02:14] <_W_> *) may not be serious
[17:02:21] <Tuplanolla> How can I make my jar executable if it can't be passed the class path then?
[17:02:27] <eidolon> Guyman: if you don't like it, submit a feature request to sun^Uoracle and they'll change it, just for you.
[17:02:48] <Guyman> eidolon im doing that right now
[17:02:50] <eidolon> is it Stupid day on #java? did i miss an announcement?
[17:02:51] <whaley> Tuplanolla: you can specify a class path in the manifest
[17:03:33] <Tuplanolla> I have . specified in the manifest and it fails unlike -cp . (without -jar).
[17:03:34] <Guyman> or is it maybe patronizing day?
[17:03:34] <_W_> whaley, selckin told him that was evil without qualifying
[17:03:43] <whaley> ~evil
[17:03:43] <javabot> calling some practice or tool "evil" without a justifying argument is not helpful to productive discourse; it is deliberately inflammatory, and exposes your own ignorance of logic and argument. Check out http://en.wikipedia.org/wiki/Logical_fallacies for more information.
[17:03:51] <tjsnell> or pedantic twattery day
[17:04:12] <Guyman> or comedians day
[17:04:19] <_W_> I don't know enough about class paths and jar files myself - I never expect -jar to be used with my jar files
[17:04:28] <whaley> ^ ditto
[17:05:55] *** titankiller has joined ##java
[17:06:13] *** Matuku has joined ##java
[17:07:10] *** Develman has quit IRC
[17:08:30] *** kvarley has left ##java
[17:11:34] <titankiller> how do I assert two vectors of have EQUAL objects in them using junit?
[17:11:53] <_W_> ~~ titankiller javadoc Vector.equals(*)
[17:11:53] <javabot> titankiller: http://is.gd/YSDLEc [JDK: java.util.Vector.equals(Object)]
[17:11:57] <_W_> ~vector
[17:11:57] <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+)
[17:13:18] <titankiller> so your answer is assertTrue(a.equals(b)) ?
[17:13:38] <_W_> no
[17:14:03] <titankiller> then ?
[17:14:05] <webczat> How do you do plugin loading with java if you don't know the extension list?
[17:14:07] <_W_> I merely pointed out that given Vector's equals method, your problem resolves down to "how do I assert that two objects are equal in junit"
[17:14:19] <_W_> which you can find the answer to yourself
[17:14:29] <_W_> webczat, what?
[17:14:47] <_W_> I'll ignore the if there, I think
[17:14:52] <_W_> ~~ webczat plugin
[17:14:52] <javabot> webczat, to build a plugin based system you should consider either JPF (~jpf) or, for more complex uses, see OSGi.
[17:15:04] *** Lone_Rifle has joined ##java
[17:15:10] <webczat> jar has the possibility to specify extensions in it's manifest headers, or I can do it using a classpath. but can I also load it from some fixed location?
[17:15:36] <webczat> with java library itself
[17:15:37] <Lone_Rifle> you can do what my team did in a moment of folly
[17:15:39] *** Railgun has joined ##java
[17:15:39] <_W_> what do you mean by "extensions"? I don't know that piece of java terminology
[17:15:40] <Lone_Rifle> build your own class loader
[17:15:44] *** cool123 has quit IRC
[17:15:44] <Lone_Rifle> FileClassLoader
[17:15:49] *** BeholdMyGlory has quit IRC
[17:15:49] <titankiller> loop through the vector and test each object ?
[17:15:55] *** JDuke128 has quit IRC
[17:15:56] <eidolon> Lone_Rifle: I weep for your sanity.
[17:16:04] *** kUrld has quit IRC
[17:16:04] <_W_> Lone_Rifle, nice, a URLClassLoader that can only open files :p
[17:16:05] *** BeholdMyGlory has joined ##java
[17:16:05] <Lone_Rifle> those were dark days
[17:16:28] <Lone_Rifle> "we don't understand what classpaths are, so let's use file paths instead"
[17:17:08] <webczat> hmm, I just need to do loading from a fixed location, provided that the extension is in a jar file.
[17:17:20] <Lone_Rifle> webczat: see above
[17:17:30] <_W_> what do you mean by "extensions"? I don't know that piece of java terminology
[17:17:34] <_W_> webczat,
[17:17:35] *** nmx has joined ##java
[17:17:37] <webczat> do I need to write the class loader or use url one?
[17:17:46] <Tuplanolla> ~pie
[17:17:46] <javabot> Tuplanolla, what does that even *mean*?
[17:17:51] <_W_> webczat, stop asking questions and start answering them
[17:18:20] <_W_> to give proper advice, we have to understand what you mean
[17:18:33] <Lone_Rifle> _W_: that said, you're not bound by an SLA
[17:18:42] <webczat> _W_: extension is a package, usually bundled in a jar file, that can be installed into the appropriate jvm directory and then be used like just another standard class.
[17:19:02] <_W_> webczat, then you're very confused - jar files aren't used as classes at all
[17:19:13] <Lone_Rifle> http://download.oracle.com/javase/tutorial/ext/index.html ?
[17:19:15] <_W_> webczat, perhaps you mean jar files in general? And classpath?
[17:19:24] <webczat> _W_: but they contain classes and classes are loaded from inside them
[17:19:28] *** frangiz has quit IRC
[17:19:41] <_W_> oh, that thing, very stupid to use
[17:19:50] <_W_> just specify the jars you depend on on the classpath
[17:20:08] <_W_> ~classpath
[17:20:08] <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].
[17:20:11] <webczat> but what if it's variable and configurable?
[17:20:22] <_W_> then you need a plugin system
[17:20:36] <_W_> (assuming you can't restart to change)
[17:20:53] <_W_> the extension dir can do nothing that the classpath can't do
[17:21:04] <Lone_Rifle> or just always write your bare classes to that dir
[17:21:12] <webczat> _W_: yeah, but if i'd need to write one, like I don't want too many runtime dependencies, then do I need to write class loader or use the url loader?
[17:21:29] <_W_> ~~ webczat plugin
[17:21:29] <javabot> webczat, to build a plugin based system you should consider either JPF (~jpf) or, for more complex uses, see OSGi.
[17:21:39] <webczat> I need dynamically loadable modules or something similar.
[17:21:54] <_W_> you don't need to write a plugin system, several are already written
[17:21:55] <Lone_Rifle> I take "what is a plugin" for $200
[17:22:00] *** PrimeZ has joined ##java
[17:22:10] <_W_> ~~ webczat jpf
[17:22:10] <javabot> webczat, jpf is the java plugin framework. It aims to simplify plugin based systems and can be found at http://jpf.sourceforge.net/.
[17:22:12] <_W_> ~~ webczat osgi
[17:22:13] <javabot> webczat, osgi is a module system for java. It's seen in eclipse, glassfish, jboss, and a host of other environments. See also ~equinox, ~felix, and ~knopflerfish
[17:22:29] <Lone_Rifle> in my experience
[17:22:44] <Lone_Rifle> there are certain groups of people who take time to actually read what you are trying to tell them
[17:23:17] <Lone_Rifle> such that by the time they respond in the manner you expect them to ("oh, okay, thanks for the info") the world has moved on
[17:23:50] <Lone_Rifle> the thus extended time period between giving the answer and receiving it is then spent by the receiver repeating what he insists on saying
[17:24:44] <Lone_Rifle> ~notinventedhere
[17:24:45] <javabot> Lone_Rifle, what does that even *mean*?
[17:24:51] <webczat> My question was specifically directed to doing that sort of things without using an existing plugin system.
[17:25:00] <Lone_Rifle> why would you want to build your own?
[17:25:26] *** jonkri has joined ##java
[17:25:35] <Tuplanolla> ~fun
[17:25:36] <javabot> Tuplanolla, what does that even *mean*?
[17:25:42] <Tuplanolla> This bot lacks all the fundamental info.
[17:25:43] <RLa> some people really want to reinvent wheel
[17:25:48] *** frangiz has joined ##java
[17:25:52] <Lone_Rifle> shh.
[17:26:04] <Tuplanolla> At least I consider reinventing things fun and interesting.
[17:26:16] <Tuplanolla> And at least interesting if not fun.
[17:26:16] <RLa> webczat, when you use osgi, you still need implementation of it, which you can code yourself
[17:26:18] <Lone_Rifle> my shrink has advised me to avoid being reminded of things at work
[17:26:39] *** shaunren has joined ##java
[17:27:35] *** jjido has joined ##java
[17:27:47] <webczat> I need to do this because I don't want to use any extensions in an ext directory or a classpath, cause user has to install them or I need to bundle them with the installer and I need the program to be self-contained, the exception is swt needed for accessibility purposes.
[17:28:10] <Lone_Rifle> and you don't want to bundle them with the installer because...?
[17:28:12] <webczat> Unless writing that sort of things is difficult/time wasting enough so that I really need to consider using a framework.
[17:28:33] <Lone_Rifle> i mean, bloody hell
[17:28:43] <webczat> Lone_Rifle: hmm, actually because of my hard to understand rules. read: hard to understand even for me
[17:28:54] <Lone_Rifle> coding is possibly the hardest part of the job
[17:29:17] <Lone_Rifle> if somebody's done it, milk it. rules enforced by whom?
[17:29:25] *** matsebc has quit IRC
[17:30:13] <webczat> But actually, if I wanted to do that manually, will it be difficult? like will I need to unload one class at once or something like that, or write tons of code just for plugin loading?
[17:30:37] <Lone_Rifle> ... you could copy the classes from OSGi and include them in your own project
[17:30:52] <webczat> I could copy the jarfile.
[17:30:56] <Lone_Rifle> actually, on the "not invented here" topic, is there ever any fair justification for not migrating an app to new things when they come out? eg, refusing to move to Java 5's concurrency classes
[17:31:03] <Tuplanolla> You could hard-code the binaries of the files in your source code as a string.
[17:31:11] <Lone_Rifle> webczat: that contravenes your "no bundling in the installer" approach
[17:31:15] <Tuplanolla> Software developers love that.
[17:31:17] <webczat> But it all depends on how difficult is this. If it's okay for me to code something, and it isn't in the standard library, I usually like to reinvent it.
[17:31:31] <RLa> the simplest approach would be some static class in yous app where plugins register to when loaded into classpath
[17:31:41] *** Alundra has quit IRC
[17:32:39] <webczat> I can think about it, the only thing is I don't know load/unload mechanisms involved.
[17:32:59] *** aaron11 has quit IRC
[17:33:01] <Lone_Rifle> my job basically involves maintaining a 12-year old Java app which is struggling to reach the 21st century. My colleagues are in denial, and I need some sort of excuse for them
[17:33:25] *** riotz has joined ##java
[17:33:55] <webczat> Do you directly use the class loader, or manipulate the classpath?
[17:34:18] <Lone_Rifle> eg, no use of Executors, instead relying on manually spawned threads listening on blocking queues from oswego
[17:34:40] <RLa> webczat, manipulate classpath, dynamically add jars to it
[17:35:05] *** zemanel has quit IRC
[17:35:08] <RLa> webczat, you can easily do that with custom classloader
[17:35:30] <webczat> RLa: ahm, but how do you unload?
[17:35:30] *** Alundra has joined ##java
[17:35:43] *** ojacobson has joined ##java
[17:35:52] <webczat> if you remove the thing from the classpath, you still end with loaded plugin.
[17:36:59] *** bn` has joined ##java
[17:37:01] *** Carnage\ has joined ##java
[17:38:20] *** jjido has quit IRC
[17:39:50] *** merunner has quit IRC
[17:40:26] *** Alundra has quit IRC
[17:41:04] *** jjido has joined ##java
[17:41:50] <webczat> Is it possible?
[17:41:58] *** Lone_Rifle has quit IRC
[17:44:11] *** jonkri has quit IRC
[17:45:49] *** platzhirsch has joined ##java
[17:46:32] *** tilerendering has quit IRC
[17:47:01] <RLa> you might not be able to unload classes but you can deactivate your plugins
[17:47:23] <webczat> mhm
[17:48:37] *** FCTW has joined ##java
[17:49:08] <webczat> or I'm able to unload classes, maybe?
[17:50:23] *** frangiz has quit IRC
[17:50:56] *** frangiz has joined ##java
[17:51:51] <meeper> webczat: you should really use osgi instead of trying to invent your own plugin framework
[17:51:52] *** jjido has quit IRC
[17:52:38] <meeper> webczat: as for your question, classloaders and the classes they load, get garbage collected just like everything else
[17:52:52] *** bearded_oneder has joined ##java
[17:53:04] *** Tashtego has joined ##java
[17:53:25] *** FCTW has quit IRC
[17:54:20] <webczat> So if I write a simple class loader that loads jars, then when it will unload my jarfile then I can think that the class is unloaded after the gc?
[17:54:47] <webczat> meeper: and, is it so difficult to write the own class loader using the Jar class?
[17:55:28] <webczat> so that I really need osgi/jpf?
[17:56:49] *** shakamca has joined ##java
[17:57:01] <webczat> And also what if the plugin contents will be changed? and I'll unload it by closing the jar file, then it won't be garbage collected just yet and i'll reload/reuse it? it won't reflect the change, right?
[17:57:42] <meeper> webczat: not sure what jpf is, but osgi makes all these problems go away (and brings in new apps). it's easy to write your own framework that creates an urlclassloader and points it at a directory but you will soon run into problems like dependencies between plugins, and real plugin reloading is a pretty hard problem
[17:58:19] <meeper> webczat: ask google. there's a bunch of stuff out there on writing your own plugins in java. it's easy to get something working. very hard to produce something production worthy.
[17:58:41] *** jjido has joined ##java
[17:59:20] *** bitshuffler__ has joined ##java
[17:59:21] <webczat> meeper: plugin dependencies will be handled appropriately.
[18:00:31] <meeper> hehe, easier said than done. when you have different plugins using different versions of the same library you'll be on the path to the dark side
[18:00:53] *** wanderingi has joined ##java
[18:02:04] *** magentar has quit IRC
[18:03:22] *** PrimeZ has quit IRC
[18:03:24] *** jjido has quit IRC
[18:03:29] *** bitshuffler_ has quit IRC
[18:04:46] *** Snicksie has quit IRC
[18:05:49] *** stevenhong has quit IRC
[18:06:04] <webczat> meeper: mhm
[18:07:25] *** matsebc has joined ##java
[18:11:23] *** frangiz has quit IRC
[18:11:49] *** cool123 has joined ##java
[18:13:14] *** cbeust has joined ##java
[18:15:12] *** Carnage\ has quit IRC
[18:16:16] *** matsebc has quit IRC
[18:18:35] <gener1c> i searched all over the net for a good avl tree implementation i can use and i cant find one
[18:19:54] *** gemelen has joined ##java
[18:20:22] <RLa> gener1c, does it have to be avl tree?
[18:20:41] *** Kamaran has quit IRC
[18:21:52] <RLa> gener1c, there is TreeMap in jre which is red-black tree
[18:22:40] *** Auv5 has joined ##java
[18:22:41] *** jjido has joined ##java
[18:23:23] *** Lartza has joined ##java
[18:23:23] *** rigved has joined ##java
[18:23:34] <Lartza> Quick question, not really familiar with Java
[18:23:56] <Lartza> Netbeans insists that my byte 20 turns to int when I put in 200
[18:24:14] <Lartza> public static byte
[18:24:34] <_W_> no it doesn't
[18:24:40] <_W_> you're misunderstanding the message
[18:24:56] <Lartza> :/
[18:25:12] <Lartza> It tells me to change my byte to int or put (byte) 200
[18:25:14] <RLa> 200 does not fit into byte tho
[18:25:22] <_W_> 200 is an int literal
[18:25:23] <RLa> byte is signed
[18:25:51] <Lartza> So should I change it to int and hope it doesn't mess the rest of the soruce when they fetch that variable?
[18:26:08] <RLa> ~datatypes
[18:26:08] <javabot> RLa, what does that even *mean*?
[18:26:15] <_W_> Lartza, that depends on your program logic
[18:26:20] <Lartza> And if it doesn't fit then what does "(byte) 200" do?
[18:26:23] <_W_> ~primitives
[18:26:23] <javabot> primitives are 8 of the 9 non-Object types in Java (the special type "void" being the ninth): byte, short, int, long, float, double, boolean, and char. See http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html for more information.
[18:26:29] <_W_> Lartza, overflows
[18:26:37] <_W_> 200-256
[18:26:45] <Lartza> And Netbeans suggests that...
[18:26:56] <Lartza> Well I know it's not human just a machine :)
[18:27:07] <Tashtego> how can i change the glassfish default port?
[18:27:22] <_W_> Tashtego, the *default* port?
[18:27:27] <_W_> you'd have to talk to Oracle
[18:27:50] <_W_> if you want to change the settings for one of your connectors, there's probably an admin menu for that
[18:28:04] <Tashtego> _W_ i would like to do it via config file
[18:28:10] <Tashtego> like sun-resources.xml is that possible?
[18:28:28] <_W_> Tashtego, you object to using asadmin to manage config files for you?
[18:28:38] <_W_> (or the web admin interface)
[18:28:47] *** matsebc has joined ##java
[18:29:01] <Tashtego> i have no web interface. i am starting glassfish as embedded server via arquillian in my unit test
[18:29:06] <_W_> I quite frankly don't know what config files exist or where they are, because Glassfish is so user friendly
[18:29:13] <Lartza> Is there JDK Update 25 ?
[18:29:23] <_W_> Tashtego, ah, no idea then
[18:29:23] <Tashtego> so i cant just call a asadmin command while running
[18:29:33] <_W_> ~~ Lartza download
[18:29:33] <javabot> Lartza, Find current releases for Java at http://java.sun.com/javase/downloads/index.jsp and a comprehensive archive of current and older releases of various Java related products at http://java.sun.com/products/archive/
[18:29:57] <Lartza> Well... is JDK 7 how far from release?
[18:30:05] <_W_> Tashtego, well settings persist between restarts, dunno if that is what you want though
[18:30:15] <_W_> ~jdk7
[18:30:15] <javabot> _W_, java 7 is the upcoming version of Java. See https://jdk7.dev.java.net/ and http://tech.puredanger.com/java7/
[18:30:40] <Lartza> I doubt they haev estimates there, though nobody here propably knows either :/
[18:31:10] <_W_> if someone here knows, and it isn't on oracle's pages, they probably can't tell you
[18:32:05] <Tuplanolla> It's nice to find jar getting stuck reading the file it's writing.
[18:32:20] <Tuplanolla> I now have a ten GB jar.
[18:33:46] *** Lartza has quit IRC
[18:34:29] <bearded_oneder> really? is this a application/class, or just a file archive?
[18:34:39] <bearded_oneder> this an*
[18:35:40] <webczat> You all tell me about osgi. But what about java.util.ServiceLoader?
[18:36:10] <_W_> ~spi
[18:36:10] <javabot> _W_, spi is the Service Provider Interface. Lets you put "I have a class that implements this interface" into a jar file, and then you can use java.util.ServiceLoader to find (at runtime) all implementations of an interface that said this. See http://java.sun.com/developer/technicalArticles/javase/extensible/index.html for an into and http://spi.googlecode.com/ to make creating the service files much simpler.
[18:36:30] <_W_> webczat, you said you needed it dynamically configured - we presumed after you've started the JVM
[18:36:55] <_W_> SPI requires the implementation to be on the classpath when the JVM starts
[18:36:55] <Tuplanolla> How can I prevent jar from going recursive?
[18:37:07] *** matsebc has quit IRC
[18:37:10] *** caverdude has quit IRC
[18:37:12] <_W_> Tuplanolla, make the jar file outside the tree you are packing?
[18:37:17] <Tuplanolla> Pfft...
[18:37:29] <_W_> typical structure of a java project have src and dist directories
[18:37:47] <Tuplanolla> I haven't seen a good explanation on file structure anywhere.
[18:38:19] <Tuplanolla> I'd like to include custom-written libraries in the project as well.
[18:39:26] *** supercosmonaut has joined ##java
[18:39:36] <bearded_oneder> Tuplanolla: http://java.sun.com/blueprints/code/projectconventions.html
[18:41:04] <Tuplanolla> That's just one project, no?
[18:41:51] <RLa> looks bit overkill
[18:42:03] <dreamreal> Tuplanolla: what are you trying to do?
[18:42:22] <Tuplanolla> I'd like to build and jar all author.lib1, author.lib2.lib3 and author.project1 in a simple fashion.
[18:42:45] <Tuplanolla> Using jar on author/ doesn't work, obviously.
[18:43:33] <dreamreal> Tuplanolla: so build separate projects. maven would make this painfully easy.
[18:45:08] <dreamreal> mvn archetype:generate -DartifactId=author; cd author; mvn archetype:generate -DartifactId=lib1; mvn archetype:generate -DartifactId=lib2; cd lib2; mvn archetype:generate -DartifactId=lib3; cd ../..; mvn archetype:generate -DartifactId=project1
[18:45:24] <dreamreal> you'll need versions and group ids there, but that would replicate the structure faithfully and accurately.
[18:46:01] <Tuplanolla> Painfully easy would be if jar accepted recursive wildcards.
[18:46:27] <Tuplanolla> Like jar author/**.class.
[18:46:27] * dreamreal goes silent, not being interested any more.
[18:46:58] *** RLa has quit IRC
[18:48:08] *** sukumarasingha has joined ##java
[18:49:38] *** Tashtego has quit IRC
[18:52:00] <webczat> What about creating single url class loader for each module?
[18:54:21] <dreamreal> what about it?
[18:55:12] *** riotz has quit IRC
[18:56:42] <webczat> does it work for dynamically loaded modules?
[18:56:52] <dreamreal> why would it not?
[18:56:58] *** Kamaran has joined ##java
[18:58:31] *** Will123456 has joined ##java
[18:58:52] *** queequeg1 has joined ##java
[18:58:53] *** AMcBain has joined ##java
[18:59:24] <webczat> like is it easy for using it like that?
[18:59:51] <dreamreal> *sigh* It's *designed* for that.
[18:59:57] <_W_> webczat, it's easy to go wrong with class loaders, but then I guess plugin code doesn't necessarily hide that well
[19:01:51] *** jjido has quit IRC
[19:03:22] <webczat> ls
[19:03:22] <javabot> webczat: wrong window, pal
[19:03:26] <webczat> uff
[19:03:30] <webczat> not here
[19:03:39] *** Auv5 has quit IRC
[19:04:06] <webczat> dreamreal: actually, I don't see anything in the java api docs about this
[19:04:30] *** nous1024 has quit IRC
[19:04:42] <dreamreal> webczat: well. What do you think a URLClassloader might be good for?
[19:06:09] *** rigved has left ##java
[19:06:22] <webczat> dreamreal: it's for loading classes, but nothing writes about rules of unloading them
[19:06:56] <dreamreal> webczat: *sigh* since a classloader contains references to the class thyat it has loaded, discarding the classloader discards the references it holds
[19:10:44] <RobotCow> Is it possible to use SSH port forwarding to put a 3rd computer acting like a proxy between the two connections?
[19:11:02] <_W_> RobotCow, how is that java?
[19:11:11] <whaley> RobotCow: yes, but what does this have to do with java :)
[19:11:12] <_W_> try #linux or #openssh or #bash or something
[19:11:15] <RobotCow> goddamn
[19:11:22] <RobotCow> i thought this was #linux
[19:11:26] <RobotCow> lol barely awake
[19:11:33] <whaley> ~coffee RobotCow
[19:11:33] * javabot gives RobotCow a nice, code-producing marochino
[19:11:52] <RobotCow> I have java in my cup and jdk 7 pre-release java
[19:12:12] <RobotCow> yeah, love the strings in switch statements
[19:12:13] <RobotCow> for sure
[19:12:20] *** Bombstone has joined ##java
[19:14:57] *** sebrock has quit IRC
[19:16:27] <Guyman> where can i get javadoc.exe for eclispe to use to generate javadoc?
[19:17:46] *** Bombstone has quit IRC
[19:17:51] <Guyman> ~javadoc.exe
[19:17:52] <javabot> Guyman, what does that even *mean*?
[19:18:46] *** wyvern has joined ##java
[19:19:57] *** Bombstone has joined ##java
[19:20:21] <_W_> Guyman, comes with the JDK
[19:20:25] <_W_> ~tooldocs
[19:20:25] <javabot> _W_, tooldocs is http://download.oracle.com/javase/6/docs/technotes/tools/index.html
[19:20:28] <Guyman> well, its missing for me
[19:20:48] <_W_> then you deleted it after installing the JDK
[19:20:58] <Guyman> basic tools?
[19:22:07] <Guyman> what am i supposed to do with that..
[19:22:21] <webczat> dreamreal: but the loader has a reference to the class and the class has also a reference to the loader.
[19:23:00] <Guyman> _W_ where do i get it then?
[19:23:23] <_W_> Guyman, it comes with the JDK
[19:23:34] *** srji has quit IRC
[19:23:43] <_W_> if you've messed enough with your JDK that it's actually gone, reinstall it
[19:23:43] *** TR2N has quit IRC
[19:23:55] <_W_> (most likely, you're just looking in the wrong place, like, say, the JRE)
[19:24:16] <Guyman> http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html
[19:24:16] <Guyman> ?
[19:24:28] *** Matuku has quit IRC
[19:24:37] <_W_> ~download
[19:24:37] <javabot> Find current releases for Java at http://java.sun.com/javase/downloads/index.jsp and a comprehensive archive of current and older releases of various Java related products at http://java.sun.com/products/archive/
[19:24:58] <frimend> Anyone who can explain in plain english what all the kinds of things in java are? Servlets, Faces, etc ?
[19:25:09] <frimend> I need some sort of map to navigate in this jungle.
[19:25:47] <Guyman> _W_ JDK 6 Update 24 with Java EE
[19:25:49] <Guyman> ?
[19:25:56] <_W_> Guyman, think for yourself
[19:26:00] <eidolon> frimend: that's like asking for someone to explain a computer to you
[19:26:05] <Guyman> i really dont know
[19:26:06] <eidolon> frimend: start at http://java.sun.com/
[19:26:11] <eidolon> or wahtever it is now.
[19:26:19] <_W_> Guyman, I don't care
[19:26:24] <Guyman> ok
[19:26:29] <frimend> a computer has ram, hdd, processor, etc.
[19:26:40] <frimend> it's easy to break down the parts and explain them in simple words.
[19:27:00] <eidolon> java has classes.
[19:27:00] <frimend> and one could paint a picture of a computer and show how all the different parts interact.
[19:27:02] <eidolon> next?
[19:27:10] <frimend> what is servlets?
[19:27:18] <eidolon> ~servlets
[19:27:18] <javabot> servlets are a mechanism for programmatically building HTTP handlers in Java. See http://java.sun.com/products/servlet/ for more info, including API specs and other documentation.
[19:27:26] <eidolon> oh look, a link to java.sun.com
[19:27:38] <frimend> eidolon: that doesn't help me.
[19:27:47] <frimend> Since I do not have a overview of any of the parts.
[19:27:53] <_W_> frimend, we can't tutor you over IRC
[19:27:55] <frimend> I don't know what all the parts are.
[19:28:03] <_W_> frimend, learn one part at a time
[19:28:13] <_W_> start at hello world and go from there
[19:28:16] <frimend> I have a hard time beliving I am the only one who has been looking for some overview of this mess.
[19:28:32] <_W_> frimend, try wikipedia
[19:28:40] <_W_> or wikibooks
[19:28:58] <frimend> Wikipedia is nice, and the "related" has helped me.
[19:29:42] <frimend> I guess what I am looking for is some sort of flowchart, a UML, call diagram or such, where I can get a visual overview of the different parts.
[19:29:45] <webczat> Can I somehow know how many references does the object have?
[19:29:45] <eidolon> first, your'e starting with a basic assumption that's going to color you negatively the whole time. "java is a MESS! i'll never understand this unless someone EXPLAINS it to me!"
[19:29:49] <eidolon> that attitude won't get you anythwhere.
[19:30:01] <eidolon> since one part does not flow into another, that won't work either.
[19:30:19] <eidolon> java is an entire ecosystem. pick something, learn about it. i suggest the basic tutorials like firstcup
[19:30:23] <eidolon> then figure out what you want to do.
[19:30:43] <frimend> java core and html doesn't have any interaction.
[19:31:01] <eidolon> perhaps a better analogy is you walking into a hardware store and saying "all this stuff, what does it do? how does it work? how does it relate to everything else in the store?"
[19:31:03] <frimend> there is some of these tools that are inbetwen.
[19:31:06] <eidolon> the answer is - they don't, except they're tools
[19:31:17] <eidolon> what?
[19:31:24] <eidolon> that statement made absolutely no sense.
[19:31:35] <eidolon> do you know any programming languages at all?
[19:31:39] <frimend> yes, alot.
[19:31:44] <eidolon> name 2.
[19:31:48] <frimend> java!
[19:31:54] <eidolon> ...
[19:32:03] <meeper> eidolon: you set yourself up for that
[19:32:09] <eidolon> i suppose.
[19:32:11] <frimend> I can write standalone java programs pretty well.
[19:32:32] <frimend> I can't post them up on the internet though.
[19:32:32] <meeper> frimend: don't try to get an overview. the java world is too big. google '<what you wanna do> framework tutorial' and go from there
[19:32:40] <eidolon> yeah, pick a direction.
[19:32:46] <eidolon> you want to know how to write web apps in java?
[19:33:13] <frimend> I wish to have a ovewview of all the tools.
[19:33:17] *** cschneid has joined ##java
[19:33:22] <eidolon> there is no such thing
[19:33:23] <meeper> frimend: impossible
[19:33:23] <frimend> I am assigned to work on a java web application project.
[19:33:28] <eidolon> AHA
[19:33:31] <eidolon> now we're talking
[19:33:34] <wyvern> now it all makes sense
[19:33:35] <frimend> There are a myriad of tools involved.
[19:33:42] <eidolon> dos the java web application have anything already established?
[19:33:49] <eidolon> yes, there are. you've just narrowed the field considerably though
[19:33:49] <frimend> yes, it runs.
[19:33:53] <eidolon> EXCELLENT
[19:33:55] <eidolon> does it use a framework?
[19:33:56] *** yoshx has joined ##java
[19:34:02] <eidolon> i swear this is like pulling teeth
[19:34:04] *** Will123456 has quit IRC
[19:34:11] <frimend> I do not know what that is.
[19:34:18] <eidolon> does it use tomcat? jboss? weblogic?
[19:34:24] <frimend> tomcat, yes!
[19:34:27] <eidolon> VERY GOOD!
[19:34:30] * eidolon gives you a cookie.
[19:34:30] <wyvern> hehe
[19:34:43] <eidolon> you have an application that is running inside a servlet container called Tomat
[19:34:45] <eidolon> TOmcat.
[19:34:49] <eidolon> now, go read about Tomcat and Servlets.
[19:34:50] <frimend> there is some java core, there is css, there is java server faces
[19:34:54] <eidolon> JSF!
[19:34:54] <frimend> and java primefaces
[19:34:56] <eidolon> you have another tool!
[19:35:01] <eidolon> ~tell frimend about jsf
[19:35:01] <javabot> frimend, JavaServer Faces technology simplifies building user interfaces for JavaServer applications. Developers of various skill levels can quickly build web applications by: assembling reusable UI components in a page; connecting these components to an application data source; and wiring client-generated events to server-side event handlers. More can be found at http://java.sun.com/j2ee/javaserverfaces
[19:35:05] *** ivenkys has joined ##java
[19:35:14] <eidolon> now you have all the pieces that make your applciation work. go forth and be productive.
[19:35:24] *** Kamaran has quit IRC
[19:35:26] <meeper> frimend: then google jsf and read about it. nobody here is going to explain everything to you. not for less than $250/hr
[19:35:36] <eidolon> meeper: i'll do it for $200.
[19:35:40] <frimend> I struggled today with rescaling a icon.
[19:35:52] <frimend> I did not manage to do it.
[19:36:05] <eidolon> frimend: if you have a very basic question about one of your components, ask.
[19:36:21] <ker> could you please help me out with this?
[19:36:22] <ker> http://pastebin.com/tqBfTRQH
[19:36:23] <frimend> I don't know which component that is responsible for icons.
[19:36:30] <ker> I'm getting this error :
[19:36:32] <ker> non-static method openConnection(java.lang.String,int) cannot be referenced from a static context
[19:36:33] <ker> simpleSerial.openConnection(comboSerialPorts.getSelectedItem().toString(), Integer.parseInt(comboBaudRate.getSelectedItem().toString()));
[19:36:35] <frimend> hence I don't know where to begin to ask.
[19:36:48] <frimend> I need a rough overview of this swamp of tools.
[19:36:57] <wyvern> ker, you can't call an instance method in a static way
[19:37:02] <frimend> I need some sort of map, so that I can narrow down my searches.
[19:37:11] <eidolon> ker: d you understand static vs instance objects?
[19:37:27] <ker> mmh no :P it's the first day I code in Java
[19:37:34] <eidolon> there's no map here. you've just gotten all the information you need to narrow down your question. you're using a servlet-based application inside a Tomcat container, that uses JSF.
[19:37:34] <wyvern> ker, what other languages do you know
[19:37:40] <eidolon> you need to unerstand those pieces somewhat.
[19:37:48] <ker> wyvern, I only used C for now
[19:37:50] <eidolon> how your applciation is built and maintained is up to the people who wrote the app.
[19:37:57] <wyvern> ker, ah, ok.
[19:38:00] <wyvern> ~~ ker firstcup
[19:38:00] <javabot> ker, firstcup is a beginner's tutorial for getting started with Java available at http://java.sun.com/tutorial/getStarted/cupojava
[19:38:06] <ker> ook
[19:38:08] <ker> thanks :)
[19:38:14] <eidolon> i suggest, btw, going through some of the servlet tutorials to get an idea how servlets work and are deployed into a tomcat server.
[19:40:06] *** terranova has quit IRC
[19:41:01] *** shaunren has quit IRC
[19:41:41] <frimend> servlets are more basic than faces then?
[19:42:48] <eidolon> two different things. servlets are a base level components - a type of object that is deployed into a servlet container. faces use servlets to provide a framework for building applications / pages.
[19:43:05] *** frangiz has joined ##java
[19:43:25] *** uestra has joined ##java
[19:43:38] <frimend> splendid, allready things are clearing up.
[19:44:04] <eidolon> amqzing what happens when you ask a specific question :)
[19:44:06] <frimend> the tomcat thing I think I can rationalize away, it's installed allready and I know how to restart it to get the application running.
[19:44:20] <frimend> So I don't think I should focus anything on that part.
[19:44:36] *** docwhat has joined ##java
[19:44:37] <frimend> staring down the servlets part seems like a splendid aproach.
[19:44:51] <frimend> there is beans also.
[19:45:01] <eidolon> ~bean
[19:45:01] <javabot> eidolon, beans spec is http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html (but you might mean "enterprise java beans", see ~ejb)
[19:45:05] *** wilrod has joined ##java
[19:45:13] <eidolon> that may be sort of heavy reading.
[19:45:23] <eidolon> what do you want to know about beans?
[19:45:25] <frimend> I have a basic understanding of the beans.
[19:45:39] <eidolon> a bean is just an object.
[19:45:43] <frimend> I am more specifically interested in how they interact with servlets.
[19:45:50] <frimend> and with faces.
[19:45:53] *** platzhirsch has left ##java
[19:46:37] <eidolon> i rarely work with javabeans directly. YMMV.
[19:47:21] *** Tashtego has joined ##java
[19:47:37] <frimend> ah, they most probably don't distract that much then, since you seem to get along quite well without them.
[19:48:00] <eidolon> yeah, but #java folks think i'm an awful java programmer. so don't take my knowledgebase as gospel.
[19:48:19] <frimend> the css and html parts are likely to confuse me, they have done so these last days.
[19:48:44] <frimend> css and html is only about the layout of the page, as far as I have understod.
[19:48:50] <eidolon> correct.
[19:48:56] <frimend> faces are the interaction?
[19:49:01] <eidolon> use css, html, and by extension, jsp and jsf for layout.
[19:49:02] <frimend> or is servlets also the interaction?
[19:49:06] <eidolon> er, for presentation.
[19:49:12] <eidolon> you familiar with MVC?
[19:49:16] <wilrod> whats the difference between a business entity as a pojo and a java bean anyway?
[19:49:20] <frimend> model view controller
[19:49:30] <eidolon> ~tell frimend about mvc
[19:49:30] <javabot> frimend, 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
[19:49:44] <eidolon> the idea is that presentation is seperate from data and business logic.
[19:49:53] <eidolon> html/css/jsf/jsp/etc are all presentation
[19:50:22] <frimend> aah, none of them are in the controller part?
[19:50:30] <meeper> eidolon: you rarely work with javabeans directly?
[19:50:47] <wilrod> eidolon, wrong? It´s about breaking out ui logic into a middle layer between the ui and the model.
[19:50:53] <meeper> frimend: you'd learn a lot faster from simply reading
[19:50:54] <frimend> most likely, he interacts with them like I do. SOmeone else set them up and they work. :P
[19:51:06] *** rtdos has quit IRC
[19:51:06] <frimend> meeper: wrong, I have tried to read for days.
[19:51:10] <docwhat> Hi! I'm trying to use JAX-RS to return JSON to a HEAD request, unless nothing has changed. I've but my code on https://gist.github.com/856596 -- Can someone help me? I'm not a very good Java programmer (yet).
[19:51:23] <frimend> if I was a good reader, and read the right things, your statement would be correct.
[19:51:26] <docwhat> s/but/put/
[19:51:30] <meeper> frimend: you have some sort of disability that prevents you from understanding the jsf tutorial?
[19:51:31] <eidolon> meeper: perhaps i'm doing temrinology wrong - most of my java code is struts2 based nowadays. i dn't move beans around (unless you call my DAOs and business objects beans. i was always hazy on the definition)
[19:51:31] *** RobotCow has quit IRC
[19:51:44] <frimend> meeper: clearly I have.
[19:52:01] <eidolon> yeah, i'd -really- recommend doing a servlet tutorial, then doing a jsf tutorial.
[19:52:02] <frimend> I have not yet pinpointed what is wrong with my mind yet, but I am working with it.
[19:52:25] <frimend> I am very pleased to hear thsi!
[19:52:52] <frimend> I have found a servlet tutorial that seems promising, I glanced at it abit today, and I will follow it on monday.
[19:52:54] <docwhat> I just get lots of errors about "SEVERE: Missing dependency for method public javax.ws.rs.core.Response" at run-time.
[19:52:58] <meeper> docwhat: that's not the way http works, you're abusing the protocol, but there's nothing wrong with that code that I can see
[19:53:16] *** rtdos has joined ##java
[19:53:25] <meeper> docwhat: obviously you have a classpath problem. you need a jar that has the ws.rs api on your classpath.
[19:53:31] <frimend> eidolon: Your help has been very valuable, I am now much more confident and can relax the rest of this weekend and go to work rejuvinated.
[19:53:58] <docwhat> meeper: I have this at the top: import javax.ws.rs.*;
[19:54:01] <meeper> eidolon: is struts2 any good? it's just webwork right?
[19:54:10] *** RobotCow has joined ##java
[19:54:17] <meeper> docwhat: that's nice. importing the package isn't enough. you need the jar on your classpath.
[19:54:41] <meeper> docwhat: that way when the jvm runs your program it can get access to the actual .class files
[19:54:58] <docwhat> Oh...I'm using Maven....and have it marked as a compile dependency....
[19:54:58] <eidolon> 'is struts2 good' is one of those questions that'll throw geeks into a fistfight frenzy. it works for me. it has some weaknesses, it has some streengths. i have a LOT of code built on it atm. :)
[19:55:18] *** sukumarasingha has quit IRC
[19:55:36] *** RobotCow has quit IRC
[19:55:59] <meeper> interesting. struts2 works inside osgi.
[19:56:04] *** RobotCow has joined ##java
[19:56:04] *** riotz has joined ##java
[19:56:24] <meeper> eidolon: well I remember there were roughly about 1000 things that used to piss me off about webwork. but that was years ago. maybe they've fixed them all
[19:56:35] <eidolon> hey, random question. friend of mine is eclipse-allergic. he's doing a lot of dev in vim, but would like auto-completion and basic javadoc lookup. any pointers for vim extensions that do that? dont' want to go the whole eclim route.
[19:56:48] *** kieran491 has joined ##java
[19:56:59] *** devkhadka has quit IRC
[19:57:01] <meeper> eidolon: tell your friend to grow up and stop wasting his time and learn eclipse
[19:57:13] <eidolon> HAH
[19:57:35] <Tuplanolla> I'd call moving away from vim growing down.
[19:57:58] <meeper> you still have to extend ActionSupport classes in struts2 for your actions? that's ridiculous
[19:58:12] *** topaz has joined ##java
[19:58:15] <eidolon> yep.
[19:58:18] <topaz> meeper: yer mom.
[19:58:22] <eidolon> HAH
[19:58:30] <eidolon> meeper: topaz is the vim / eclipse fellow :)
[19:59:12] <meeper> well that's pretty silly. seems like spring mvc is still better than struts2 but spring mvc is a bit bloated
[19:59:55] <eidolon> i use spring DI for my c3po pools… and i'm juuuuust now spinning up some JPA / hibernate stuff via spring. i could see eventually going full spring mvc, or jettisoning the entire thing and going grails.
[20:00:00] <meeper> topaz: sorry the truth upsets you. I don't take java programmers who don't use ides seriously. especially this late in the game.
[20:00:34] <eidolon> sometimes i wish i had basic completion in vim, i'll freely admit
[20:00:46] <eidolon> but once i got into eclipse full time, control-space just is full of love.
[20:00:49] <topaz> I used eclipse for a few months, wasn't able to get used to the workflow. Maybe someday I'll get to grok it and like it better but I don't now.
[20:01:12] <eidolon> topaz: part of it might have een the project you were working on, that already had a ton of baggage.
[20:01:13] <topaz> thought it would be worth asking to find out what kind of tools existed for old-sk00l editors.
[20:01:19] <topaz> eidolon: totally possible.
[20:01:21] <meeper> eidolon: well there's no excuse for forcing people to subclass some framework class. A simple @Action annotation should be all that's required. And the fact that you can't have multiple execute methods in one class, ugh
[20:01:35] <eidolon> you. huh?
[20:01:37] <eidolon> of course you can.
[20:01:53] <eidolon> the struts class just defines which execute method is run for the call.
[20:01:59] <eidolon> if none is specified, it uses execute()
[20:02:13] <topaz> anyway. thanks for the help guys.
[20:02:15] *** topaz has left ##java
[20:02:17] <meeper> eidolon: you can have different methods, execute1 and execute2 and struts will figure out the right one?
[20:02:32] <eidolon> if you specify the methodname, sure.
[20:02:49] <meeper> that was always one of the things that bothered me about webwork. every execute required a whole new Action class.
[20:02:56] <eidolon> ung, no
[20:02:56] <meeper> eidolon: ah well that's cool
[20:03:10] <eidolon> i have (poorly) one WebActions.java class that has all the methods for my public interface.
[20:03:14] <eidolon> which is a poor design, in the other way
[20:03:16] <eidolon> but it works :)
[20:03:30] <eidolon> you do this:
[20:03:31] <eidolon> <action name="public/webLoginForm" method="login" class="com.stonekeep.congo.web.WebActions">
[20:03:44] <eidolon> that poinks the 'login' method as execute()
[20:04:04] *** wanderingi has quit IRC
[20:04:20] <wilrod> eidolon, in xml config file?
[20:04:26] <eidolon> mmhmm.
[20:04:32] <meeper> I wouldn't have one class, that's too little granularity, but yeah, that is good
[20:04:45] <wilrod> xml hell then
[20:04:47] <eidolon> yeah, the public interface is the only part doing that. i sort of regret it now :)
[20:04:59] <meeper> eidolon: why can't you just do: @StrutsPath("public/webLoginForm") public void login() ... ?
[20:05:19] <wilrod> no way of having it typed in code, to support better refactoring etc?
[20:05:42] <eidolon> dunno, i haven't looked at struts2 annotations yet - annotations give me the willies - i don't understand how to debug them.
[20:05:47] *** cool123 has quit IRC
[20:06:05] <eidolon> wilrod: what?
[20:06:07] *** elzoog has joined ##java
[20:06:34] <eidolon> meeper: looking at the s2 docs, it looks possible.
[20:06:38] <wilrod> let´s say you change the classname or the path to it. Then class="" would be broken
[20:06:39] <eidolon> @Action("register-input")
[20:06:50] <meeper> eidolon: struts still makes you write code like: (HttpServletRequest) ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST) ?
[20:07:03] * meeper may be looking at an old tutorial then
[20:07:14] <eidolon> if you want access to the request context, you need to do that, yes - but that's a very rare condition.
[20:07:16] <wilrod> eidolon, if all was written in java refactoring like that would follow
[20:07:24] <elzoog> Hey guys. If myLong is of type long, is there any difference between myLong >>>= 1 and ,yLong >>= 1 ??
[20:07:46] <meeper> eidolon: that's pretty bad. have the struts guys not heard of dependency injection?
[20:08:15] * meeper wishes somebody would build a decent web ui framework on top of jaxrs
[20:08:29] <eidolon> meeper: seriously man, i'm not an S2 expert. i'm just barely functional in it. i can't defend it, sorry.
[20:08:44] <eidolon> it works well for me, and i use Di constantly in my struts2 app (using spring)
[20:08:51] <AMcBain> elzoog, well, yes. just because myLong is of type long doesn't mean >>> and >> stop working differently.
[20:09:06] <wyvern> >>> doesn't perform sign extension iirc
[20:09:10] <AMcBain> correct
[20:09:16] <eidolon> however, if you grok spring JPA, i may need your help :)
[20:09:37] <meeper> eidolon: yeah, I'll take a closer look later. I'm trying to select a web framework for what will be a pretty big app and so far spring mvc seems the best but it's also a bit bloaty so I wonder
[20:09:53] *** wilrod has left ##java
[20:09:54] <eidolon> *nod* i'm drawn to grails lately.
[20:09:58] <elzoog> sign extension?
[20:10:08] <wyvern> eh, i read a book on groovy and was unimpressed
[20:10:40] <wyvern> elzoog, (1 << 63) >>> 1 should not not have the high bit set
[20:10:46] *** srm has quit IRC
[20:10:46] <wyvern> but if you did >> 1 then the top 2 bits would be set
[20:10:49] <meeper> wyvern: groovy is nice. it's groovy programmers that are annoying, I think
[20:10:54] <eidolon> groovy is okay. the whole *rails concept is sort of neat in that it short-circuits a lot of really nut-dragging coding.
[20:11:11] <eidolon> meeper: just put them in a room with nosql wanks, and watch the blood run.
[20:11:20] <wyvern> seemed to me (as an experienced php and ruby programmer) that it was repeating a lot of the mistakes of those languages
[20:11:32] <eidolon> but it's COOL!!!!
[20:11:37] <wyvern> mmm....
[20:12:00] *** srji has joined ##java
[20:12:13] <meeper> wyvern: it probably is. groovy was heavily influenced by ruby and a lot of groovy progs insist on doing the same stupid stuff a lot of ruby programmers do
[20:12:29] <wyvern> indeed. Just like ruby was poisoned for a long time by the pro-monkey-patching people
[20:12:41] <wyvern> (maybe it still is? I stopped paying attention to the ruby world when the koolaid started to splatter)
[20:12:58] * eidolon completely avoided the ruby wank-fest.
[20:13:10] <meeper> yeah. the result is often fragile, unintuitive, wanky code
[20:13:21] <wyvern> ruby is my current go-to language for hacking together a little script to do a simple thing
[20:13:27] <eidolon> it particularly irritated me because we had JUST come up witha l anguage that was a worthwhile repacement for Perl (python), and someone said "nonon! it should be like THIS!" and forked all the energy.
[20:13:50] <meeper> wyvern: it is possible to use groovy as just a lightweight java with some syntactic sugar and convienence methods. its when you get into code that relies too much on magic that it becomes a problem
[20:13:59] <wyvern> meeper, yep, i can see that
[20:14:06] <wyvern> but my non-java jvm language is scala :)
[20:14:23] <meeper> heh
[20:14:26] <selckin> and now for something completely unrelated, what font do you guys prefer?
[20:14:32] *** Bombstone has quit IRC
[20:14:37] <eidolon> anything sans-serif.
[20:14:57] <eidolon> wait. in what context? :)
[20:14:57] <meeper> selckin: consolas, liberation mono, and anonymous are nice
[20:15:01] * AMcBain finds this strange product and wonders why anyone would want crayon colonge.
[20:15:07] <selckin> coding editor
[20:15:10] <meeper> AMcBain: chicks dig it
[20:15:10] <eidolon> ah.
[20:15:19] <AMcBain> meeper, crayons?
[20:15:29] <meeper> AMcBain: and it's a great excuse to ask a woman to smell your neck
[20:15:51] <AMcBain> meeper, I'm not questioning colonge. Just *crayon* scented colonge.
[20:16:11] <eidolon> here's what my fonts / ecitor look like: https://skitch.com/dbelfershevett/rugam/java-congo-v2-trunk-src-main-java-com-stonekeep-congo-dao-frienddao.java-eclipse-users-dbs-documents-workspace
[20:16:16] <eidolon> yikes, URL hell.
[20:16:28] <wyvern> selckin, terminus is nice
[20:16:40] <wyvern> but it's an old font and not often supported by non-xterm-like-things
[20:16:50] <wyvern> so generally i use deja sans mono :/
[20:16:54] * AMcBain had a URL shortener bot(s) on freenode, but eventually they died off and he didn't restart them.
[20:17:05] <selckin> yeah my intellij doesn't list it :(
[20:17:44] *** IamTrying has joined ##java
[20:18:18] <eidolon> AMcBain: that's mostly skitch doing weird stuff with figuring out how to name an upload automaticaly by taking the window title.
[20:18:44] <LtHummus> computers computers everywhere and not a windows one to use
[20:18:51] <IamTrying> Is there any best java collection to do such Natural Text to Speech? ex: http://translate.google.com/#en|zh-CN|How%20are%20you
[20:19:41] <selckin> anonymous looks kinda fun
[20:20:31] <eidolon> okay, i'm gonna put some clothes on and actually go out and be social
[20:20:32] <eidolon> bbl
[20:20:40] * AMcBain .oO( tmi )
[20:20:47] <LtHummus> be social? you're a developer!
[20:20:57] <AMcBain> LtHummus, yeah, but going outside is probably a good thing.
[20:21:13] <AMcBain> I just got some Zubbles today, so I'll be out side for at least a little bit :)
[20:21:15] *** monty_hall has joined ##java
[20:21:28] <LtHummus> heh yes it is ... and i'm probably heading out for a bit too
[20:21:43] <elzoog> If I know that myLong is positive, then is myLong >>>= 1 any faster than myLong >>= 1 ??
[20:21:46] *** Carnage\ has joined ##java
[20:21:51] <AMcBain> LtHummus, Too bad there's not more colors yet :( I'd happily buy some green ones.
[20:22:10] <AMcBain> They've probably got them, but they're not read for release yet (ala their FAQ)
[20:22:55] <LtHummus> haha those look awesome
[20:23:18] <AMcBain> I like science :)
[20:23:35] <AMcBain> elzoog, in the end, I don't think it matters if one is marginally faster than the other (I suspect they're both about the same), you use which one you need in your program.
[20:24:36] *** durre has joined ##java
[20:24:55] <elzoog> Can you give an example where myLong >>>= 1 will give a different answer than myLong >>= 1 where myLong is positive?
[20:25:27] <AMcBain> elzoog, given how they work, do you think there is such an example?
[20:25:31] *** matsebc has joined ##java
[20:25:52] *** realtime has joined ##java
[20:26:08] *** Tashtego has quit IRC
[20:26:19] <elzoog> AMcBain: I can't think of an example. Therefore, chosing one over the other would be a question of speed wouldn't it?
[20:26:20] <Tuplanolla> Try myLong >>>= -8;, elzoog.
[20:26:44] <Tuplanolla> Ehh, sorry.
[20:26:52] *** IamTrying has left ##java
[20:27:00] <Tuplanolla> Should've been myLong = -8; myLong >>>= 1;.
[20:27:05] <monty_hall> I have "transient final public Vec2f _tmp = new Vec2f();" Would like to not serialize _tmp, but I also wanted it to be non null when unserialized. How can I resolve this?
[20:27:17] <Tuplanolla> That should explain it.
[20:27:32] <elzoog> Is there a good web site explaining EXACTLY what these shift operators do?
[20:27:43] <AMcBain> elzoog, speed has nothing to do with your question anyway. You write the program first, avoiding large bottlenecks (such as a slow or wrong algorithm), then after you've got it done and working, go back and try to fix or remove existing bottle necks that profiling finds.
[20:27:55] <AMcBain> ~~elzoog nutsandbolts
[20:27:55] <javabot> elzoog, what does that even *mean*?
[20:28:01] <wyvern> http://mindprod.com/jgloss/shift.html
[20:28:15] <webczat> I still do not have a way to unload classes.
[20:28:18] <AMcBain> ~nuts and bolts
[20:28:18] <javabot> AMcBain, what does that even *mean*?
[20:28:24] <AMcBain> blah. there used to be an entry.
[20:28:38] <elzoog> Does javabot ever say anything helpful?
[20:28:48] <AMcBain> Yes.
[20:29:08] *** goon12 has joined ##java
[20:30:04] <AMcBain> ~wrong
[20:30:04] <javabot> No, you're doing it wrong! See http://www.doingitwrong.com/wrong/wrong6.jpg
[20:30:12] <AMcBain> See, answers for almost everything.
[20:30:19] <wyvern> ~ding
[20:30:20] <javabot> wyvern, what does that even *mean*?
[20:30:22] <wyvern> hmm
[20:30:26] <AMcBain> ~ping
[20:30:26] <javabot> Pong
[20:30:31] <wyvern> what's the nataliedee one
[20:30:36] <AMcBain> ~info ping
[20:30:36] <javabot> ping was added by: RProgrammer on 06-24-2007 at 3:19 AM, EDT and has a literal value of: <reply>(Pong|Uh.. wha?|You rang, m'lord?|The machine that goes 'pong' has arrived.|Watch where you're sticking that thing!|http://www.nataliedee.com/071405/ping.jpg|pong. Pong. PONG Already! What do you people want?! What will it take to finally get some peace and quiet around here!?!)
[20:31:59] <AMcBain> heh, my soda one from way back got cleaned out.
[20:32:15] <wyvern> hm, maybe it was
[20:32:17] <wyvern> ~stfu
[20:32:17] <javabot> wyvern, stfu is http://bit.ly/igDmpT
[20:32:22] <Tuplanolla> javabot still lacks an entry for pastry...
[20:32:22] <javabot> Tuplanolla, what does that even *mean*?
[20:32:25] <wyvern> hm nope not that one
[20:32:42] *** cschneid has quit IRC
[20:32:47] <AMcBain> wyvern, the natalie dee link is embedded in ping.
[20:32:52] <AMcBain> It's second to last.
[20:32:56] *** sphenxes has joined ##java
[20:32:57] <wyvern> ah right you are
[20:33:53] *** yoshx has quit IRC
[20:33:54] <docwhat> meeper: Ah, I figured it out. I'm still new to Java and thought Number was a usable class. I had changed a bunch to Long, but I missed some. And apparently it couldn't figure out how to deal with it.
[20:34:21] *** supercosmonaut has quit IRC
[20:34:44] *** yoshx has joined ##java
[20:35:47] *** durre has quit IRC
[20:36:28] *** hanstech has joined ##java
[20:37:24] <elzoog> ~poop
[20:37:24] <javabot> It rhymes with Hadoop!!!!
[20:37:53] <elzoog> ~javabot
[20:37:53] <javabot> for a FAQ and a quick tutorial on how to use javabot, see: http://javachannel.net/wiki/pmwiki.php/FAQ/Javabot
[20:38:28] <elzoog> ~Dawkins
[20:38:28] <javabot> elzoog, what does that even *mean*?
[20:39:23] *** jpiche has joined ##java
[20:40:06] *** RLa has joined ##java
[20:42:04] <tjsnell> play with the bot using privmsg pls
[20:42:07] <tjsnell> please
[20:43:39] <monty_hall> so if I have a final transient field that holds an object, I'm to create a readObject method. Then I have to use reflection to override the "final" and then assign? Seems convoluted.
[20:43:54] <monty_hall> but it did work.
[20:44:25] <RLa> you can ban reflection using security manager
[20:44:55] <tjsnell> monty_hall: it should be convoluted
[20:44:58] <_W_> asigning to final fields isn't reliable either
[20:45:04] <_W_> at least not in the face of concurrent access
[20:45:18] <tjsnell> you mark something as final then want to change it something is wrong
[20:45:40] <monty_hall> it's a temp work variable
[20:45:46] <monty_hall> that I don't want to serialize
[20:45:55] <tjsnell> transient should do
[20:45:59] <_W_> then you don't need to set it
[20:46:07] <monty_hall> but the object reserialized the var as null.
[20:46:12] <_W_> t
[20:46:17] <tjsnell> heh
[20:46:19] <_W_> and that should be fine if it is a temp work variable
[20:46:57] *** bojo has quit IRC
[20:47:17] <monty_hall> so either I have to explicity create the value after deserialization or create lazily?
[20:47:28] <_W_> perhaps you are simply confused about what is temporary or not, transient or not, unchanging or not, and should just describe what the class and the field does to us so we can judge and advice on our own
[20:47:29] *** caverdude has joined ##java
[20:48:50] <_W_> (or perhaps you just shouldn't use the JVM serialization, but some more controlable format)
[20:51:23] *** bojo has joined ##java
[20:51:38] *** jpiche has left ##java
[20:52:25] *** pipeep has joined ##java
[20:53:16] <monty_hall> Polygon.computeAABB(...AABB retValue) -> an intermediate matrix multiplication and temperorary vector is required. So I just have a final Vec2f _tmp in the class.
[20:53:30] <monty_hall> Not that I'm serializing, I don't want _tmp to be serialized.
[20:54:13] <webczat> There is the problem. the class may be unloaded for optimization purposes if and only if the class loader for it may be reclaimed. And it isn't the case if the class object holds a reference to the class loader, and in fact it does. Can I do something with this?
[20:54:53] <_W_> webczat, that's not a problem
[20:55:10] *** bitshuffler has joined ##java
[20:55:18] <webczat> no?
[20:55:22] <_W_> the garbage collector knows how to collect graphs with cycles
[20:55:32] <_W_> as long as the whole graph is unreachable, all is fine
[20:56:14] <_W_> (in the case of class loaders, that means that no reference to the class is reachable, or to instances of the class, from any thread)
[20:56:15] <monty_hall> s/Not/Now
[20:56:34] <monty_hall> but I do want _tmp available after deserializing.
[20:56:37] <RLa> _W_, how does that work for stuff in permgen in sun jdk ?
[20:57:00] *** antigravity has joined ##java
[20:57:01] <webczat> _W_: yeah, but the object can be reclaimed only if it's refcount is 0. if class has been loaded and then I set the loader to null (I created the loader that loaded my class using the new operator), the reference to the class loader remains in the class. class's refcount isprobably 0 but not sure, and my tests didn't unload the class.
[20:57:07] <RLa> i have understood that permgen is not touched by gc
[20:57:14] <_W_> RLa, same way it works for other stuff. I don't think garbage collection is forced on otherwise empty memory, but otherwise the same
[20:57:26] <_W_> RLa, that is wrong
[20:57:42] <_W_> class definitions (which reside in permgen) can be unloaded
[20:58:23] <_W_> it might not be any of the regular garbage collection strategies that do it, but it does happen
[20:58:45] *** bitshuffler__ has quit IRC
[20:58:59] <webczat> also, the problem is that I heart that osgi uses the capability to reclaim loaders and then unload the class this way, but java spec makes this optimization thing, not for being used for that, so what if there's a vm that does not unload?
[20:59:06] <_W_> (having also written my own plugin system, I know this)
[20:59:06] *** Johannes13_ has joined ##java
[20:59:26] <_W_> webczat, then you give it enough memory
[20:59:49] <_W_> that's a matter between the VM (its configuration) and whomever uses it
[20:59:51] <webczat> _W_: the thing is I need to be able to reload the same module at run time
[21:00:11] <_W_> webczat, yes, most plugin systems do. J2EE containers do.
[21:00:15] <webczat> like if a new version will come
[21:00:34] <_W_> they all do it by simply letting the class instances become unreachable
[21:00:57] <_W_> you don't have any guarantees about class loading for _regular heap_ either
[21:00:57] <webczat> _W_: but I made them unreachable and even started gc but it still didn't unload
[21:01:05] <_W_> webczat, and that's fine
[21:01:08] *** Johannes13 has quit IRC
[21:01:24] *** gkmngrgn has joined ##java
[21:01:25] <webczat> but thnen they won't reload
[21:01:36] <_W_> webczat, the JVM can choose when to unload - not saying you don't have a bug, but it would be masked by this
[21:01:37] <webczat> s/then
[21:01:42] <_W_> webczat, why not?
[21:01:56] <_W_> different class loaders can have the same class loaded, same version or different versions
[21:02:21] <webczat> _W_: because LoadClass loads the class only in the case of it's inexistence
[21:02:26] <_W_> no
[21:02:38] <_W_> only in the case of its inexistence /to that class loader chain/
[21:03:09] <_W_> as long as you make sure you don't load what you want pluggable with the application class loader, it works fine
[21:03:12] <webczat> Hmm, i recreated the url loader after the gc and tried to load the class that I removed before and it succeeded
[21:03:17] *** iq has joined ##java
[21:03:26] <_W_> (i.e. don't include it in the startup classpath)
[21:03:46] <_W_> webczat, and don't trigger GC, it doesn't do anything useful
[21:04:09] <webczat> it is in the current directory so the current classpath, but it isn't referenced directly as a typename, or maybe I'm wrong...?
[21:04:22] <_W_> it shouldn't be on the classpath at all
[21:04:25] <_W_> ~classpath
[21:04:26] <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].
[21:04:31] <_W_> read that if you're not sure what is on the classpath
[21:04:59] *** supercosmonaut has joined ##java
[21:05:16] <webczat> current dir is on the classpath
[21:05:24] <webczat> ahhh wait
[21:05:32] <webczat> the loader chains up to the parent loader!
[21:05:37] <_W_> any class loaders you create should be chained to the app class loader (or they won't do what you expect /at all/), so nothing that you want to define at runtime should be loadable by the app class loader (which loads things from the class path)
[21:05:44] <webczat> so the app loader loaded it
[21:06:10] <_W_> yeah, the app class loader won't ever be garbage collected
[21:06:43] <webczat> does vm itself look if the class loader is garbage collected when unloading the class?
[21:06:57] <_W_> what do you mean "look"?
[21:07:26] <_W_> the VM has various strategies for checking the object graph for what is reachable from threads or not
[21:07:35] <webczat> i mean if vm records what was the loader for the class somewhere outside of the Class object too and if it's garbage collected it can unload the class definition?
[21:07:36] <_W_> things you shouldn't care about
[21:07:37] <RLa> if nothing references that class loader, it should be collectable
[21:07:53] <_W_> webczat, that's not relevant to your code
[21:08:19] <_W_> just trust the JVM to do the right thing
[21:08:40] <webczat> mhm... can I technically load the same class 200 times without any problems with separate class loaders?
[21:08:44] <monty_hall> Looks like some folks in stackoverflow are doing the same thing wrt to final transients and deserialization.
[21:09:12] <RLa> why trusting jvm, when using tomcat, leads to out-of-permgen errors?
[21:09:24] <_W_> webczat, yes, though if you retain references to them all, you are likely to run out of PermGen space, unless you set that to something ridiculously high
[21:09:26] <RLa> on redeploys
[21:09:50] <_W_> RLa, because code that is hotloaded needs to be coded with care to be collectable
[21:09:59] <_W_> the biggest gotcha is starting threads
[21:10:18] <_W_> e.g. URLConnection keeps a thread running once you've ever talked to the server
[21:10:39] <_W_> that thread will again keep the instances it can reach from being collected, and their classes, and their class loaders
[21:10:39] <RLa> _W_, and that's used by URLClassLoader?
[21:10:42] <webczat> _W_: actually java api docs don't describe the use for directly using the class loader except of an example inside
[21:10:45] <RLa> or what it was
[21:10:48] <_W_> RLa, no
[21:10:51] <_W_> not that I know anyway
[21:10:56] <RLa> hm
[21:11:08] <_W_> I just mean, you might do some calls from hotloaded code that starts threads without you knowing about it
[21:11:14] <_W_> those threads can keep stuff from being collected
[21:11:29] <_W_> the best way to do this is to run with a security manager that controls who can start threads
[21:12:00] <RLa> so threads created by container for serving requests etc. do not count?
[21:12:08] <dreamreal> heh
[21:12:10] <_W_> (and for all I know Tomcat might have a bug in its hotloading code)
[21:12:29] <RLa> that thing has haunted my for long time
[21:12:35] <RLa> 4-5 years
[21:12:44] <_W_> RLa, it's not who creates threads, or what their purpose is, but what the objects on the call stack of the thread can reach
[21:13:39] <_W_> typically the request handling threads for a web server will sooner or later exit down from user code to the server code loaded by the app class loader (or some other class loader not chaining the web app class loader)
[21:13:42] *** yoshx has quit IRC
[21:13:51] <RLa> this also includes ThreadLocal variables?
[21:14:01] *** yoshx has joined ##java
[21:14:05] *** mihi has joined ##java
[21:14:16] <_W_> ThreadLocals are another caveat yes
[21:14:19] *** riotz has quit IRC
[21:14:24] <RLa> i guess it does, and that might be the problem
[21:15:06] <RLa> seen them used a lot for keeping various contexts
[21:15:14] <_W_> there are plenty of pages and threads reachable from google on thread locals and tomcat
[21:16:04] *** ryanakca_ is now known as ryanakca
[21:17:18] <RLa> also, how code replace using debuggers work, replacing only method bodies?
[21:18:29] *** jpk has joined ##java
[21:21:16] <monty_hall> screw it, I'm going to serialize the temp varaibles.
[21:24:15] *** jmut has joined ##java
[21:25:47] *** phantomcircuit has joined ##java
[21:28:31] *** Nikelandjelo has joined ##java
[21:28:55] *** queequeg1 has quit IRC
[21:29:14] <elzoog> Is a warning that a function is declared final in a class safe to ignore?
[21:29:33] <mihi> RLa: http://download.oracle.com/javase/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/VirtualMachine.html#redefineClasses(java.util.Map)
[21:29:46] <RLa> nice
[21:29:52] *** DerHorst has quit IRC
[21:30:02] <AMcBain> elzoog, Java doesn't have functions.
[21:30:58] *** poccha has joined ##java
[21:31:17] *** Rayne has joined ##java
[21:31:38] <elzoog> AMcBain: ?? then what do you call { public double foo(x) { return (x*8.3);} } ??
[21:31:53] <AMcBain> A method.
[21:31:58] *** bitshuffler_ has joined ##java
[21:32:08] <dreamreal> elzoog: it's a method.
[21:32:37] *** antigravity has quit IRC
[21:33:21] <elzoog> Seems like symantics to me. In mathematics a function is something that maps a set of somethings to another set of somethings.
[21:33:27] <dreamreal> and yes, this is the sort of thing that gets pedants to be excited at night.
[21:33:49] <dreamreal> But in programming, a function is something that exists without context; a method is something that uses context.
[21:34:07] <dreamreal> Therefore, since everything in Java is associated with something - even static methods - everything is a method, not a function.
[21:34:43] *** yoshx has quit IRC
[21:34:50] <elzoog> Okay so to rephrase my question, if I am getting a warning about declaring a method final, is that warning safe to ignore?
[21:35:46] *** bitshuffler has quit IRC
[21:35:51] <Tuplanolla> If nothing inherits it, why not?
[21:35:55] *** ModusPwnens has joined ##java
[21:36:07] <AMcBain> elzoog, what is the exact text of the warning?
[21:37:34] <elzoog> "static method roundToPlace is declared final alt-enter shows hints" is the exact message I get
[21:37:46] <ModusPwnens> I am using the box layout for a GUI. I want all my components to have their width resized dynamically with the window, but how do I restrict the height of certain components?
[21:38:13] <monty_hall> dreamreal: you took the words out of my mouth - pedantic.
[21:38:21] <monty_hall> a lot of that going on here.
[21:40:01] <AMcBain> elzoog, you probably get that because static methods are associated with a class.
[21:40:08] *** PelleTut has joined ##java
[21:40:15] <AMcBain> So if I declare a static method "foo" in A and B, and B extends A, B.foo does not override A.foo
[21:40:32] <elzoog> ModusPwnens: Try certainComponent.setMaximumSize(certainComponent.getPreferredSize())
[21:40:36] <AMcBain> So declaring A.foo or B.foo final in essencese has no effect.
[21:40:39] <AMcBain> essence*
[21:40:53] <AMcBain> I still think I spelled that wrong ...
[21:42:48] <elzoog> Well, the class in question will not be extended by another class. In fact, it's a bit of an anti-pattern because the class never gets instantiated.
[21:43:27] *** monty_hall has left ##java
[21:44:18] <ModusPwnens> elzoog, that doesn't seem to work =/
[21:44:32] *** shakamca has quit IRC
[21:44:37] <elzoog> Purpose of the class is to have mathematical functions that are not already in Math.xxx
[21:44:50] *** eidolon has quit IRC
[21:44:50] *** bojo has quit IRC
[21:45:07] <ModusPwnens> Is there a way to just provide one restriction? That set maximum size function always requires width and height..
[21:45:10] <elzoog> ModuxPwnens: It works. You make a class with only static methods and declare the constructor private
[21:45:38] *** cool123 has joined ##java
[21:45:42] <elzoog> ModusPwnens: Oh sorry, I got confused.
[21:47:06] *** shaunren has joined ##java
[21:47:07] <elzoog> ModusPwnens: setPreferredSize and setMaximumSize both take a Dimension type. I suppose you could do Dimension dim = new Dimension (x,y) with y being the maximum height you want.
[21:47:54] <elzoog> Modus: Problem is, you have to specify the maximum width as well.
[21:48:25] <AMcBain> elzoog, classes with only static members are usually considered utility classes, which doesn't really need to conform to a pattern other than don't put stuff in there that's better for things that can be done easily (or more easily) on/in instances.
[21:48:45] <AMcBain> and you usually don't make their methods final, you make the class final and make a private constructor.
[21:49:08] <ModusPwnens> Is there an x i can provide that will allow the component to have the same width as the window?
[21:49:28] *** Bombstone has joined ##java
[21:49:51] <AMcBain> ModusPwnens, what are you trying to do? do you want a component to be the exact size you set, or the window to be the exact size you set?
[21:50:37] <_W_> I prefer to avoid utility classes myself - sooner or later I want ones with persistent settings.
[21:50:38] <ModusPwnens> I just want the component to not be restricted in width but to have a restricted size. I am using box layout and the way its sizing the elements makes the textField much taller than I want it to be.
[21:51:10] <elzoog> AMcBain: So does it make sense for a utility class to have a mathematical function, say BesselFunc(double a, double b) ??
[21:51:22] <AMcBain> _W_, I try to avoid making ones that deal with any sort of state. If I would need that I try to integrate it better somewhere else.
[21:51:26] *** EricInBNE has joined ##java
[21:51:34] <_W_> elzoog, for a look at how utility classes usually work, look at Math
[21:51:44] <AMcBain> elzoog, if you plan to use it in more than one location and there's no associated state.
[21:52:03] <_W_> AMcBain, you can't predict the future though - suddenly at some point in the future you find out it would be useful to have state
[21:52:17] <AMcBain> _W_, then at that point I refactor. :)
[21:52:17] <_W_> that's why I don't make such classes
[21:52:33] <_W_> AMcBain, third party users of your API will be happy about that I'm sure
[21:52:49] *** gdoko has joined ##java
[21:53:12] <AMcBain> _W_, so far I've only written one publically published library. Everything else I've done has been for complete projects.
[21:53:20] <AMcBain> So refactoring is entirely valid.
[21:53:23] <ModusPwnens> Is there something I can do with the box layout to prevent it from making my textfield so tall?
[21:53:37] <AMcBain> ModusPwnens, set a maximum size?
[21:54:10] <ModusPwnens> Yes, but how do I allow the width of the component to be flexible, but the height to be fixed?
[21:54:14] *** Xgc has quit IRC
[21:54:34] <AMcBain> Set a large maximum width
[21:54:36] <elzoog> Modus: You might try something like setMaximumsize(new Dimension(999999, 99)) or something like that. Or Dimension winDim = window.getSize(); int windowWidth = winDim.width; setMaximumSize(new Dimension(windowWidth, 99)) or some other variations
[21:55:45] *** bitshuffler__ has joined ##java
[21:55:57] <elzoog> _W_ This particular class won't ever have a state. It's just a bunch of mathematical functions that are not in Math.xxx
[21:56:11] <_W_> elzoog, even Math could use some state
[21:56:50] <elzoog> _W_ what sort of state could Math use?
[21:58:00] <_W_> it could be useful to have instances of Math that let the trigonometric methods take parameters in radians or degrees, depending on what constructor parameter you used
[21:58:05] *** bitshuffler_ has quit IRC
[21:58:21] <_W_> (or grads, if you're that perverted)
[21:58:59] <_W_> that said, Math probably does too many things - something like this would best fit in a Trigonometry class
[21:59:31] <elzoog> _W_ it would probably make more sense to make radians or degrees an optional parameter to pass to the method
[21:59:54] <_W_> it would also be nice to be able to pass instances of either Math or StrictMath to a class
[22:00:30] <_W_> elzoog, nah, you'd typically stick to one throughout a scope, and as such it's best to just specify it once, and a constructor parameter is perfect for this
[22:01:04] *** titankiller has quit IRC
[22:01:08] *** KwikkSilva has joined ##java
[22:01:11] <KwikkSilva> eh up
[22:01:39] *** Bombstone has quit IRC
[22:02:13] <KwikkSilva> have an issue using iText - i can't seem to extract images from my PDF which have multi-stage filters... anyone know if i can do my own multi stage pull? or is that too complicated?
[22:02:39] <selckin> sounds like something for the itext mailing list
[22:02:53] *** eidolon has joined ##java
[22:03:02] <KwikkSilva> yup was thinking so... just was going to check here also - i think a few of the guys hang out here
[22:03:22] <elzoog> Modus: If you want the width to be flexible and the height to be fixed, then you will need two different layout managers.
[22:04:14] <AMcBain> elzoog, wth? no.
[22:04:49] *** mihi has quit IRC
[22:05:19] *** Johannes13_ has quit IRC
[22:06:41] <elzoog> Modus: I could be wrong, but why not try putting the boxlayout in one panel, then putting that panel in another panel or frame that uses a different layout manager, say borderlayout
[22:07:22] <AMcBain> or why not go with the maximum size of a restricted height and large width?
[22:07:46] <AMcBain> item.setMaximumSize(new Dimension(item.getMaximumSize().width, restrictedWidth));
[22:07:55] <elzoog> Modus: I created a frame this way where the text pane will resize to the entire window, but the button at the bottom will always be the same size. I can give you the source for that if you want
[22:10:22] *** echo_mirage has joined ##java
[22:11:09] *** Johannes13 has joined ##java
[22:11:22] *** svm_invictvs- has quit IRC
[22:12:39] <elzoog> Modus: Try something like this, http://pastebin.com/9EuNv3JT
[22:12:50] <aLeSD> hi all
[22:13:18] <aLeSD> I have a doubt on how to code a multithread app.
[22:13:36] <elzoog> Modus: That code will create a text pane that will take up the entire window except for a space at the bottom for a button. When you resize, the text pane will resize, but the button will stay the same size
[22:13:46] <selckin> ~tell aLeSD about jcip
[22:13:47] <javabot> aLeSD, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java. http://jcip.net/
[22:14:06] <aLeSD> I have a thread that fill a list and another one that ask for a sublist
[22:14:22] <AMcBain> elzoog, I don't think that's what he wanted, and you're seriously just spouting whatever comes to mind first.
[22:14:32] <AMcBain> So just stop.
[22:15:24] *** lf94 has joined ##java
[22:15:54] <lf94> Hey, what does it want for size?: IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b)
[22:16:21] <lf94> This is just the color index for my image right?
[22:16:38] *** terranova has joined ##java
[22:16:49] *** terranova has quit IRC
[22:17:24] *** terranova has joined ##java
[22:18:02] *** echo_mirage has quit IRC
[22:18:04] <AMcBain> ModusPwnens, are you still having an issue with BoxLayout, and did the setting of a maximum size help (it should have, I can provide a test-case if you wish to that end)?
[22:18:16] *** TheMZ has joined ##java
[22:18:36] <elzoog> AMcBain: Actually, it might be what he wants. If he comments out the code that keeps the button the same size in width, he will find that the button will grow in width as the window grows, but will stay the same height
[22:19:17] *** bitshuffler has joined ##java
[22:19:17] <AMcBain> elzoog, he was originally dealing with a BoxLayout and as far as I could tell was wanting a single "box" to have a fixed height but flexible width. Which is possible.
[22:19:28] *** TheMZ has quit IRC
[22:19:33] <AMcBain> This doesn't mean changing to an entirely different layout.
[22:19:39] <AMcBain> Not all layouts offer the same abilities.
[22:20:19] *** bitshuffler__ has quit IRC
[22:20:52] <elzoog> The code snippet I provided also uses boxlayout
[22:20:54] <AMcBain> elzoog, consider this: http://pastebin.stonekeep.com/11585
[22:22:04] *** anaconda has quit IRC
[22:22:23] <AMcBain> Also, I hardly consider your paste simple. The idea behind test-cases it to present the smallest possible thing that works (or doesn't if demonstrating a problem) such that it is all as understandable as possible.
[22:23:05] *** dk_schrute has joined ##java
[22:23:17] *** dk_schrute is now known as svm_invictvs-
[22:23:45] *** Bombstone has joined ##java
[22:24:41] *** elzoog has quit IRC
[22:25:22] *** xil has joined ##java
[22:25:59] *** anaconda has joined ##java
[22:26:26] *** osaka has quit IRC
[22:26:35] *** elzoog has joined ##java
[22:26:44] *** eyesUnclouded has joined ##java
[22:27:30] <elzoog> Modus: Is your problem solved?
[22:27:42] <xil> hi, I need a data structure that gives me random access but is also resizable. I know ArrayLists can do that, but I'm concerned that they might slow things down too much because of resizing. Is that something I should worry about really? How much do ArrayLists try to predict extra space to allocate on resizes? And for that matter, when they resize do they actually reallocate their entire contents or do they just add more space in a fragmented way
[22:27:56] <AMcBain> elzoog, You know, if you'd actually use tab complete and write his full nickname you'd actually catch his attention.
[22:28:16] <AMcBain> Plus considering he didn't respond earlier to mine either I presume he's busy or AFK and doesn't need to be bombarded.
[22:28:54] <AMcBain> xil, I believe if you read the ArrayList JavaDoc class description it tells you.
[22:29:17] <AMcBain> You can also create an ArrayList designed to hold a certain amount (but it doesn't make all those indexes available until you add items) so it has to grow less.
[22:29:45] *** poccha has quit IRC
[22:29:50] <AMcBain> I would personally program toward List (which allows random access) and use ArrayList as the backing impl, and not worry about it until there is specifically a noticeable bottleneck for doing so.
[22:30:03] <eidolon> hmm, are there any spring gurus about? the use of annotations in the domain objects negates hte need for hbm.xml files when using spring JPA, right?
[22:30:13] *** KwikkSilva has quit IRC
[22:30:41] <selckin> thats not related to spring, but sure
[22:31:05] <eidolon> well, i'm using spring's hibernate stuff - ala, the sessionfactory
[22:32:17] <selckin> spring doesn't do anything with the entity annotations, thats jpa/hibernate
[22:32:39] <selckin> spring just manages an instance of entitymanager etc for example
[22:32:48] <AMcBain> and yes for almost everything you don't need an XML config file when using JPA Annotations with Hibernate.
[22:33:21] *** cool123 has quit IRC
[22:33:27] <eidolon> okay. i'm trying to figure out how to implement jpa tools into this app - which is using spring to inject a datasource into teh DAO's now.
[22:33:40] *** homie has quit IRC
[22:33:44] <eidolon> but i'm tired of writing my own daos and domain objects from scratch. hence.. :)
[22:33:50] <xil> AMcBain: thanks, for now I'm just trying to make something that works so I'm sticking with ArrayLists, but it does say amortized constant time for insertions, which even though it doesn't specify, I think is good enough for now
[22:34:33] <AMcBain> xil, well, what that means is that sometimes it may have to grow to insert a value, but the default config provides enough room on grow that it won't have to grow again on next insert.
[22:35:01] <AMcBain> So if you find the default isn't working for you, then later you can try tweaking the params via a different constructor to change how /when it grows.
[22:35:34] *** gdoko has quit IRC
[22:35:41] <AMcBain> but usually it's not a problem :)
[22:35:48] *** Rubarb has joined ##java
[22:35:59] *** Rubarb has quit IRC
[22:36:24] <xil> AMcBain: I thought "amortized" meant that it's always trying to adapt by how much it grows in order to try to minimize how often it does so
[22:37:16] <AMcBain> That might also be so.
[22:37:38] <AMcBain> but from the class description it seems to me to be based on input parameters, but those might just be starting defaults.
[22:38:01] *** jjido has joined ##java
[22:38:40] *** echo_mirage has joined ##java
[22:39:07] <xil> AMcBain: oh, yeah, and for now I'm just using the defaults. I mean, I haven't had trouble with ArrayLists before, but I'm doing some genetic algorithm stuff so I'll have a lot of instances of ArrayLists all growing in not necessarily predictable ways and at the same time somewhat executing in realtime. It's a lot for my laptop to handle I think, haha
[22:39:08] <AMcBain> xil, okay, reading the exact wording just indicates that over time adding an item will have a average measured time of O(n) given that some additions will grow.
[22:39:31] *** rtdos has quit IRC
[22:39:34] <AMcBain> that's what they mean by "amortized constant time"
[22:39:39] *** Kamaran has joined ##java
[22:40:03] <xil> AMcBain: I thought it said it's on average O(n) for adding n elements, not one
[22:40:20] <AMcBain> huh, oh, yeah ... for n elements.
[22:40:38] <aLeSD> if I create a vector with the method Vector.sublist ... do I have a syncronized vector ?
[22:40:43] <AMcBain> because they can't say O(1) given the adds which grow.
[22:40:53] <xil> AMcBain: right
[22:41:15] <AMcBain> aLeSD, ugh, Vectors. You know they don't really do the synchronization most programs need, right?
[22:41:46] <AMcBain> They ensure each operation on the Vector is separately synchronized, and most programs actually need some sort of batch updating or data retreival.
[22:41:52] <xil> AMcBain: well it looks like it's fine for what I need I guess, I'll just optomize later if it's necessary. I found out 2 days ago that WATSON is more than 50% Java, so it should be fast enough right? haha
[22:42:07] *** matsebc has quit IRC
[22:42:15] <aLeSD> AMcBain: no .. I don't know. What do u mean ? I need a muxed list
[22:42:32] <eidolon> is this all i'll need for the jpa init within application context? assuming i do annotations on my domain objects?
[22:42:33] <eidolon> http://pastebin.stonekeep.com/11586
[22:42:46] *** jjido has quit IRC
[22:42:53] <eidolon> after that, i'd love to see a sample DAO - the spring pages on this are incredibly dense and complex :(
[22:43:00] *** rtdos has joined ##java
[22:43:09] <AMcBain> aLeSD, you* and what I mean is that you have more control if you do synchronized(list) { /* do stuff here */ } than if you use a Vector or a result of Collections.synchronizedList(...);
[22:43:16] <aLeSD> AMcBain: I need mutual exclusion for some part of my programs ... not only for a Vector operation
[22:43:44] <aLeSD> AMcBain, I understand what you are telling me
[22:43:49] <AMcBain> Right. So you want to use a synchronized block on a specific "lock" object, not a Vector that synchronizes on each operation to it.
[22:44:13] <aLeSD> Perfect ... cause I prefer tu use a Linked List
[22:44:16] *** jjido has joined ##java
[22:44:25] <AMcBain> aLeSD, yuck, but whatever ...
[22:44:31] <aLeSD> I will loon on the Linked List object directly
[22:44:37] <aLeSD> loon == lock
[22:44:57] <aLeSD> AMcBain, thanks
[22:45:15] <AMcBain> no problem
[22:46:47] <TomyLobo> are arrays Iterable?
[22:46:48] *** dijonyummy has joined ##java
[22:47:55] <TomyLobo> i can use it in an iterator-for but not assign it to an Iterable<T>
[22:48:49] <TomyLobo> String[] foo = new String[] { world.getName() }; Iterable<String> foo2 = foo; // this fails
[22:48:59] <TomyLobo> but this works: for (String bar : foo) {
[22:50:29] *** RLa has quit IRC
[22:50:40] <xil> TomyLobo: that enhanced for loop notation is just a shortcut that Java has built in for certain data structures I believe. It isn't specific to iterables
[22:50:45] <AMcBain> TomyLobo, that's right. Arrays are a bit of a special case.
[22:50:53] <TomyLobo> darn
[22:50:56] <AMcBain> Iterable is the general case.
[22:51:10] <AMcBain> TomyLobo, why not work with a List instead?
[22:51:13] <AMcBain> They're also more Generics compatible.
[22:51:26] <TomyLobo> i dont suppose there is any other way to pass both an ArrayList and a String[] through the same interface?
[22:51:49] <AMcBain> Arrays.asList(myStringArray) ;)
[22:51:52] <TomyLobo> AMcBain right, new ArrayList(){elements} works too right?
[22:52:07] <TomyLobo> i actually just wanted arrays for the easy initialization :D
[22:52:31] <AMcBain> uh, ew? and you can use Arrays.asList(x, y, x, ...) but you'll get out a list that is fixed size.
[22:52:44] *** jjido has quit IRC
[22:52:52] <AMcBain> but no, you cannot do new ArrayList() { x, y, z }
[22:53:01] <TomyLobo> aww
[22:53:17] <TomyLobo> i dont want to modify the list anyway
[22:53:29] <AMcBain> Then Arrays.asList may be your friend.
[22:53:32] <TomyLobo> this is just some thing's return value
[22:53:52] <AMcBain> When Java 7 rolls out, it should have literal syntax for creating Lists and Maps.
[22:54:11] <TomyLobo> section.put("world", Arrays.asList(world.getName())); yay
[22:54:28] <AMcBain> I don't recall whether they literals result in a fixed size List or Map though.
[22:54:41] <AMcBain> (unmodifiable in Collections class terms)
[22:54:56] <xil> if I make a class with no methods, just so I can group some variables together, and I declare something to be an instance of that class, say "A a;" then do I need to put "= new A();" in order for java to actually instantiate the variable "a"?
[22:55:14] <AMcBain> yes.
[22:55:29] <AMcBain> well, and you're not instantiating the variable, you're creating an instance to store in that variable.
[22:55:53] <xil> I see. Would you say it's good practive to create a default constructor for the class then?
[22:56:07] <xil> or does it not really matter?
[22:56:33] <AMcBain> Java automatically provides one if there are no other constructors, and if it does not make sense for your class to have one, then don't define one.
[22:56:45] <xil> okay, thanks
[22:56:51] <TomyLobo> i now have a method named saveWorld
[22:57:07] <_W_> TomyLobo, quick, call it!
[22:57:20] *** zatan has joined ##java
[22:57:29] <xil> _W_: haha
[22:57:34] <TomyLobo> nah
[22:57:48] *** xil has left ##java
[22:57:54] <_W_> or call saveCheerleader, which calls it
[22:57:58] *** docwhat has quit IRC
[22:59:07] *** hyppias has joined ##java
[22:59:31] <aLeSD> AMcBain: but I have a doubt on my question ... if I lock on a List ... that get a subList with List.sublist .. the sublist is locked ?
[22:59:52] <aLeSD> ops
[22:59:56] <aLeSD> stupid question
[23:02:44] *** ferret_ has quit IRC
[23:03:37] *** ferret_ has joined ##java
[23:05:48] *** dextro_ has joined ##java
[23:05:50] *** fwaokda has joined ##java
[23:06:05] <dextro_> what would be more informal Exception.toString() or Exception.getMessage()?
[23:06:12] <AMcBain> aLeSD, threading isn't easy. questions are a good thing.
[23:06:16] <fwaokda> when extending a class can i override any of the methods it had or just specific ones?
[23:06:45] *** tobel has joined ##java
[23:06:53] <TomyLobo> fwaokda you cannot override final methods
[23:07:03] *** tobel has quit IRC
[23:07:05] *** FCTW has joined ##java
[23:07:40] <fwaokda> TomyLobo, thanks
[23:07:44] <TomyLobo> also, to make sure the underlying methods exist, don't forget to write "@Override" before everything you override
[23:07:53] <aLeSD> AMcBain: Yes .. it was a stupid things because Lock in not indicative of an object ... so I can lock on an object and do other things without my List ..
[23:07:59] <AMcBain> aLeSD, If you synchronize on a List, then get out a sublist it will work similar to an Iterator, that is you run into problems if you modify the List from which you got the sublist.
[23:08:27] <aLeSD> I was used with mutex in x ... it's the same
[23:08:55] <aLeSD> AMcBain, yes but I will do insaide a lock block
[23:08:59] <aLeSD> so .. no problem
[23:09:00] *** Speed` has quit IRC
[23:11:59] <AMcBain> aLeSD, well, I'm going to head out. however, good luck. :)
[23:13:09] *** AMcBain has quit IRC
[23:13:15] *** davidmogar has joined ##java
[23:13:50] *** Tuplanolla has quit IRC
[23:14:19] <TomyLobo> section.put(String.format(format, "x"), Arrays.asList(String.valueOf(vector.getX()))); more brackets than scheme
[23:14:27] *** riotz has joined ##java
[23:14:54] *** PhoenixSTF has joined ##java
[23:15:08] <davidmogar> hello. I need to read from a url (with a previous login), do something with the response and send a string. The first step is easy. I'm using setRequestProperty("Cookie" but when I try to send the string the web says that i'm not authenticated. What can I do?
[23:15:27] <TomyLobo> davidmogar http only?
[23:15:42] <davidmogar> TomyLobo: yes, I'm using urlconnection
[23:16:24] <TomyLobo> oh didnt see the rest of the question
[23:16:56] *** amichair has joined ##java
[23:16:59] <TomyLobo> what you are trying sounds like you're trying to cheat on some browser game
[23:17:19] <davidmogar> not cheat. I have 3 seconds to process a string and send the reply
[23:17:47] <TomyLobo> so you're cheating to get around this puzzle
[23:17:55] <davidmogar> the string is decoded, but when I try to send the result, I get a response from the server saying that I'm not authenticated
[23:18:33] *** gkmngrgn has quit IRC
[23:18:37] *** JohnnyDavidson has joined ##java
[23:20:32] *** homie has joined ##java
[23:20:40] *** Scorchin has joined ##java
[23:21:26] <Scorchin> I've currently got a factory pattern in the form of a singleton. What are some sane ways to do the same object building, without using a singleton? Examples would be much appreciated.
[23:22:45] *** webczat has quit IRC
[23:22:52] *** wchun has quit IRC
[23:23:10] *** reisi has joined ##java
[23:23:10] *** bn` has quit IRC
[23:27:21] *** dijonyummy has quit IRC
[23:28:12] <dextro_> catch (Exception e) { e.printStackTrace(); } // how do i get what this prints into a string? .toString does not work
[23:30:17] <bearded_oneder> davidmogar: http://www.javaworld.com/javatips/jw-javatip47.html ; http://download.oracle.com/javase/1.5.0/docs/api/java/net/URLConnection.html ; http://www.javadocexamples.com/java/net/URLConnection/setRequestProperty(String%20key,String%20value).html
[23:33:07] <davidmogar> bearded_oneder: that is to work with user and pass but I want to use my cookie
[23:34:38] *** blbrown_win3 has joined ##java
[23:34:48] *** jmut has quit IRC
[23:35:16] *** Bombstone has quit IRC
[23:35:32] *** bitshuffler has quit IRC
[23:35:56] *** srji has quit IRC
[23:38:45] *** FCTW has quit IRC
[23:39:19] *** ker has quit IRC
[23:40:15] *** eyesUnclouded has quit IRC
[23:40:30] *** riotz has quit IRC
[23:41:55] *** demifuror has joined ##java
[23:42:01] <TomyLobo> dextro_ there's a variant that prints to a stream
[23:42:57] *** kaemo has quit IRC
[23:47:16] *** elzoog has left ##java
[23:47:55] <dextro_> ?
[23:48:07] *** Bombstone has joined ##java
[23:48:53] *** Rayne has quit IRC
[23:49:10] <TomyLobo> how do i specify the type parameters for a generic method explicitly?
[23:49:37] <TomyLobo> ah nm found it
[23:49:48] <TomyLobo> C.<T>m()
[23:49:51] *** Johannes13 has quit IRC
[23:54:33] *** user17 has joined ##java
[23:55:47] *** cool123 has joined ##java
[23:59:27] *** Guyman has quit IRC
[23:59:48] <TomyLobo> dextro_ if you cant find it, you're looking at old api docs
top

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