NOTICE: This channel is no longer actively logged.
[00:00:05] *** Dr_Link has joined ##java[00:00:10] *** mengu has joined ##java[00:01:03] *** ahughes has joined ##java[00:01:08] *** p8m has quit IRC[00:01:59] *** riotz has quit IRC[00:03:30] *** bolt has quit IRC[00:05:01] *** bolt has joined ##java[00:07:20] *** Niike| has quit IRC[00:08:05] *** mattis has quit IRC[00:09:55] <pilkarn> how does a MediaPlayer work? does it put pixels on the screen according to a decoding-scheme?[00:10:28] <cybereal> it puts pixels on the screen, with sticky putty![00:10:52] *** jawnsy has joined ##java[00:11:27] <jawnsy> is there a generic way to tell what type an object is? I looked at getClass but am not sure how to use it[00:12:48] *** riotz has joined ##java[00:12:55] <benJIman> Perhaps you're looking for instanceof?[00:13:24] *** riotz has quit IRC[00:13:38] *** Infinito is now known as Infinito-[00:13:39] <jawnsy> benJIman: got a link?[00:14:07] *** romanb has quit IRC[00:14:15] *** Infinito- is now known as Infinito[00:14:21] *** Infinito is now known as Infinito_[00:14:26] <vol> pilkarn: for what? Are you talking about Android by any chance?[00:14:45] <vol> ~instanceof[00:14:46] <javabot> vol, instanceof is a way for checking if a given object is of a certain type. See http://mindprod.com/jgloss/instanceof.html for examples.[00:14:54] *** Infinito_ is now known as Infinito[00:14:56] *** elindio has quit IRC[00:15:18] <vol> instanceof is useful if you know what type to check against, but you can use the reflection stuff like getClass to get more general information if you have no idea what you might have.[00:15:41] *** isr` has quit IRC[00:16:12] <jawnsy> vol, benJIman : sweet! thanks[00:16:52] <benJIman> It's pretty rare that you need instanceof though, sometimes a sign you're doing it wrong.[00:17:03] *** rhsanborn has quit IRC[00:17:18] *** sombriks has quit IRC[00:17:21] <vol> you DO want to use it in .equals methods though[00:17:45] <vol> after you check to make sure the passed in object is not null[00:18:07] *** donavan has joined ##java[00:18:31] *** EruditeHermit has quit IRC[00:18:42] *** TooAngel has joined ##java[00:18:56] *** FireSlash has joined ##java[00:19:13] *** TooAngel has left ##java[00:19:41] *** Infinito is now known as Infinito-[00:19:58] *** Infinito- is now known as ungroup[00:20:18] *** roue has quit IRC[00:20:23] *** ungroup is now known as Infinito-[00:20:50] *** rdancer has joined ##java[00:21:14] *** Infinito- is now known as Infinito[00:21:34] *** _stack has quit IRC[00:21:48] *** nvictor has joined ##java[00:22:56] *** Carnage\ has quit IRC[00:23:19] *** Carnage\ has joined ##java[00:23:27] *** riotz has joined ##java[00:23:31] *** cher has quit IRC[00:23:56] *** nvictor has left ##java[00:24:54] *** waz has joined ##java[00:25:32] *** Hink has quit IRC[00:25:56] *** convivial has quit IRC[00:26:47] *** Wagoo has joined ##java[00:27:23] *** ankylose has quit IRC[00:27:30] <pilkarn> cybereal: can you be serious please? im 16 i didnt go 5 years to uni yet. i know how to program but a lot of whys and hows of signal processing and hardware is magic to me[00:28:04] <pilkarn> vol: no wasnt talking about android but i want to make games for it later on[00:28:13] <cybereal> pilkarn: why so serious?[00:28:31] <cheeser> let me tell you how I got these scars.[00:28:58] <vol> pilkarn: MediaPlayer isn't part of the Java 5 api.[00:29:10] <vol> You can't say "Tell me about random class X from random framework Y" and expect great responses[00:29:10] <cybereal> pilkarn: it's both simpler and more complicated than what you think, and I don't really find myself to be the best person to set your straight. Ultimately, it's setting pixels yes, but it's doing it through various means beyond just directly setting them, because setting pixels is slow and expensive. Furthermore yes it's decoding video streams to decide which pixels to change over time.[00:29:11] <The_Birdman> that's for sure :-)[00:30:27] *** pstickne has quit IRC[00:30:54] <cybereal> oh you were talking about some java class? funny I thought you were asking how Windows Media Player worked, or at least media players in general... haha yay for vague questions[00:31:25] <vol> after a little googling, http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/apidocs/javax/media/bean/playerbean/MediaPlayer.html[00:31:29] <vol> I think that's what he means?[00:31:35] <cybereal> that's what I've found[00:32:54] *** mitchnull has left ##java[00:33:27] *** Carnage\ has quit IRC[00:33:50] *** Carnage\ has joined ##java[00:33:52] *** donavan has quit IRC[00:35:36] <pilkarn> i was talking about mediaplayers in general[00:35:39] *** dunmer has quit IRC[00:36:04] *** KingBilly has quit IRC[00:36:23] *** Johnny_vd_Laar has quit IRC[00:36:29] <vol> oh.[00:36:39] <vol> Then they throw pixels at the screen, usually via direct access to a framebuffer[00:36:40] <cybereal> When I was 16, I didn't understand the importance of formulating good questions in regards to getting interesting and useful answers. I would impart to you this advice, sagely, in my old age of 26 :) that you get to learn how to ask better questions ASAP or you're going to hit so many walls.[00:36:44] <cybereal> ~smart questions[00:36:44] <javabot> you need to ask smart questions to get a smart answer. see http://www.catb.org/~esr/faqs/smart-questions.html[00:36:47] <cybereal> ~getting answers[00:36:47] <javabot> cybereal, getting answers is a less self-absorbed version of ESR's rant on asking smart questions, it's rather helpful for newbies like you. Find it at http://www.mikeash.com/getting_answers.html please.[00:37:07] <cybereal> direct framebuffer is the second slowest method[00:37:20] <cybereal> then you have MMX type extensions for direct bus copies between memory and the fb[00:37:48] <cybereal> then you have accelerated video API's that usually leverage a 3d accelerator in a magical custom way[00:38:27] <vol> and then you have pixies and gnomes[00:38:31] <cybereal> indeed[00:38:57] <cybereal> also you get into the realm of hardware specific to the task, video cards with video decoding built in for embedded devices, etc.[00:40:05] <cybereal> I remember when I had an AMD k6-2 based machine I had a video card that read data directly from my DVD-ROM drive to render DVD output without the slowdown of all the buses[00:42:12] *** bitshuffler has quit IRC[00:44:22] *** kane77 has quit IRC[00:47:51] *** nvictor has joined ##java[00:48:18] *** Varox has joined ##java[00:48:19] *** nvictor has left ##java[00:48:22] *** Gracenotes has quit IRC[00:49:37] *** riotz has quit IRC[00:49:37] *** thepointer-work has joined ##java[00:49:37] *** Gracenotes has joined ##java[00:50:33] *** [Steffy] has quit IRC[00:52:03] <unop_> I have a java tutor who's an idiot for insisting I indent all my code in the K&R style (which i hate). So i need some sort of program that 'tidies' up my code to satisfy him - what can you guys recommend?[00:53:39] <tieTYT> the official java coding style page?[00:53:51] *** morkar- has quit IRC[00:54:27] *** EspenG has quit IRC[00:54:43] <The_Birdman> unop_:Open the file inside an IDE an indent it[00:55:08] <unop_> tieTYT, i like my style - it works for me, i need something that i can run on my code to beautify it in such a way he gets out of my hair.[00:55:35] <tieTYT> ide's will generally format it to the way java says it should[00:55:54] *** Wyzard has joined ##java[00:56:05] <unop_> The_Birdman, i'd prefer something smaller than an IDE - if there is something. I just use a text editor (vim) and don't want to install a IDE just for this purpose.[00:56:47] <tieTYT> have you tried installing google?[00:57:23] <unop_> nope - what's that - an IDE ? :)[00:59:16] *** pilkarn has left ##java[01:02:20] *** delskorch has joined ##java[01:05:04] *** gregor_k has quit IRC[01:05:07] *** razel has joined ##java[01:05:31] <razel> im getting an error[01:05:37] *** monestri has joined ##java[01:05:51] <razel> exception java,io.IOException is never thrown in body of corresponding try statement[01:06:30] <tieTYT> you're trying to catch something that can't happen[01:07:02] <razel> omg nvm[01:07:05] <razel> it was spelling[01:07:06] <razel> lol[01:07:23] <razel> thx tho[01:07:38] <razel> ouch[01:07:41] <kinabalu> maybe if you fully spelled out a word, you wouldn't misspell it when it counts?[01:08:38] *** durka42 has quit IRC[01:08:58] *** Carnage\ has quit IRC[01:09:07] *** menace has joined ##java[01:09:21] *** Carnage\ has joined ##java[01:10:20] *** ChanServ sets mode: +o pr3d4t0r[01:10:22] *** razel was kicked by pr3d4t0r (pr3d4t0r)[01:10:26] *** ChanServ sets mode: -o pr3d4t0r[01:10:57] *** [[thufir]] has joined ##java[01:11:31] *** razel has joined ##java[01:14:05] <mocas> easy way to get a ext from a file name?[01:15:13] <The_Birdman> there's no function built into the jdk to do that[01:15:23] *** gambler has quit IRC[01:15:52] <mocas> exist some right function?[01:15:59] *** matsebc has quit IRC[01:16:07] <mocas> like String.right(str, 3)[01:16:10] <mocas> or something[01:16:18] *** matsebc has joined ##java[01:16:36] <matsebc> Hello question, anyone knows of a free database for j2me?[01:16:56] *** giaco has joined ##java[01:17:00] *** deca has joined ##java[01:17:16] <mocas> all open sources, jdbc/odbc databases[01:18:24] <paztulio_> mocas: string.substring(string.lastIndexOf(".")+1,string.length).toLower()[01:20:15] *** giaco has quit IRC[01:20:53] <ramdam> ~hi[01:20:53] <javabot> http://i38.tinypic.com/25aopzn.jpg[01:21:18] <ramdam> ~vector[01:21:18] <carignanboy> ~list[01:21:18] <javabot> You should not use Vector / Hashtable unless you need to be compatible with java 1.1 (which nobody has for at least 5 years!) OR you're using J2ME. If you need thread safety, use Collections.synchronizedList/synchronizedMap. For more details, see http://tinyurl.com/3c7rvq or ask me about "javadoc Collections.synchronizedList(*)".[01:21:19] <javabot> http://java.sun.com/docs/books/tutorial/collections/interfaces/list.html[01:21:22] <matsebc> mocas: one with a small footprint?[01:21:35] <mocas> paztulio_, tks[01:21:37] <mocas> it works[01:22:11] <paztulio_> mocas: it will throw Exception when the file has no "." in it, so you need to check that[01:22:35] <mocas> ok, thanks[01:22:47] <paztulio_> mocas: the result from lastIndexOf[01:23:51] *** Epitaph64 has quit IRC[01:24:36] *** npm has joined ##java[01:25:03] <paztulio_> matsebc: maybe you dont need a real DB? Maybe just use Serialisation? I would look for something like sqlite for java, but i dont use ME-edition[01:25:05] <skypce> alguien que hable español para hacerle una consulta?[01:26:00] <matsebc> skypce: dime[01:27:39] <skypce> matsebc, mira quiero realizar un settext a una variable jTextField que esta en un Jdialog, pero esto quiero hacerlo desde un JFrame[01:27:52] *** SinisterBen has joined ##java[01:28:13] <skypce> hice un import de la clase del JDialog a mi Jframe[01:28:30] <skypce> import my.boletas.nuevaBoletaDialog;[01:28:58] *** nor3 has quit IRC[01:29:01] <skypce> pero por lo que veo no importa los elementos jtextfield[01:29:45] *** mocas has quit IRC[01:30:06] <skypce> son cositas basicas que pregunto, pero me sirven mucho ya que son los pilares para construir sistemas[01:30:10] <matsebc> tienes que crear metodos de acceso para las variables que son locales al dialog[01:30:51] <skypce> gracias matsebc voy a googlear un poco con lo que me dijistes[01:31:10] *** waz has quit IRC[01:31:20] <skypce> si me va mal , te agradeceria mucho un ejemplito[01:31:27] <skypce> pero , solo si me va mal[01:31:33] <skypce> gracias[01:31:34] <matsebc> es que en realidad lo que tienes que ver es que el jframe[01:31:44] <matsebc> tenga acceso a las variables de la instancia del jdialog[01:32:08] <skypce> y eso como lo hago[01:32:10] <skypce> el acceso[01:32:14] <skypce> ahh ya[01:32:18] <skypce> creando metodos de acceso[01:32:20] *** teralaser has quit IRC[01:32:21] <skypce> voy a investigar eso[01:32:27] *** Carnage\ has quit IRC[01:32:29] <matsebc> getters y setters[01:32:50] *** Carnage\ has joined ##java[01:34:15] *** _val_ has quit IRC[01:34:38] <razel> while((char ch = input.read()) != -1) {} whats wrong ?[01:34:53] *** orgy` has quit IRC[01:35:05] <tieTYT> ~doesn't work[01:35:06] <javabot> tieTYT, 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)[01:37:21] <razel> iit says ) expected at char ch[01:38:04] *** Carnage\ has quit IRC[01:38:27] *** Carnage\ has joined ##java[01:38:35] *** mohax has quit IRC[01:38:49] *** cybereal has quit IRC[01:42:22] *** riotz has joined ##java[01:43:05] *** phix has joined ##java[01:43:59] <phix> hey[01:44:58] *** AlanasAnikonis has joined ##java[01:46:48] *** Carnage\ has quit IRC[01:47:06] *** s9 has quit IRC[01:47:12] <phix> I need to log to a file, but I need to filter out by what thread the log was produced from, is this possible?[01:47:49] <phix> basically I have a set of standalone applications and I want to create a master app to create threads of the standalone apps[01:48:06] <phix> so the apps can be run standa alone or as a thread[01:48:14] *** t3mp3st has joined ##java[01:48:58] *** reval has joined ##java[01:50:54] <t3mp3st> I have two main groups of subclasses of a class (class Variable -- [scalar subclasses], [compound subclasses]). I'd like to determine if a particular subclass instance is a scalar: would the best way be to require each subclass to define a isScalar() method? Or would it be best to tag each scalar subclass with a ScalarVariable/CompoundVariable interface and depend on dynamic dispatch to do the "right thing" based on the runtime type?[01:50:54] *** Carnage\ has joined ##java[01:51:47] <t3mp3st> essentially, is it better to do something like ((Variable)v).isScalar() vs. someFunction(v) where there is defined someFunction(ScalarVariable v) and someFunction(CompoundVariable v)[01:52:03] <kavon> are these continue statements in this for loop unnecessary? http://pastebin.com/d3dd4f144[01:52:22] <kavon> after reading what the continue keyword does, it seems like they're just redundant right?[01:53:54] <kavon> technically its impossible for those exceptions to even happen unless the user somehow deletes the files within a milisecond of it being checked[01:53:54] *** reval has left ##java[01:54:13] *** trooto has joined ##java[01:54:38] *** trooto has quit IRC[01:55:38] *** reval has joined ##java[01:57:04] *** SinisterBen has quit IRC[01:58:18] *** reval is now known as trooto[01:58:37] *** The_Birdman has quit IRC[01:58:52] *** durka42 has joined ##java[01:58:55] <matsebc> mm, wonder why those continues are there[01:59:08] <trooto> can someone tell me why my output is all messed up? http://www.pastie.org/391296[01:59:58] *** Carnage\ has quit IRC[02:00:21] *** Carnage\ has joined ##java[02:01:05] *** squiddle has quit IRC[02:01:14] *** vesz has quit IRC[02:03:01] *** matsebc has left ##java[02:03:52] *** fridim_ has quit IRC[02:04:51] *** eduardopl has joined ##java[02:05:00] *** The_Birdman has joined ##java[02:05:14] *** menace has left ##java[02:05:37] *** waz has joined ##java[02:05:45] *** ahughes has quit IRC[02:06:54] *** SinisterBen has joined ##java[02:07:45] *** amz has joined ##java[02:10:26] *** Carnage\ has quit IRC[02:10:49] *** Carnage\ has joined ##java[02:11:14] *** tissue has joined ##java[02:12:54] *** linxuz3r has joined ##java[02:14:43] *** tomvolek has joined ##java[02:15:22] *** caverdude has joined ##java[02:15:25] <caverdude> hello[02:15:27] <caverdude> hi ChanServ[02:15:28] <caverdude> lol[02:15:32] <caverdude> hi cheeser[02:15:53] * caverdude is getting a new laptop, Asus, Wednesday[02:15:58] <caverdude> I can't wait to try eclipse on it[02:16:11] <caverdude> I'm going from 256meg ram to 4 gig ram[02:16:13] <caverdude> lol[02:16:44] <caverdude> current eclipse is almost unusable with 256meg[02:20:13] *** Epitaph64 has joined ##java[02:21:08] *** androoid has joined ##java[02:21:18] *** GodTodd has quit IRC[02:21:41] *** Daniel_H has quit IRC[02:23:09] *** riotz has quit IRC[02:24:18] *** Epitaph64 has left ##java[02:24:20] <r0bby> caverdude: understandable[02:26:08] <caverdude> sup r0bby[02:27:05] <r0bby> nuffin[02:27:14] <caverdude> working on any java projects?[02:27:30] *** firen has joined ##java[02:29:13] *** carignanboy has quit IRC[02:29:26] <pr3d4t0r> r0bby![02:29:29] <pr3d4t0r> r0bby: My friend![02:30:29] <pr3d4t0r> r0bby: My pal![02:30:37] <caverdude> sup pr3d4t0r![02:30:43] <pr3d4t0r> caverdude: Hej.[02:30:46] <pr3d4t0r> caverdude: Nothing, just hamming.[02:30:52] <caverdude> hamming?[02:30:56] <caverdude> as in ham radio?[02:30:56] <pr3d4t0r> caverdude: :)[02:30:57] <caverdude> hehe[02:30:59] <pr3d4t0r> caverdude: No.[02:31:08] <pr3d4t0r> caverdude: http://ciurana.eu/blog <-- tool[02:31:12] <caverdude> ah[02:31:30] * pr3d4t0r doesn't feel da luv from da r0bby.[02:33:03] <caverdude> pr3d4t0r lol[02:33:26] <pr3d4t0r> caverdude: Maybe if I offer to apologize for the torture I submitted him to in the last 90 days...[02:33:28] <caverdude> pr3d4t0r I get lonely when people won't reply too[02:33:42] <pr3d4t0r> caverdude: I want him to hook me up with his cousins. Some a purty![02:33:47] <caverdude> how did you torture him?[02:33:49] *** asap18 has quit IRC[02:33:55] <pr3d4t0r> caverdude: :)[02:34:08] *** TryNiX has quit IRC[02:34:14] <pr3d4t0r> Anyway... nap time.[02:35:11] *** elementz has quit IRC[02:37:08] <svm_invictvs> hehe[02:37:27] *** staykov has quit IRC[02:38:31] *** freeone3000 has joined ##java[02:39:30] *** freeone3000 has quit IRC[02:40:01] *** gambler has joined ##java[02:40:25] <r0bby> pr3d4t0r: I hate you[02:40:54] <caverdude> r0bby haha[02:41:07] <r0bby> suicide mission i know[02:41:20] <r0bby> but isn't hate just love[02:42:00] <caverdude> uh, now you are sounding like that guy Satan[02:42:16] <svm_invictvs> WHy doy ou hate pr3d4t0r?[02:42:28] <svm_invictvs> pr3d4t0r: 'twas me that just friended you on FB[02:43:03] <caverdude> FB?[02:43:07] *** ryakubo has joined ##java[02:43:09] <ryakubo> hi all[02:43:12] <caverdude> hi ryakubo[02:45:08] <ryakubo> I have a linked list containing a few String objects. If I create a ListIterator (say, 'it') from the list's listIterator() method, how can I use it to get the whole string? Is that even possible?[02:45:26] *** firen has quit IRC[02:45:44] *** aleksei has left ##java[02:46:51] *** traskbt has joined ##java[02:47:49] <eduardopl> ryakubo, what do you mean by whole string?[02:48:20] *** Meshezabeel has joined ##java[02:49:03] <ryakubo> eduardopl: something like it.getValue(), or to be able to treat something from 'it' as a String[02:49:18] <ryakubo> since it's a linked list of strings[02:49:24] *** riotz has joined ##java[02:49:54] <Meshezabeel> I have a: List<Map<String,String>> is there any way to use a foreach loop on this to get a Map<String,String> each iteration?[02:50:19] <eduardopl> you can get the value using next method, ryakubo[02:50:25] <eduardopl> check out the api[02:50:32] <The_Birdman> ~javadoc Map.Entry[02:50:32] <javabot> I don't know of any documentation for Map.Entry[02:50:42] <eduardopl> next()[02:50:52] <The_Birdman> ~javadoc Map.entrySet(*)[02:50:54] <javabot> The_Birdman: http://is.gd/jLLx [java.util.Map.entrySet()][02:51:16] *** Mehdi has joined ##java[02:51:35] <Mehdi> In an applet, is it possible to use Graphics.drawString to write paragraphs on multiple lines[02:51:42] <The_Birdman> ~applet[02:51:42] <javabot> Check the topic, read http://javachannel.net/wiki/pmwiki.php/FAQ/Applets - Basically, we don't support them here. Try the sun forums at http://tinyurl.com/2q2hog[02:51:44] *** Corinna000 has joined ##java[02:51:53] <Mehdi> or applications ... same thing in this case[02:51:59] *** Carnage\ has quit IRC[02:52:21] *** Carnage\ has joined ##java[02:52:44] <ryakubo> eduardopl: hmm, i see. that works much different than I expected...[02:52:45] *** Bonix has quit IRC[02:52:59] <Meshezabeel> The_Birdman: I did attempt an entrySet, but as far as I know, it just works on a Map, not a List of Maps[02:54:07] *** waz has quit IRC[02:54:53] <ryakubo> i was thinking i would use next to make 'it' the next string, and then work 'it' as a string[02:55:42] <ryakubo> eduardopl: thanks[02:55:48] <dmlloyd> cheeser: looks like javabot doesn't know about nested classes[02:56:56] <Meshezabeel> any ideas, or should I just use a standard for loop?[02:57:18] *** staykov has joined ##java[02:58:44] <phix> why use an entry set?[02:58:49] <The_Birdman> Meshezabeel: use a foreach loop on the list and an entry set on the map[02:59:15] <dmlloyd> Meshezabeel: just iterate over the list[02:59:16] <phix> just get a key set and itereate that[02:59:19] <dmlloyd> foreach[02:59:21] <The_Birdman> phix: using an entry set you can iterate through each map entry instead of String s = it.next() map.get(s)[02:59:32] <dmlloyd> nobody ever said anything about iterating through the map, The_Birdman[02:59:43] <dmlloyd> he just wants to get each map out of the list[02:59:50] <The_Birdman> ok dmlloyd that's great :-)[03:00:30] <phix> for(String key : map.keySet()) { map.get(key); } // assuming the key type is String of corse :))[03:01:16] <cheeser> dmlloyd: it does if they're public[03:01:31] <dmlloyd> cheeser: Map.Entry is missing[03:01:35] <dmlloyd> ~javadoc Map.Entry[03:01:35] <javabot> I don't know of any documentation for Map.Entry[03:01:37] <dmlloyd> ~javadoc Map$Entry[03:01:37] <javabot> I don't know of any documentation for Map$Entry[03:01:48] <dmlloyd> maybe it doesn't pick up on interface members?[03:02:17] <cheeser> hrm. that could be...[03:02:28] <pr3d4t0r> javabot: javadoc java.util.Map.Entry[03:02:29] <javabot> pr3d4t0r: http://is.gd/jLP8 [java.util.Map.Entry]; http://is.gd/jLP8 [java.util.Map.Entry][03:02:33] <pr3d4t0r> javabot: Gracias.[03:02:34] <javabot> Por nada, pr3d4t0r.[03:02:38] <pr3d4t0r> ~smack dmlloyd[03:02:38] <javabot> smacks dmlloyd in the mouth[03:03:08] <dmlloyd> ah, so it's an indexing problem[03:03:11] *** docmorb has quit IRC[03:03:14] <dmlloyd> weird that it shows up twice :)[03:03:17] <pr3d4t0r> dmlloyd: I'd say parsing.[03:03:28] *** Z1mmy has joined ##java[03:03:44] <Z1mmy> http://pastebin.ca/1339614 - why wont this work[03:04:02] <dmlloyd> ~~ Z1mmy javascript[03:04:02] <javabot> Javascript has nothing to do with Java, just like sweet breads are neither sweet, nor bread. See ##javascript[03:04:16] <cheeser> ~javadoc Entry[03:04:22] <javabot> cheeser, too many results found. Please see your private messages for results[03:04:25] <dmlloyd> heh[03:04:28] *** CelticSoul has joined ##java[03:04:37] <cheeser> hahahaha. check that out dmlloyd[03:04:39] <dmlloyd> ~javadoc Entry[03:04:39] <cheeser> it's there.[03:04:40] <javabot> dmlloyd, too many results found. Please see your private messages for results[03:04:46] <dmlloyd> haha[03:04:47] <dmlloyd> nice[03:05:15] <cheeser> i'll have to tweak it to know about nested classes...[03:05:30] <cheeser> if they're not static, i'll have to retain Outer.Inner[03:05:39] <cheeser> or whoever patches that will[03:05:41] <cheeser> P^)=[03:05:44] <dmlloyd> aha[03:05:48] <cheeser> i'm busy writing fan code tonight.[03:06:04] <skypce> i need setText a jTextField of an JDialog from an JFrame, how do it please?[03:07:00] *** jnjackins has joined ##java[03:07:12] <cheeser> skypce: myField.setText("that was easy!");[03:07:14] <cheeser> ~next[03:07:14] <javabot> Another satisfied customer. Next![03:07:44] * pr3d4t0r is about to whip out a Panda.[03:07:53] <skypce> cheeser , myField dont is recognized[03:08:00] *** convivial has joined ##java[03:08:06] <skypce> for it is in another form[03:08:19] <pr3d4t0r> cheeser: Modality is getting in the way for panda boy.[03:08:52] *** jownez has quit IRC[03:11:02] <skypce> i put a import of my JDialog but dont work[03:11:38] *** cybereal has joined ##java[03:11:56] *** CelticSoul has quit IRC[03:15:29] *** aleksei has joined ##java[03:16:29] *** noobraska has quit IRC[03:16:37] <reverend> DON'T WORK[03:17:15] * cybereal boggles[03:19:10] *** flippo has joined ##java[03:20:58] *** alexbobp has joined ##java[03:21:53] <alexbobp> How can I add a byte to other numbers as if it were an unsigned byte?[03:22:02] <caverdude> sup cheeser[03:22:12] <cybereal> alexbobp: use int[03:22:26] <alexbobp> cybereal: even if I cast the byte to an int it's still negative[03:22:38] <cybereal> you need to and it[03:22:43] <cybereal> with 0xff I think[03:23:01] <alexbobp> then if my byte is already positive, won't it become negative?[03:23:08] <cybereal> no[03:23:13] *** Mehdi has quit IRC[03:23:17] <alexbobp> wait, I see[03:23:18] <alexbobp> thanks.[03:24:05] <cybereal> I think you can just cast to go back to byte[03:24:22] * cybereal forgets, it's been a while since he had to care[03:28:15] *** aceofspades19 has quit IRC[03:28:35] <alexbobp> thanks, it worked[03:28:49] <alexbobp> very odd workaround for a bad behavior, but at least I can get this done...[03:29:51] *** trooto has quit IRC[03:30:26] *** Tenac has quit IRC[03:30:30] *** traskbt has quit IRC[03:33:57] *** Adman65 has joined ##java[03:35:52] <Adman65> Hey, I'm trying to create a constructor with a filename argument. So ReservationSystem(file) which is a serialized version of an instance of ReservationSystem, but I cannot do this = loadSerializble (i know not the right code, but you get the point) What is the best way around this?[03:35:59] *** skypce has quit IRC[03:36:06] *** eduardopl has quit IRC[03:36:53] <dmlloyd> Adman65: use a factory method, not a constructor[03:37:09] <cheeser> Adman65: you can not ever assign this to anything[03:37:42] <Adman65> I see. I thought of creating a static method called load that returns a reservationSystem, but the factory method is more correct, no?[03:38:49] <dmlloyd> a static method would be a factory method if it makes something[03:39:19] <dmlloyd> "static method" being a concrete java term, "factory method" being more of a concept[03:40:43] <Adman65> i see[03:40:47] <cybereal> huh, the lead composer of the soundtrack for MGS4 is also the composer for the narnia movies[03:41:09] <cybereal> Adman65: are you just trying to obfuscate the normal java serialization process or what?[03:42:00] *** jordon has joined ##java[03:42:03] <Adman65> No, this is my first time playing with Serialization[03:42:21] *** Seldon75 has joined ##java[03:43:02] *** langenberg has quit IRC[03:43:05] *** Obeliks has quit IRC[03:46:57] *** UK-sHaDoW has quit IRC[03:47:05] *** scottyL has joined ##java[03:48:30] <scottyL> I'm writing a program which is actually a little complex, and I've never had formal training in writing something this complex. I can do it easily in spaghetti code, using minimal amounts of OOP, but I want to look at some examples of things that could show me how to better use Java[03:49:45] <scottyL> It's only likely to be around 5k lines, but I have been resorting to defining global variables so I can keep track of what state the program is in and keep track of important variables instead of passing things back and forth between many methods[03:50:49] <scottyL> Are there any programs you guys could think to show me which demonstrates good usage of Java in a program which offers a lot of functionality over several different "states" within the same JFrame?[03:51:00] *** thefalling has joined ##java[03:52:08] *** phyburn has joined ##java[03:52:20] <The_Birdman> what do you mean by states? which kind of application are you writing? A complex application is usually 50k lines of code an up imho, but of course you don't want 5k lines in the same file.[03:53:08] <scottyL> I wrote a program for my company which works on a PDA, it allows a user to go out in the field and take note of a bunch of information in a SQLite database[03:53:21] <scottyL> Information on blocks and businesses in downtowns[03:54:36] <kavon> what is the line limit of a class[03:54:37] *** ml` has joined ##java[03:54:39] <scottyL> Anyway, this program would serve to 1. finalize all data entry (merge concurrent databases from multiple PDAs, enter data not collected in the field, allow for people to check images taken against notes to ensure accuracy) and then 2. mine the data for statistics, to be displayed in either a graphical form or a text-based for[03:54:40] <scottyL> m[03:54:40] <The_Birdman> your states are managed inside panels or are you doing lots of custom drawing?[03:54:46] <scottyL> A lot of panels[03:54:54] <scottyL> Well, a number of panels reused[03:55:07] <scottyL> And just redrawn differently for each state[03:55:34] <scottyL> So, the merging database will likely have several options in the form of checkboxes and such[03:55:49] <scottyL> Meanwhile, the same totPanel will later house the very complicated data mining page[03:56:17] <phix> data mining :S[03:56:25] *** neuro_damage has joined ##java[03:56:27] <phix> have fun with that :)[03:56:33] <phix> neuro_damage: nice nick[03:56:47] <The_Birdman> you good start by introducing a kind of mvc into your app, model from the db, binding of view components, logic[03:56:47] <scottyL> heh, it isn't really data mining several million bits of data, but it is substantial to a small company[03:57:01] <The_Birdman> s/good/could[03:57:27] *** Adman65 has left ##java[03:57:33] <scottyL> Ok, that's kind of what I'm looking for. A direction to set this up[03:57:44] *** dblick has joined ##java[03:58:08] <scottyL> I'm pretty sure the real world doesn't have a global variable called "hierNum" which is 1 if we're combining databases, 2 if we're mining data, etc etc[03:58:17] <phix> The_Birdman: sed: -e expression #1, char 12: unterminated `s' command[03:58:33] * phix hides[03:58:35] * The_Birdman eyes phix :-), good looking out[03:58:45] <The_Birdman> :-)[03:58:50] *** rdancer has quit IRC[03:59:19] <phix> :)[03:59:27] <dblick> I am rather naive about JPA, but I'm getting really bad performance while querying a big table from a MySQL server that's also running on my desktop. Is there a better way to go through results than using x = EntityManager.createNamedQuery("MyClass.findAll"); for (MyClass i in x) { ... }?[03:59:33] <The_Birdman> scottyL: are you using an orm tool or lots of sql in the file?[03:59:47] *** LordMetroid has quit IRC[03:59:57] <phix> dblick: I stopped reading that sentence when I got to MySQL )[03:59:58] <scottyL> The_Birdman: Only thing I'm using is vim... a whole bunch of SQL queries, all hand written[03:59:59] <phix> :)[04:00:17] <phix> dblick: personally I use Hibernate[04:00:28] <dblick> phix, yes, I am using Hibernate/JPA[04:00:29] <phix> scottyL: ouch[04:00:35] *** SportChick has joined ##java[04:01:03] <scottyL> phix: It's really not that compicated of a program. It is only 5k lines or so, I just need to know how to properly set up a proper program[04:01:05] <phix> dblick: nice[04:01:09] <The_Birdman> scottyL: you could start by introducing hibernate to remove sql and organizing your code in terms of classes.[04:01:23] <The_Birdman> for a 5k program[04:01:28] <The_Birdman> hibernate is probably overkill[04:01:34] <The_Birdman> it's a small application[04:01:44] <phix> jdbc is probably overkill :)[04:01:48] <The_Birdman> hehe[04:01:59] <scottyL> heh, no, the database was definitely necessary[04:02:21] <dblick> so, iterating through huge result sets with JPA: anybody?[04:02:42] <The_Birdman> Well for only few lines of code a utility class for sql would be nice to have, to handle all the jdbc code, etc. mydbmodel, mydbcontroller, mainview, enum windowstate, etc.[04:02:53] <scottyL> dblick: Wish I could tell you, I am not familiar with that[04:02:58] <The_Birdman> scottyL: only you can organize the code :-)[04:02:58] <reverend> dblick: how much is 'huge' ?[04:03:32] <phix> dblick: scrollable resultsets?[04:03:39] <The_Birdman> dblick: you sure don't want to fetch everything in one shot...[04:03:50] <dblick> reverend, 43651342 rows[04:03:57] <The_Birdman> omg :-)[04:03:58] *** Varox has quit IRC[04:04:01] <reverend> haha, wtf[04:04:09] <reverend> why do you need all that at once?[04:04:44] <reverend> in short, no, surprisingly enough, there's no 'fast way' to iterate through 43M rows sequentially[04:04:51] <phix> hmmm is it a bad thing to have 160 lines ofcode in a constructor?[04:04:56] <dblick> i just need to avoid loading them all into memory[04:05:04] <cybereal> phix: depends on what they're doing[04:05:12] <cybereal> line count means nothing on its own[04:05:16] <reverend> dblick: that's the least of your problems[04:05:29] <cybereal> er I'd say it's ap rimary problem for him, actually[04:05:35] <scottyL> The_Birdman: Well, I'm trying to organize this the best I can.[04:05:39] <cybereal> especially with regards to using JPA to access that data[04:05:48] <phix> cybereal: setting up a class that extends JPanel, sets up listeneres (anonymous classes) and UI stuff[04:05:53] <cybereal> dblick: I would say that this is out of the realm of an ORM[04:06:02] <scottyL> Does anyone have any idea of where I could look to see a moderately complex example of good OOP code in Java?[04:06:17] <cybereal> dblick: that you should be doing dat analysis with data analysis tools or at least "closer to the iron" than that due to resources consumption and algorithm speed[04:06:18] <reverend> scottyL: the API[04:06:20] <scottyL> And by "moderately" I mean 5k or so :P[04:06:33] <phix> scottyL: java source :)[04:06:40] <phix> src.zip in JDK release[04:06:55] <The_Birdman> it's surely moderately complex :-)[04:07:02] <phix> :)[04:07:05] <scottyL> heh, wellllll, I suppose that's true[04:07:31] <cybereal> phix: a constructor should do one thing: prepare the object instance for usage. It sounds like you're doing more than that. It sounds like you need "two factor" construction which is, the real ctor sanity checks your data structure (instantiate must have mutable objects, set defaults, etc.) and then a second "initialize" or similarly named method would prepare the object, possibly even more than one method to prepare it before exec[04:08:07] <cybereal> scottyL: Jetty[04:08:11] <cybereal> ~jetty[04:08:11] <javabot> Jetty is an open-source, standards-based, full-featured web server implemented entirely in Java. See http://jetty.mortbay.org for more information.[04:08:25] <phix> cybereal: and should I call these init() methods in my constructor? :) or does that defeat the purpose of splitting it up?[04:08:43] <cybereal> phix: no, the code thats using the instance of that object would be invoking them as it needed to[04:08:55] <phix> cybereal: ok[04:09:28] <cybereal> any further customization to the process usually inspires the use of factories that take "profile" configuration but you probably don't need all that[04:09:30] <scottyL> Sort of like calling if (JTextFieldX == null) {initJTextFieldX();} kinda thing?[04:09:51] <cybereal> it's just good to keep the constructor doing its basic job because that can't be overridden and calling super constructors has differing semantics than calling virtual methods, etc.[04:09:59] <scottyL> Or initJTextField(JTextFieldX);[04:10:01] <cybereal> as well as reducing confusion when something breaks[04:10:11] <phix> ok[04:10:26] *** asap18 has joined ##java[04:11:01] <phix> cybereal: what are your vies on setting up UI / look and feel? is it possible to extend a system look and feel? or do I need to extend every abstract UI in swing?[04:11:18] <cybereal> you can create L&F's directly, but I've never done it[04:11:20] <phix> or should I do this with a init method?[04:11:30] <cybereal> I would imagine it is potentially possibly to extend an existing system one[04:11:42] <phix> cybereal: hmmmm, but oyu are not sure?[04:11:47] <cybereal> I've never tried it[04:11:59] <cybereal> ~laf[04:12:00] <javabot> see http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/index.html[04:12:02] <phix> I did google it and some sources said it wasnt a good idea to extend a system look and feel[04:12:08] <phix> cybereal: yeah I read that[04:12:39] <kavon> another one bites the dust[04:12:56] <phix> cybereal: I was interested in using synth (XML LAF to create "skins") however I need to specify all swing components I use in my code, it doesn't provide / use defaults :([04:13:09] *** pstickne has joined ##java[04:13:16] <cybereal> as far as how it relates to that prior question about constructors, I imagine the part related tos etting the L&F is a very small portion of that, and should go wherever you decide to put your GUI creation code (probably in a secondary initializer)[04:13:30] <cybereal> phix: sounds tedious[04:13:32] <phix> if anything I would like to use the windows LAF as a default and only pecofy the changeds I want to make[04:13:56] <cybereal> hm is the windows L&F available across platforms?[04:13:58] <phix> cybereal: to say the least[04:14:04] <phix> cybereal: no :([04:14:14] *** mesmer has joined ##java[04:14:16] <cybereal> that could be problematic :)[04:14:28] *** rullie has joined ##java[04:14:41] <phix> cybereal: although there the windows LAF project but I dont know if that extends the default widows look and feel[04:15:39] *** ramdam has quit IRC[04:15:49] *** staykov has joined ##java[04:15:53] * cybereal doesn't know[04:16:01] <cybereal> I've always been a fan of just using the system default laf[04:16:50] *** The_Birdman has quit IRC[04:16:53] <phix> conformist![04:17:04] *** ScottG489 has joined ##java[04:17:13] <cybereal> heh, I am one of those guys who appreciates system integration with software[04:17:37] <cybereal> which is probably why I basically never use java apps, and avoid web apps as much as possible, preferrint native apps to access web services, etc.[04:17:50] <cybereal> so when it comes to java, even though it's not 100%, I like to at least try to blend in[04:18:24] *** The_Birdman has joined ##java[04:18:41] *** mySQLnoob has joined ##java[04:19:25] <phix> cybereal: heh, what do you use java for then?[04:20:19] *** The_Birdman has quit IRC[04:20:44] <mySQLnoob> hello, i made this shell script called myscript to run my java program:[04:20:46] <mySQLnoob> #!/bin/bash[04:20:48] <mySQLnoob> java -cp . myprogram[04:20:49] <mySQLnoob> so when i do $myscript it runs fine.. but i need to send it with parameters and when i do $myprogram arg1 arg2 it doesnt take in the arguments... how can i fix it?[04:20:59] <cheeser> mySQLnoob: don't paste here[04:21:00] *** The_Birdman has joined ##java[04:21:01] <caverdude> cybereal I suppose you use JNI too huh? traitor![04:21:01] *** thepointer-work has quit IRC[04:21:07] <cheeser> mySQLnoob: and ask a linux channel[04:21:16] <thefalling> If i were to design a network game, should i just create a bunch of classes to handle game data/chat, and cycle through the objects in the server with if statements using instanceof?[04:21:24] <mySQLnoob> that's a java problem, no? my java program doesnt get the parameters[04:21:30] <caverdude> cheeser you didn't say hi to me man, I'm feeling left out of the group here[04:21:38] <caverdude> hehe[04:21:43] <cheeser> caverdude: i was away for a while[04:21:46] *** The_Birdman has left ##java[04:21:56] <unop_> mySQLnoob, java -cp . myprogram "$@"[04:22:05] <flippo> mySQLnoob, maybe you could try phrasing your question without all the scripting nonsense then.[04:22:25] *** waz has joined ##java[04:22:31] <mySQLnoob> unop_: thanks so much you're a life savior[04:22:33] <mySQLnoob> let me try it[04:23:12] <flippo> Heh. That's bash 101.[04:23:18] *** The_Birdman has joined ##java[04:23:28] <mySQLnoob> and yet you didn't know[04:23:36] <reverend> haha[04:23:58] <unop_> now now, this is ##java[04:24:02] <mySQLnoob> unop_: it work, thank you very very much[04:24:06] <cheeser> not knowing and choosing not to answer off topic questions are two vastly different things.[04:24:08] <unop_> :)[04:24:12] <flippo> mySQLnoob, yes, I did not know what question you were actually asking.[04:24:15] <mySQLnoob> i know but you don't have to be rude[04:24:29] <mySQLnoob> ok anyways it works, thank you very very much unop_[04:24:34] <unop_> yw[04:24:37] <cheeser> no one was rude.[04:24:38] <flippo> unlord, you're a good man.[04:24:44] <flippo> unop_, you too.[04:24:50] <unop_> ta[04:25:25] *** mySQLnoob has left ##java[04:25:28] <flippo> cheeser, I was rude. I admit it. I used the word "nonsense."[04:28:20] <cheeser> well, it was nonsense[04:29:56] <phix> unop_: $* :)[04:30:12] <unop_> phix, $* is not the same as $@ especially when quoted[04:30:35] <phix> yeah[04:30:37] *** Shirik has joined ##java[04:31:02] <phix> unop_: $@ seems too perl :P then[04:31:09] <flippo> Ahem.[04:31:29] <Shirik> Hi all. I have a JTextField that, upon pressing enter, I want to lose focus. Obviously the enter button is handled with an action event, but does anyone have a good idea on how to force it to lose focus? I don't see any methods in the API to do that, only to gain focus.[04:31:53] <unop_> phix, $@ in perl is something different .. it contains the error of the last eval() :)[04:32:05] <flippo> unop_, #bash loves this sort of thing. I'm there myself.[04:32:45] <phix> unop_: :D you are too good[04:32:47] <unop_> flippo, #bash loves perl? i think not :)[04:32:51] <optraz> in a method A, if we call another method, B and method B return fail, how do we handle it in method A?[04:32:57] <kavon> are all modern operating systems case sensitive when it comes to file names?[04:33:04] <kavon> specifically ones that run java[04:33:08] <flippo> unop_, (They love mocking perl, anyway.)[04:33:26] <unop_> kavon, it depends on the filesystem not the operating system[04:33:39] <kavon> modern file systems*[04:33:48] <unop_> ohh[04:33:55] <kavon> I know ones that run on Linux are[04:34:23] <AMcBain> Windows is still case insensitive.[04:34:27] <cheeser> how is this java?[04:34:27] <unop_> kavon, well, is FATXX modern by your taking? NTFS can be set to be case (in)sensitive[04:34:36] <optraz> in a method A, if we call another method, B and method B return fail, how do we handle it in method A?[04:34:45] <cheeser> return fail? what?[04:34:51] <The_Birdman> hehe[04:35:12] <caverdude> whats this www.freshmeat.net site about?[04:35:17] *** srcerer_ has joined ##java[04:35:21] <The_Birdman> optraz: you could ignore it in method A if the object is not essential to your logic[04:35:40] <The_Birdman> or you could catch some error and deal with it[04:35:47] *** ryakubo has quit IRC[04:36:22] *** asap18 has quit IRC[04:36:58] *** Woflborg has quit IRC[04:38:11] <optraz> The_Birdman: in method B, it return boolean, in method A , the return is void. but how do we exit / give some kind of error message?[04:38:59] <unop_> kavon, this might interest you - http://support.microsoft.com/kb/100625[04:39:08] <neuro_damage> phix: cheers, it's most of my life, heh[04:39:18] *** yclian has quit IRC[04:39:19] *** musically_ut has joined ##java[04:40:00] <The_Birdman> ~~optraz exceptions[04:40:00] <javabot> optraz, exceptions is http://java.sun.com/tutorial/essential/exceptions[04:40:02] <mesmer> I have a general java question: how do I control a do-while loop If the control variable I want to use is inside the body of the do-while?[04:40:10] <kavon> unop_: thank you that was helpful[04:40:30] <thefalling> If i were to design a network game, should i just create a bunch of classes to handle game data/chat, and cycle through the objects in the server with if statements using instanceof?[04:40:37] <kavon> unop_: i was distracted by wikipedia... i went from the page on NTFS to the Library of Alexandria somehow and was reading about that[04:40:43] <optraz> The_Birdman: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/branch.html, if it is void, use return;[04:41:41] <unop_> kavon, ahh, the tribulations of wikipedia :)[04:41:59] <The_Birdman> optraz: Instead of showing me the link, go read about exceptions and why you would want to use them, thank you[04:42:15] <phix> neuro_damage: I can relate too :P[04:42:16] *** ttmrichter_ has joined ##java[04:42:30] *** rullie has quit IRC[04:43:28] <optraz> The_Birdman: method B has no throw any exception but only return boolean. seems odd to me to catch the exception of boolean.[04:45:33] *** ttmrichter has quit IRC[04:47:08] <neuro_damage> phix: heh, but not with a name that can :)[04:47:25] *** tylo has joined ##java[04:48:16] <The_Birdman> optraz: don't misunderstand me, I am only trying to help but it's your issue. Telling me that it's odd doesn't help you solve your issue and I don't have one best, exact, complete and detailed solution for you.[04:48:44] <phix> neuro_damage: not as much as you[04:50:16] *** vinse has quit IRC[04:50:18] *** jbalint has joined ##java[04:50:45] <jbalint> is there a way to let the combobox have a new value entered when using JOption Pane and an array of choices/[04:51:09] *** waz has quit IRC[04:51:48] *** srcerer has quit IRC[04:52:26] <reverend> jbalint: sounds like a problem that could be solved with programming[04:53:17] *** Techdeck has joined ##java[04:53:39] <Techdeck> hey guys, do you know any tool that will let you get the HTML of a page like after the javascript on that page ran and updated the elements?[04:54:15] *** t0th_- has quit IRC[04:55:50] <dmlloyd> Techdeck: doesn't htmlunit do something like that?[04:56:13] <Techdeck> ohh, dunno it, lemme check[04:56:14] <dmlloyd> I seem to recall doing that in tests[04:56:28] <dmlloyd> I might have had to pull in another lib for the JS support[04:56:32] <dmlloyd> it was like 2 years ago :)[04:56:38] <Techdeck> awesome![04:56:46] <Techdeck> wow this looks like exactly what I need[04:56:48] <Techdeck> thank you dmead[04:56:51] <Techdeck> err, dmlloyd[04:56:55] <dmlloyd> :)[04:57:51] <phix> dmlloyd is great[04:57:57] *** gambler has quit IRC[04:57:59] <dmlloyd> ~hail dmlloyd[04:57:59] <javabot> All hail the mighty dmlloyd of dmlloydness![04:58:10] *** asap18 has joined ##java[04:58:14] <phix> dmead is mediocre )[04:58:25] <phix> :)[04:58:27] <dmlloyd> dmead is my nick-completion buddy![04:58:41] <phix> heh[04:58:56] <phix> I have 2 nick-complete buddies :D[04:59:05] *** gambler has joined ##java[04:59:18] *** raybr has joined ##java[05:04:10] <Techdeck> oh god dmlloyd, why didn't I know about this before?[05:04:12] <Techdeck> this is perfect[05:04:21] * dmlloyd shrugs[05:04:25] <dmlloyd> it's a nice little thing[05:05:25] *** neuro_damage has quit IRC[05:06:06] *** gambler has quit IRC[05:06:36] <raybr> hi guys, im using netbeans 6.5, i dont know how to create a jsf 2.0 project in it, can someone help please? I have jsf 1.2, how do i update my jsf implementation?[05:07:52] *** Gracenotes has quit IRC[05:08:02] *** ttmrichter_ has quit IRC[05:08:44] *** Gracenotes has joined ##java[05:08:49] *** caverdude has quit IRC[05:08:51] *** mesmer has quit IRC[05:10:16] *** ttmrichter_ has joined ##java[05:11:41] *** Seldon75 has quit IRC[05:13:18] *** gambler has joined ##java[05:14:02] <phix> raybr: NFI, I use wicket[05:14:08] <phix> wicket <3[05:14:52] <raybr> phix: wicket is cool i agree, but i have to do this for a small freelance project, and i am told to use jsf 2.0 for it[05:16:33] <cheeser> you were told use something that doesn't exist?[05:16:48] <cheeser> you have dumb bosses[05:17:16] <raybr> :([05:17:32] <kinabalu> haha[05:17:37] <raybr> it doesnt exist? i got jsf 2.0.9 in my glassfish[05:18:07] <raybr> using the update tool, but now i'm trying to figure out how to actually create a jsf 2.0 project[05:20:43] <raybr> if i get the jars from here : https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=9437&expandFolder=9437&folderID=0, create a library out of it, and use that instead of the jsf 1.2 library, would that work?[05:23:29] *** physique has joined ##java[05:23:39] <physique> anyone here understand quantum computing[05:24:01] <flippo> physique, how many channels are you going to spam with that silly question?[05:24:40] <physique> why is it silly again?[05:24:42] *** chap has joined ##java[05:25:02] <physique> explain to me, why its a silly question?[05:25:06] <physique> you know whats silly?[05:25:12] <physique> people like you[05:25:36] *** ChanServ sets mode: +o flippo[05:25:41] *** physique was kicked by flippo (flippo)[05:25:45] *** physique has joined ##java[05:25:53] <physique> oh fuck this place[05:25:55] *** physique has left ##java[05:26:09] <flippo> physique wins[05:26:13] *** ChanServ sets mode: -o flippo[05:31:43] <cheeser> very nice[05:37:50] *** Levia_ has joined ##java[05:38:44] *** Levia has quit IRC[05:39:15] *** riotz has quit IRC[05:39:54] *** Kwitschibo has quit IRC[05:41:39] *** pstickne has quit IRC[05:42:21] *** meanburrito920_ has quit IRC[05:42:45] *** tomvolek has quit IRC[05:45:16] *** aleksei has quit IRC[05:48:36] *** bhz- has joined ##java[05:49:37] *** The_Birdman has quit IRC[05:49:49] *** eradicus has joined ##java[05:50:29] *** woogley has joined ##java[05:51:09] *** jordon has quit IRC[05:51:48] *** waz has joined ##java[05:53:54] *** langenberg has joined ##java[05:57:18] *** raybr has quit IRC[05:59:22] *** Alterscapes has joined ##java[05:59:48] *** dblick has quit IRC[06:01:58] *** asap18 has quit IRC[06:02:04] *** Meshezabeel has quit IRC[06:02:22] *** casmo has joined ##java[06:04:33] *** rajesh has quit IRC[06:05:41] *** ryuho has quit IRC[06:07:06] *** tylo has quit IRC[06:08:46] *** Z1mmy has quit IRC[06:11:46] <phix> phyburn: I like to think I undestand quantum computering[06:12:13] <phix> lol oops, nick-complete friend :)[06:16:58] *** freeone3000 has joined ##java[06:17:19] *** langenberg has quit IRC[06:18:33] *** Kwitschibo has joined ##java[06:18:58] *** squi has joined ##java[06:19:50] *** Inc` has quit IRC[06:23:56] *** [[thufir]] has quit IRC[06:24:09] <cybereal> phix: I use java for servers, I don't do GUI apps with it[06:24:58] *** langenberg has joined ##java[06:25:52] <gambler> In Netbeans in there a way to change all variable modifiers to protected in a singel step? Search and Replace wont let me change them[06:26:05] <gambler> This is so that I can seperate my code from the Matisse[06:26:31] <thefalling> is there a way to get a bigger cursor than 32x32 in windows?[06:26:42] *** blankthemuffin has joined ##java[06:26:50] <thefalling> my code works fine in linux, but in windows the cursor is 32x32 :S[06:27:20] <AMcBain> probably an OS limitation/setting ... personally, I don't see why you'd want an excessively large cursor.[06:27:53] <cybereal> thefalling: nothing standard[06:28:00] <AMcBain> Java will attempt to set the cursor to the size of the image you give it for the cursor ... so if the OS limits, you can't fix that.[06:28:32] <thefalling> well im coding a battleship game and when i click a ship i make the cursor the ship[06:28:37] *** Alterscapes has quit IRC[06:28:42] <thefalling> i guess im gonna have to find a new way of doin it :S[06:28:57] <cybereal> thefalling: hide the cursor and draw the ship's sprite where the cursor would be yourself[06:29:14] <AMcBain> ... all I can say is "ew" to that ... why not show some kind of hilight around the list of ships or something.[06:29:24] <AMcBain> s/.$/?/[06:29:42] <thefalling> what do u mean AMcBain?[06:30:06] *** convivial has quit IRC[06:30:20] <thefalling> yeah thats probably what im gonna do cybereal[06:30:45] <AMcBain> well, there's got to be something less ugly and making the ship the cursor ... if this is for ship placement, I'd find it much easier to deal with the game higlighting the squares where I want my ship to be placed (with a normal cursor) and have it just show some kind of visual from a list of which ship I'm placing.[06:31:56] <thefalling> dunno how that would be ugly :S[06:32:32] <thefalling> but yeah i could do that too[06:32:35] <AMcBain> well, the cursor now has no defined "click" spot that I can easily identify as a user, it's now hard to know where it's going to be placed, etc. I can think of many reasons why I don't want a program to change my cursor.[06:33:09] <thefalling> true[06:35:45] *** bimbo has left ##java[06:37:17] *** radixor has joined ##java[06:37:55] *** traskbt has joined ##java[06:38:11] *** Junior has joined ##java[06:38:12] *** freeone3000 has quit IRC[06:38:36] <Junior> yello ;)[06:44:50] *** delskorch has quit IRC[06:45:00] *** tieTYT3 has joined ##java[06:45:53] *** traskbt has quit IRC[06:48:22] *** deepjoy has joined ##java[06:48:42] *** stixz has joined ##java[06:48:45] <unlord> flippo: thanks[06:48:52] *** vix85 has joined ##java[06:49:52] *** freeone3000 has joined ##java[06:49:59] *** bindaas has joined ##java[06:50:22] <stixz> i have this huge issue with the scanner[06:50:36] <stixz> System.in[06:51:01] <stixz> it will skip over some of the variables i set = to in.next();[06:51:32] <freeone3000> What do you mean, skip over?[06:52:10] <freeone3000> Also. System.in is an InputStream.[06:52:26] <stixz> right, i used Scanner in = new Scanner(System.in)[06:52:41] <stixz> by skip over i mean[06:53:08] <stixz> System.out.println("input line 1");[06:53:14] <stixz> line1 = in.nextLine();[06:53:24] <stixz> System.out.println("input line 2");[06:53:28] *** FireSlash has quit IRC[06:53:29] <freeone3000> Right. Cause when you print to the output stream, it's not printing to the input stream.[06:53:39] <stixz> line2 = in.nextLine();[06:53:42] <stixz> ??[06:53:55] <AMcBain> if you're going to paste code, use a pastebin. output and input streams are independent.[06:54:07] <stixz> im not pasting any code im typing right now[06:54:11] <stixz> for use as an example[06:54:32] <freeone3000> Which is probably going to be of less use.[06:54:34] <AMcBain> still a good idea to pastebin such a thing, as your "example" was longer than 2 lines ...[06:54:44] <stixz> alright[06:55:32] <stixz> well by skip over, i mean it skips from saying input line 1 straight to input line 2 without waiting for input for line 1[06:56:08] <AMcBain> can you provide us with a test case, so we can try it?[06:57:10] *** nvictor has joined ##java[06:57:32] *** nvictor has left ##java[06:57:35] <stixz> alright well my current project now i can have u test but it has 4 files[06:57:45] <stixz> do you want a zip or pastebin?[06:57:46] <AMcBain> uh, tha's why I asked for a testcase.[06:58:02] <AMcBain> ~~stixz testcase[06:58:02] <javabot> Provide complete, compilable Java source code for a SINGLE class that shows the problem and nothing else. Be as brief as possible. (See http://javafaq.mine.nu/lookup?364 for details and a HOWTO.)[06:58:39] <stixz> alright ill come up with one[06:58:41] <AMcBain> and in the process you might simplify it to the point where the bug is obvious or to where it starts to behave normally, and you know that the one of the lines you removed might be the cause.[06:59:31] *** tissue has quit IRC[07:00:28] *** JohnBat26 has quit IRC[07:02:05] *** casmo has quit IRC[07:03:16] <stixz> http://pastebin.com/d208858e6[07:06:08] *** amz has quit IRC[07:06:44] *** ridoo has joined ##java[07:07:14] <stixz> in that ^^ pastebin, i enter 1, then enter 2, and it skips the last one and finishes the program[07:07:21] <AMcBain> works here[07:07:25] <AMcBain> I can enter 1, 2, and 3.[07:07:42] <stixz> which ide are you using?[07:07:53] <AMcBain> It shouldn't matter ... on sec.[07:07:56] <AMcBain> one*[07:09:02] <AMcBain> works in Eclipse and via the command line.[07:09:57] <stixz> hmm doesnt seem to work in jcreator[07:10:43] <AMcBain> then you're doing something wrong, or jcreator is broken[07:11:13] <stixz> how do u compile by cmd?[07:11:20] <stixz> or[07:11:26] <stixz> ill just try dr java[07:12:15] <AMcBain> if it's already been compiled by jcreator, you can just use the cl to get to the directory just outside the package, and run "java path/of/pacakge/FileName"[07:12:27] <AMcBain> (assuming it compiles the class-file there)[07:12:56] *** freeone3000 has left ##java[07:14:05] <stixz> yea there are class files[07:14:15] <stixz> it works in drjava[07:14:33] *** josemoreira has quit IRC[07:14:44] <stixz> sucks that my teacher uses jcreator, so its not going to compile when she tests it[07:14:48] <stixz> i mean[07:14:53] <stixz> not going to function correctly[07:15:28] <AMcBain> uh ... I don't think any of my professors would touch anything less than eclipse with a 10-foot pole (unless it was straigh cl work)[07:16:15] *** tissue has joined ##java[07:18:21] *** Thorn has joined ##java[07:18:57] *** Junior has quit IRC[07:19:53] <jcp> Is there a channel related to discussion on java not specifically related to help?[07:20:08] <AMcBain> that sometimes happens here[07:20:09] <stixz> #java @ efnet[07:20:29] <jcp> what's efnet's address?[07:20:34] <stixz> irc.efnet.org[07:20:37] <AMcBain> though I occasionally push for people to take discussions to ##java-talk , it's only happend once or twicee.[07:21:31] *** waz has quit IRC[07:21:52] <stixz> AMcBain: i still have the problem unfortunately[07:21:52] *** Bevin has joined ##java[07:22:03] <stixz> even in DrJava which had worked on the testcase[07:22:04] <t3mp3st> I have two main groups of subclasses of a class (class Variable -- [scalar subclasses], [compound subclasses]). I'd like to determine if a particular subclass instance is a scalar: would the best way be to require each subclass to define a isScalar() method? Or would it be best to tag each scalar subclass with a ScalarVariable/CompoundVariable interface and depend on dynamic dispatch to do the "right thing" based on the runtime type?[07:22:11] <t3mp3st> essentially, is it better to do something like ((Variable)v).isScalar() vs. someFunction(v) where there is defined someFunction(ScalarVariable v) and someFunction(CompoundVariable v)[07:24:55] *** yclian has joined ##java[07:26:10] *** Junior has joined ##java[07:27:14] *** m0 has quit IRC[07:27:49] *** seecoderun has joined ##java[07:28:19] <seecoderun> hey can any1 tell me why i get an exception when i initialize my interface to Null[07:28:32] <seecoderun> ie Measurer is type interface[07:28:39] *** ChanServ sets mode: +o pr3d4t0r[07:28:43] <pr3d4t0r> seecoderun: It's "anyone"[07:28:51] <seecoderun> cool[07:29:00] <pr3d4t0r> seecoderun: Fix your keyboard if you want help in the channel, and please read the /topic.[07:29:12] <pr3d4t0r> seecoderun: Check out the http://javachannel.net wiki as well.[07:29:37] <seecoderun> wow, i just need help, and you're gonna correct me on my grammar?[07:29:47] <pr3d4t0r> seecoderun: Channel rules, so yes.[07:29:52] <seecoderun> fuck this[07:29:57] *** seecoderun has quit IRC[07:30:05] <hiredman> Nice.[07:30:35] <nekrozion> hihi[07:31:40] *** reval has joined ##java[07:32:09] <reval> can someone tell me why it gives me this weird output? http://www.pastie.org/391478[07:34:17] *** m0 has joined ##java[07:35:55] <hiredman> reval: you should provide a toString method for Entry[07:36:03] *** morkar- has joined ##java[07:37:36] <hiredman> (my java is very rusty) but I believe what you are seeing is Object's toString, so if you want output that makes sense you need to override it[07:40:07] *** bas-i has joined ##java[07:40:25] <reval> hiredman: thx, i think that fixed it[07:41:06] *** phyburn has quit IRC[07:41:26] *** Levia_ has quit IRC[07:43:35] *** JohnBat26 has joined ##java[07:46:29] *** yclian has quit IRC[07:46:32] *** t3mp3st has quit IRC[07:46:50] *** t3mp3st has joined ##java[07:47:41] *** kavon has quit IRC[07:49:32] *** yclian has joined ##java[07:50:12] *** eradicus has quit IRC[07:51:47] <t3mp3st> I want to determine if an instance is tagged with a particular interface; is the right way to do this to have two methods, one accepting the superclass and the other accepting a subclass implementing the interface?[07:52:07] <t3mp3st> (the first would return false; the second would return true)[07:52:18] *** vix85 has quit IRC[07:53:56] <m0> just implement the interface[07:54:21] <m0> and use 'instance of'[07:55:14] *** eradicus has joined ##java[07:55:37] <t3mp3st> m0: is not instance of evil?[07:56:10] <t3mp3st> and/or slow?[07:57:00] <hiredman> seems like using instance of would just be re-implementing java's method dispatch[07:57:52] <t3mp3st> hiredman: this is what I am worried about -- is the idomatic way to utilize method dispatch to distinguish types? Or for simple methods like "isScalarSubclass()", is it just as legit to throw in an instanceof[07:58:41] *** sebr is now known as sebr_afk[07:58:47] <hiredman> I am not sure[07:58:54] <cybereal> t3mp3st: the way to find out of an instance is compatible with a type is to use instanceof[07:59:16] <hiredman> I would not be surprised if there are lot people using instance of[07:59:21] <cybereal> anything else and you should've written the code such that it didn't matter[07:59:50] *** Ringtailed-Fox has joined ##java[07:59:59] <Ringtailed-Fox> hiya. i'm trying to figure out where java typically installs itself to[08:00:02] <Ringtailed-Fox> is it /usr/java?[08:00:14] <cybereal> it doesn't install itself on linux[08:00:17] <cybereal> at all[08:00:24] <cybereal> you do or your distro package manager does[08:00:33] <cybereal> and it seems every distro variety has their own preference[08:00:34] *** convivial has joined ##java[08:00:35] *** deca has quit IRC[08:00:40] <t3mp3st> cyberreal: sure -- I'm building a mini type system and at one point in my code, I'd really to interrogate the "type" of my representations. For most of this, I use the Visitor pattern; occasionally, I need to have a "type map" of meta data. I'm just trying to figure out the best way to implement this type map[08:00:52] <cybereal> /usr/java /usr/share/java /usr/jvm etc. etc.[08:00:55] <Ringtailed-Fox> i used my package manager (urpmi)[08:00:59] *** tissue has quit IRC[08:01:01] <Ringtailed-Fox> hmm[08:01:02] <t3mp3st> I've been struggling to find the "right" javaish way to do this[08:01:05] <cybereal> Ringtailed-Fox: just use find and get on with life[08:01:13] <Ringtailed-Fox> o.O[08:01:14] *** Hail_Spacecake has joined ##java[08:01:21] <Ringtailed-Fox> rudeness gets you nowhere with me[08:01:21] <Hail_Spacecake> question involving type casting[08:01:33] <cybereal> Ringtailed-Fox: fuck if I care where it gets me, you came asking not the other way around[08:01:41] <Hail_Spacecake> I know if you have a variable of an object type that is a subclass of another, and you want to use subclass-only methods[08:01:46] <Ringtailed-Fox> get off my internet[08:01:49] <Hail_Spacecake> you have to do something like[08:01:49] <Ringtailed-Fox> :P[08:01:54] <cybereal> moron[08:01:58] <Ringtailed-Fox> lol[08:02:04] <Ringtailed-Fox> i want to see how quickly you get banned.[08:02:13] <t3mp3st> <-- knows where this is going[08:02:14] <cybereal> hope you have a long wait[08:02:22] <cybereal> long time to wait, that is[08:02:23] <Hail_Spacecake> Superclass x = someObj; Subclass y = (subclass) x; y.subclassOnlyMethod()[08:02:23] <Ringtailed-Fox> not really, with how quickly you start swearing[08:02:34] <cybereal> Ringtailed-Fox: k, just keep watching[08:03:05] <Hail_Spacecake> but can I declare x a Superclass when I initialize it and then cast it to the subclass later without making a new variable?[08:03:21] <cybereal> Hail_Spacecake: no[08:03:57] *** Wicked has joined ##java[08:04:20] *** tomvolek has joined ##java[08:05:53] <cybereal> Hail_Spacecake: if you need the subclass you should probably use that type to begin with[08:09:29] *** bas-i has quit IRC[08:09:37] *** tissue has joined ##java[08:09:48] *** bas-i has joined ##java[08:09:52] *** xabbuh has joined ##java[08:11:01] *** epalm has quit IRC[08:11:17] <cybereal> Ringtailed-Fox: still holding your breath?[08:11:45] <Ringtailed-Fox> nope. just waiting for you to leave. you love to keep trouble going, don't you[08:12:09] <cybereal> heh, hey you're the noob who doesn't realize I'm a regular, not the other way around[08:12:28] <Ringtailed-Fox> why should that matter?[08:12:36] <Ringtailed-Fox> and don't call me a noob, noob. i've been using linux since 1997[08:12:41] <cybereal> I guess you're new to irc too[08:12:50] <Ringtailed-Fox> been using that since the same year[08:13:00] <Ringtailed-Fox> again, why should that matter?[08:13:11] <cybereal> then it's sad that you haven't caught on to social patterns after this long[08:13:11] *** ryuho has joined ##java[08:13:20] <Ringtailed-Fox> i don't change for others.[08:13:29] <cybereal> nobody cares about you or your changing here[08:13:41] <Ringtailed-Fox> and yet you think you're so popular and important?[08:13:52] <cybereal> just enough that I'm not going to get banned for swearing at you[08:14:31] <Ringtailed-Fox> why are you so cocky? you were shoved head-first through someone's vagina at one point in life[08:14:42] <hiredman> ##java does not strike me as a channel where you get banned for swearing[08:14:48] <cybereal> hiredman: indeed[08:14:53] <cybereal> hiredman: unless you get carried away perhaps[08:14:54] <Ringtailed-Fox> hiredman: apparently you can do whatever you want and get praised for it[08:16:44] *** Resistance has quit IRC[08:16:52] <hiredman> yeah ##java is a terrible place, you'd better leave and find somewhere better[08:16:53] *** Resistance has joined ##java[08:17:11] *** arpu has quit IRC[08:17:14] <cybereal> agreed[08:17:51] <svm_invictvs> eh?[08:18:09] <cybereal> svm_invictvs: just harassing an assumptive newbie, you know, the usual[08:19:01] <Ringtailed-Fox> you know... a self-proclaimed "guru" wanting to increase his e-dick size by harassing newcomers[08:21:35] *** yclian has quit IRC[08:21:55] *** ridoo has quit IRC[08:27:18] <eradicus> wants to have an e-dick[08:28:55] *** eradicus has left ##java[08:29:40] <optraz> Duplicate modifier for the method[08:29:55] *** tomvolek has quit IRC[08:29:58] <optraz> what does that means?[08:30:10] <cybereal> means you put the same modifier twice I imagine[08:30:15] *** reval has quit IRC[08:30:17] <cybereal> pastebin your code along with the error don't make us guess[08:30:35] <optraz> what is "same modifier" ?[08:31:10] <cybereal> sorry this is ##java not #english, I'm not sure how to teach you the grammar of my spoken language[08:31:51] <optraz> http://www.javacamp.org/javaI/Modifier.html[08:31:52] <cybereal> optraz: maybe if you actually pastebin your code and error, someone could be of more help[08:32:29] <cybereal> yes those are various modifiers[08:32:37] <optraz> cybereal: not possible as this is company source code[08:32:41] <cybereal> you probably have one of those for one method listed twice in your code[08:32:54] <cybereal> optraz: then you have all the answer you can hope to get here[08:34:48] <svm_invictvs> grumble, my server got hacked[08:37:55] *** yclian has joined ##java[08:37:56] *** gdoko has joined ##java[08:39:03] *** dpy has joined ##java[08:41:03] <jnjackins> say x has type Object. is there any way to say: if(x is an Integer) { do something; }[08:43:02] <Shirik> x instanceof <type>[08:43:15] <Shirik> x instanceof Integer, for example[08:43:26] *** langenberg has quit IRC[08:45:13] <jnjackins> perfect, thanks![08:47:27] <thefalling> Im tryin to implement a custom cursor by just using a JLabel with an image on it, how do i set the JLabel to always be on top. So if i move it where another widget is, it is painted on top?[08:49:37] *** drtroll has joined ##java[08:55:31] *** Partyzant has joined ##java[08:56:06] *** TheCastor has joined ##java[08:58:42] *** jcp has quit IRC[08:59:12] *** Angel-SL has joined ##java[09:00:23] *** thpar has joined ##java[09:00:28] *** boringwall has quit IRC[09:00:46] *** thefalling has quit IRC[09:01:02] *** kibibyte has joined ##java[09:02:44] *** Zemich has joined ##java[09:03:00] *** shadewind has joined ##java[09:03:25] *** W_work has joined ##java[09:03:40] *** skoskav has quit IRC[09:03:41] *** ldamwork has quit IRC[09:03:53] *** gtapsycho has joined ##java[09:04:31] *** bindaas has quit IRC[09:05:03] <W_work> Is there a good reason why this code does not compile? http://www.papernapkin.org/pastebin/view/4463/[09:06:06] <W_work> the error is "variable firstByte might already have been assigned"[09:06:35] <W_work> but as far as I can tell, the final operation there is the assignment, and that may never throw IOException, and as such it /can't/ be initialized in the catch[09:07:19] *** skoskav has joined ##java[09:07:29] <svm_invictvs> grumblefuck[09:07:42] *** Resistance has quit IRC[09:07:44] <dangertools> W_work: i guess there may be other exceptions, not caught by IOException[09:07:48] *** jnjackins has quit IRC[09:07:56] <svm_invictvs> URLSyntaxException, no?[09:08:02] <dangertools> W_work: in such a case, firstByte isn't assigned[09:08:06] <W_work> http://www.papernapkin.org/pastebin/view/4464/ fails as well[09:08:28] <W_work> dangertools: so? I never use it outside the try...catch clause[09:08:59] <dangertools> well, it's final. and in its scope it may not have been assigned[09:09:04] <svm_invictvs> dangertools: If another exception it thrown it shouldnt' even reach any of hte lines following the catch block.[09:09:08] *** mele- has quit IRC[09:09:11] <W_work> oh wait yes I do[09:09:24] <W_work> anyway, that doesn't change the compile error[09:09:24] <svm_invictvs> oh yeah[09:10:01] <svm_invictvs> I don't see why it shouldn't compile[09:10:07] <W_work> mm, indeed[09:10:24] <svm_invictvs> What compiler?[09:10:28] <W_work> sun[09:10:32] <W_work> 1.6[09:11:14] <cybereal> W_work: final is serious business, the semantics take a safest bet route to determine this[09:11:14] *** Resistance has joined ##java[09:11:43] <W_work> cybereal: you mean it can't figure out all the code paths, and thus just gives an error?[09:11:52] <cybereal> yeah it doesn't descend very far at all[09:11:52] <svm_invictvs> No, that should be valid code.[09:11:58] <W_work> because even being 100% paranoid and overly safe, that should compile[09:12:01] *** linxuz3r has quit IRC[09:12:14] <W_work> (assuming the exceptions' code paths are analyzed correctly)[09:12:18] <cybereal> and if (false) whatever(); shouldn't compile but it does[09:12:27] <svm_invictvs> If a runtime exception wont' even reach teh assignment or anything else.[09:12:31] *** kungen has joined ##java[09:13:20] <svm_invictvs> if URL's constructor fails, or openStream fails, or read fails resulting in any unchecked type, the subsequent code wont' be executed so is irrelevant if firstByte is initialized.[09:13:35] <svm_invictvs> And my fucking neighbors are being annoyin as fuck.[09:13:37] <cybereal> And I'm telling you that the compiler doesn't look that deeply[09:13:49] <W_work> cybereal: that's wierd - I thought it caught up on that? It correctly analyses "while(true){}"[09:13:59] *** deepjoy has quit IRC[09:13:59] <cybereal> W_work: exactly, it's not flawless[09:14:10] <cybereal> javac could easily be improved upon in numerous ways it's just not[09:14:18] <cybereal> so the answer is: work around it, and move on[09:14:45] <W_work> ok, so to answer my original question - no, there's no good reason, beyond lack of resources or focus among the compiler developers, why I should not get to compile it[09:15:01] <cybereal> in the second version, no[09:15:07] *** deepjoy has joined ##java[09:15:07] <cybereal> even the first really[09:15:33] <cybereal> the only possible explanation I could understand is the bytecode being optimized to be something beyond what you expect based on your code but having the same ultimate result[09:15:51] <cybereal> and the ability to make that optimization requires a looser check on this case[09:15:54] <svm_invictvs> ugh[09:15:59] <svm_invictvs> It should still work...[09:16:04] <W_work> well, optimizations should never change functionality[09:16:17] <cybereal> expectations allow optimization[09:16:24] <svm_invictvs> Man that pastebin sucks.[09:16:28] <W_work> optimizations should not change my expectations[09:16:34] <W_work> and yes, I realized that as well svm_invictvs[09:16:49] <cybereal> And W_work, what gives you the idea that you should've had this expectation, did you internalize the entire JLS?[09:16:54] <cybereal> maybe the JLS specifies this behavior[09:17:07] <W_work> I think I have a fairly good grip on it, yes[09:17:28] <W_work> but I do make mistakes, so I wanted a second opinion, which I now have[09:17:50] <cybereal> I'm not suggesting this reasoning is right or good just that it could be one possible reason that this is the case[09:17:53] <svm_invictvs> This shoudl work...[09:18:33] *** chetnick has joined ##java[09:19:58] <svm_invictvs> W_work: take out the final?[09:20:09] <W_work> the end result is that I can't use final if the initialization involves a try...catch[09:20:25] <svm_invictvs> that's kind of stupid.[09:20:45] <W_work> I'll just wrap the ugliness in a method and comment it[09:20:52] <chetnick> hi, i am taking introductory JAVA course. I am working on some lab. How do i read and store char input from the user. Something equivalent to "double value = input.nextDouble();" What would be equivalent for "char" ?[09:20:52] <svm_invictvs> Or just non-final?[09:21:01] *** bas-i has quit IRC[09:21:21] <svm_invictvs> W_work: I guess if you had firstByte = 1; at the top of the catch block then that would be valid and it's not smart enough to tell the difference.[09:21:26] <svm_invictvs> Ugh, this is why I like C++ const.[09:23:04] <W_work> chetnick: what is "input"?[09:23:17] <svm_invictvs> System.getConsole()[09:23:36] <chetnick> Scanner input = new Scanner(System.in);[09:23:36] <svm_invictvs> Like, from stdin?[09:23:40] <svm_invictvs> oh[09:24:08] *** Levia has joined ##java[09:24:25] <W_work> chetnick: then use tokens[09:24:46] <W_work> in this case, set a delimiter that separates each character into a token[09:25:07] <W_work> (ie just use input.next())[09:25:13] <svm_invictvs> W_work: You know sometimes I really hate javac's static analysis.[09:25:22] <cybereal> W_work: the jls explains that in order for a var to be definitely unassigned before a catch block it has to be definitely unassigned after the try block, and since in both of your cases it could've possibly been assigned it's not definitely unassigned... it doesn't correlate the exception types or any of that[09:25:25] <W_work> svm_invictvs: it's brilliant when it works[09:25:32] <svm_invictvs> W_work: some things ought to be warnings taht are errors.[09:25:55] <chetnick> W_work: i tried that input.next() i get some errors[09:26:11] <W_work> cybereal: do you have a direct link?[09:26:17] <W_work> that's... interesting[09:26:23] <cybereal> no, but it's chapter 16.2.15[09:26:59] <chetnick> required: char[09:26:59] <chetnick> subPackage = input.next();[09:27:02] <W_work> chetnick: understand what I said instead of copying my instructions blindly[09:27:02] <svm_invictvs> Like, while(false){}...[09:27:08] *** melter has quit IRC[09:27:10] <svm_invictvs> Why isn't that a warning?[09:27:19] <chetnick> i already tried that before you told me ...[09:28:25] *** melter has joined ##java[09:28:26] <svm_invictvs> fuck[09:28:50] <chetnick> never mind i will figure it out eventually. Thanks.[09:29:01] *** bindaas has joined ##java[09:29:41] <W_work> chetnick: I bet you didn't[09:30:07] <svm_invictvs> W_work: I should take you to Vegas :-P[09:30:16] <chetnick> You will lose the bet! :)[09:30:44] *** chap has quit IRC[09:30:45] <W_work> chetnick: your example belies it[09:30:47] *** JustinLei has joined ##java[09:30:51] <svm_invictvs> heh[09:31:16] <svm_invictvs> Scanner s = new Scanner(System.in); s.useToken(...)[09:31:16] <W_work> you didn't even understand what I said about setting the delimiter, did you?[09:31:23] <trustin> Is Thread.interrupt() the only one which triggers an InterruptedException? (except for 'throw new InterruptedException()' :) Can O/S or other non-Java processes trigger InterruptedException?[09:31:44] <svm_invictvs> trustin: Library code may trigger an interrupted exception.[09:31:48] <chetnick> W_work: i didnt.[09:32:06] <W_work> chetnick: so how can you say that you've tried what I suggested?[09:32:07] <svm_invictvs> trustin: which would be likely be calling Thread.interrupt()[09:32:37] <svm_invictvs> trustin: I don't think so, but why do you ask?[09:32:43] <trustin> svm_invictvs: sure. My question is if it is the only way to trigger it. Can O/S or other non-Java processes trigger InterruptedException?[09:33:22] <W_work> trustin: why not just explain your problem, and we can help you with that, instead of trying to prove a negative?[09:33:33] *** ldam has joined ##java[09:34:08] <trustin> svm_invictvs: Long time ago, pressing CTRL+Z and typing fg again for a Java process caused an InterruptedException. I'm just not sure it's a bug that has been fixed now because I'm not seeing such a behavior.[09:34:58] <W_work> I'm fairly certain that would be JVM dependent, if it's used[09:35:02] *** chetnick has quit IRC[09:35:13] <svm_invictvs> trustin: If it was a documented bug, then I'd check the bug tiself.[09:35:28] <cybereal> ~jls[09:35:29] <javabot> cybereal, jls is The Java Language Specification: http://java.sun.com/docs/books/jls/[09:35:57] <trustin> svm_invictvs: W_work: if InterruptedException can be triggered by an external factor then I can't rely on it without a boolean flag.[09:36:00] <svm_invictvs> trustin: I seem to recall taht Thread.interrupt() was implemented in Java code 100%[09:36:25] <W_work> trustin: and you shouldn't, independent of that[09:36:37] <W_work> because third party code might interrupt your thread outside of your control[09:37:09] <trustin> W_work: that sounds right and it could be called as an external factor. Thanks[09:37:18] *** Resistance has quit IRC[09:37:26] <cybereal> ~javadoc Thread.stop()[09:37:28] <javabot> cybereal: http://is.gd/jNj4 [java.lang.Thread.stop()][09:37:30] <svm_invictvs> trustin: I said that earlier, Library code may call Thread.interrupt()[09:37:44] *** blankthemuffin has quit IRC[09:37:48] <cybereal> trustin: http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.8.3[09:38:36] <cybereal> trustin: wondering if some <insert imaginary third party component here> can call .interrupt() on your thread is stupid, of course it can happen, why couldn't it?[09:38:53] <trustin> cybereal: yes I know, but it doesn't tell me something outside JVM can interrupt the JVM thread to trigger InterruptedException.[09:39:01] <cybereal> trustin: it's true you should *NOT* rely on it having been caused by a specific source[09:39:11] *** Spike1506 has joined ##java[09:39:11] <cybereal> trustin: the jvm can do whatever it wants[09:39:47] *** ldamwork has joined ##java[09:40:35] *** Corinna000 has quit IRC[09:40:51] <svm_invictvs> I do what I want. You ain't the boss of me.[09:41:35] <cybereal> trustin: trying to figure out if it can be caused by <infinite set> things is a waste of your time when you have the far finer inverse definition of the situation already[09:42:19] <svm_invictvs> Why would the jvm throw an interrupted exception, though...[09:42:27] <svm_invictvs> if it was suspended[09:42:32] * cybereal shrugs[09:42:44] <cybereal> implementation detail, maybe someone thought it was appropriate for unixy reasons[09:43:01] <trustin> cybereal: yes. makes sense. I was over-curiosified temporarily. :)[09:43:27] <cybereal> trustin: the only way to really salve your curiosity, and I stress that you shouldn't rely on what you find remaining true, is to read the source to the jvm of question[09:44:16] *** Woflborg has joined ##java[09:44:19] *** defenderBG has joined ##java[09:44:21] *** deepjoy has quit IRC[09:44:25] <defenderBG> ~sax[09:44:25] <javabot> defenderBG, sax is Simple API for XML and some info is at http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/sax/[09:44:26] <cybereal> lots of outside influences might show up that you never knew about, like... imagine someone having written code relying on InterruptedException prior to jmx showing up and years later that code's runnign alongside updated MBean controlled code that invokes .interrupt() in response to a remote query or something heh[09:44:43] *** Zemich has quit IRC[09:45:17] *** woogley has quit IRC[09:46:42] <cybereal> svm_invictvs: oh maybe it's to disconnect stdio?[09:47:15] <svm_invictvs> that would do it...but I think you'd get an InterruptedIOException, right?[09:47:24] *** yclian has quit IRC[09:47:45] <cybereal> er I've never heard of it[09:47:48] <cybereal> ~javadoc InterruptedIOException[09:47:49] <javabot> cybereal: http://is.gd/jNls [java.io.InterruptedIOException][09:48:20] <cybereal> svm_invictvs: I'd say "yes" if it's in the I/O call, but not if it isn't[09:48:29] <svm_invictvs> You mentioned stdio[09:48:45] <cybereal> right, I didn't say it would check that the threads are all using stdio before interrupting[09:48:54] <cybereal> I'd assume the simplest approach would be interrupt all the threads[09:48:57] <svm_invictvs> Either way, both exceptions are checked, so throwing them spuriously would definitely be a bug.[09:49:05] <cybereal> "kill 'em all, and let god sort 'em out"[09:49:12] *** agnul has joined ##java[09:49:17] <cybereal> it wouldn't be spurious at all[09:49:21] <svm_invictvs> Your code would have to be expecting it.[09:49:24] <cybereal> it would be[09:49:33] <cybereal> calling .interrupt() on a thread in a case where it's not interruptable has no effect[09:49:39] <svm_invictvs> oh yeah[09:49:41] <svm_invictvs> duh[09:49:59] *** JustinLei has quit IRC[09:50:02] <W_work> you're both right of course[09:50:55] <cybereal> svm_invictvs: anyway it would be a valid explanation, though I've no idea if it's true :) I've never seen this behavior[09:52:18] *** Spike1506 has quit IRC[09:52:19] *** shadewind has quit IRC[09:52:56] <svm_invictvs> fuck[09:52:58] <svm_invictvs> This blows[09:53:03] <svm_invictvs> My server went dead last night.[09:53:09] <svm_invictvs> er, earlier tonight.[09:53:12] <svm_invictvs> All muy SVN[09:53:48] *** Junior has left ##java[09:54:03] *** blankthemuffin has joined ##java[09:55:14] *** ldam has quit IRC[09:57:27] *** Levia has quit IRC[09:57:36] <ldamwork> svm_invictvs, can't be that bad; I had a 4x400mb disc raid5 where 2 drives failed simultaneusly...[09:58:13] <ldamwork> ...luckily i could recover because the bad sectors were different on the two faulty drives :)[09:58:30] <cybereal> ldamwork: did you see google's study on drive failure?[09:58:31] *** dnmo has joined ##java[09:58:38] <cybereal> ldamwork: apparently what you experienced is surprisingly common[09:58:46] * ldamwork learned to have an uptodate backup from this event[09:58:58] <cybereal> yeah, the real tragedy is people thinking raid is an alternative to a proper offline backup[09:59:09] *** isr` has joined ##java[09:59:23] <isr`> man, chimps are terrifying[09:59:23] <ldamwork> yeah, i guess so when you use same type of drives :/[09:59:49] <cybereal> usually they're really close or even sequential serial numbers which means they'll have a much higher chance of sharing a defect[10:00:10] <isr`> heh[10:00:14] <cybereal> temp in the factory was a bit high that day or too much dirt in the air or whatever :) hehe[10:00:25] <ldamwork> yeah, or at least same 'window' of mtbf's[10:00:28] <W_work> yeah we've experienced the same[10:00:46] <cybereal> the upside of the study was that no particular brand has a better track record or a worse one[10:00:50] <W_work> once one drive in a server fails, others are already marginal, and the first failure triggers a second or even a third[10:00:56] <cybereal> but I swear every IT nerd has his favorite brand and least favorite brand[10:01:04] <isr`> lol[10:01:11] <isr`> i hear seagates are pretty good[10:01:12] <cybereal> I know one guy who will simply never use WD[10:01:27] <isr`> i have a WD external[10:01:32] <isr`> its never given me a problem[10:01:34] <cybereal> and it's funny because I've had WD's my entire computing life and they've been the most resilient heh, just all luck apparently[10:01:46] <svm_invictvs> I have offline backups.[10:01:55] <ldamwork> had a seagate that failed on me, 4 weeks after buying. Got it replaced though easily, but had to redo an installation :/[10:01:57] <svm_invictvs> The problem is that they're a little old.[10:02:01] <cybereal> isr`: well with externals you have the drive to worry about but you also have the generally very low quality USB/Firewire/eSATA controllers[10:02:10] <cybereal> those are usually what fail, and they can lead to drive failure too[10:02:13] <svm_invictvs> A few weeks ago the cron job started failing and I called the provider...[10:02:20] <W_work> svm_invictvs: your backup procedure is only as good as the amount of grief it prevents if it has to be used[10:02:21] <isr`> cybereal: yeah i have USB on that one[10:02:34] *** KikiJiki has joined ##java[10:02:36] <svm_invictvs> I asked him to set up his on-site backups and we just never got around to getting his up and running.[10:02:45] *** vesz has joined ##java[10:02:53] <svm_invictvs> W_work: a 3 year old svn repository?[10:02:54] <isr`> I need to do some backups[10:03:01] *** gregor_k has joined ##java[10:03:03] <isr`> i'd like to back up my music on dvd's[10:03:07] <isr`> theres a lot of it though[10:03:18] <cybereal> isr`: we had a WD MyBook with firewire and usb, and it "failed" on this guy, he started telling me about his loathing for wd, then I plugged in the USB and it worked fine... I explained how they are separate controllers and the firewire400 are famous for sucking ass across the board since so few people use it[10:03:23] * cybereal loves crushing peoples dogmas[10:03:35] <cybereal> ugh I have 850gb of data that needs a backup[10:03:42] <isr`> yeah, mine doesnt even have firewire, just usb2[10:03:47] <tazle> ~jsr310++[10:03:47] <javabot> jsr310 has a karma level of 1, tazle[10:03:50] <svm_invictvs> cybereal: It has raid.[10:04:01] <isr`> cybereal: yeah, i dunno how i'm going to back up all of my data[10:04:02] <svm_invictvs> But, in addition to RAID I wanted to have offline backups.[10:04:06] <isr`> gonna be a lot of dvd's[10:04:21] <cybereal> isr`: I'm considering getting a bluray burner for this[10:04:30] <isr`> christ really?[10:04:37] <isr`> how much are those right now?[10:04:39] <cybereal> I did a backup before I ripped 464 DVD's and that took over 70 dvd's to back up[10:04:47] <cybereal> I'm not going to even calculate 850gb worth to go to dvd[10:04:54] <cybereal> isr`: couple hundred I think[10:04:54] <isr`> wow[10:05:01] <cybereal> single layer disks are like 25gb each[10:05:08] <cybereal> a lot less disk swapping[10:05:11] <isr`> oh really i thought blueray burners were more.[10:05:13] *** durre has joined ##java[10:05:23] <isr`> how much are blueray disks?[10:05:37] *** teralaser has joined ##java[10:05:47] <cybereal> I'm seeing 200-300 depending on features and such[10:05:56] <cybereal> good question :)[10:06:32] <cybereal> not cheap[10:06:43] <isr`> i wonder if you pay more per gb for a piece of fuckin plastic than you would for a HD[10:06:50] <cybereal> you'd get the hd cheaper over all for sure[10:06:53] <isr`> i bet you do[10:06:55] <svm_invictvs> hm[10:06:57] <isr`> lol[10:06:58] <svm_invictvs> ugh[10:07:01] <svm_invictvs> I feel bad[10:07:03] <cybereal> but the disk is going to be more resilient over time[10:07:06] <svm_invictvs> I woke up a tech over this.[10:07:11] <isr`> wow that sucks, what a ripoff those disk making companies have going[10:07:17] <svm_invictvs> I guess my root password is to blame.[10:07:21] <isr`> cybereal: really?[10:07:28] <cybereal> isr`: it's supply vs. demand, there's no demand, there's supply, that drives up price to cover cost[10:07:33] <isr`> as long as you keep them out of sight and well protected really[10:07:41] <cybereal> isr`: definitely, with moving parts and magnetized media, a drive is much more work to keep safe[10:07:45] <cybereal> but sure yes you can manage it[10:07:51] <f3ew> tape, or lots of disk[10:08:09] <cybereal> tape is a nice inbetween but for doing tb level backups it's just ridiculously expensive[10:08:16] <isr`> i think tape is even more expensive[10:08:19] <cybereal> and I think I'd find more use from a bd writer over time[10:08:26] *** Resistance has joined ##java[10:08:27] *** ankylose has joined ##java[10:08:34] <svm_invictvs> hm[10:08:37] <isr`> a blueray disk could hold a heck of a lot of mp3s[10:08:41] <cybereal> heh[10:08:51] <svm_invictvs> isr`: like 25 gigabytes worth?[10:08:55] <isr`> i have like 2 months of non stop music[10:09:02] <cybereal> one double layer disk could hold about 42 movies the way I ripped my DVD's[10:09:04] <isr`> yeah thats around 15 days isnt it[10:09:07] <tazle> cybereal: a 1,6 TB tape seems to cost 60 euros[10:09:18] <cybereal> tazle: look at the drive cost[10:09:22] <svm_invictvs> How much porn is that?[10:09:36] <tazle> cybereal: one drive can serve many tapes, though - especially a robot[10:09:38] <isr`> 1.6 TB is a lot of porn[10:09:49] <svm_invictvs> We have a petabyte of videos at work.[10:09:49] <cybereal> tazle: I'm talking about backing up my personal media collection, I'm not a data center[10:10:02] <cybereal> tazle: I can't justify that kind of cost for one drive to back up data that rarely changes heh[10:10:06] <svm_invictvs> actually, no, we're like 7 terabytes short of a petabyte of videos.[10:10:11] <isr`> lol[10:10:29] <isr`> svm_invictvs: porn videos?[10:10:30] <tazle> cybereal: a HDD or three, then[10:10:53] *** morkar-- has joined ##java[10:11:03] <cybereal> tazle: yes, most likely I'll just get a same-size drive and maintain a clone, since it's media that's an acceptable backup strategy[10:11:16] <durre> I'm struggling with character sets (yet again). I have an url that looks like this: .../Thumbs?customerNo=3242&fileName=F%C3%B6retagspress.gif ... the %C3%B6 are swedish characters, or so I hope. when the url is executed the parameter retrieved is corrupt. why? the page where the url is displayed is using UTF8[10:11:21] <cybereal> still a longer term solution would be the bd writer, I've just not decided if it's worth having for other reasons or not[10:11:35] <cybereal> I even have this handy SATA drive dock[10:11:44] <svm_invictvs> isr`: no[10:11:48] <svm_invictvs> isr`: some, maybe[10:11:49] <cybereal> so I've got the perfect setup to use HDD's as my backup media[10:11:55] <tazle> durre: that's ö encoded in UTF-8 and then urlencoded[10:11:57] <svm_invictvs> then we've got 20 terabytes of hadoop[10:12:04] <isr`> ok so i had a java question, is there a way in JFileChooser to disable the "save/open" button until a file has been selected?[10:12:20] <tazle> durre: to get back to ö you'll have to reverse the steps[10:12:30] <isr`> cybereal: hardware raid[10:12:30] <isr`> ?[10:12:38] <cybereal> isr`: no?[10:12:43] <cybereal> isr`: I've no need for raid[10:12:43] *** foo-nix has quit IRC[10:12:56] <svm_invictvs> I use raid...[10:13:10] <svm_invictvs> backup the important shit to another drive spun down most of the time[10:13:11] <isr`> cybereal: but you're worried about disk failure[10:13:24] <cybereal> isr`: I'm worried about unlikely disk failure on data that rarely changes[10:13:29] <cybereal> I'm not worried about uptime[10:13:43] <cybereal> if I come home and the drive's dead, worst case scenario my wife bitches that she couldn't watch a movie on the apple tv[10:13:50] <durre> tazle: I dont follow. but I will google a bit and get back to you with the results :)[10:13:53] <cybereal> that is, if I get it backed up sometime soon :)[10:14:20] <cybereal> isr`: seriously if I had a 1TB write once media it would be "ok" for 95% of the use that this drive experiences[10:14:21] *** morkar- has quit IRC[10:14:23] <isr`> [pete@sunfire ~]$ uptime[10:14:23] <isr`> 04:19:05 up 41 days, 11:30, 3 users, load average: 0.48, 0.14, 0.11[10:14:40] *** TooAngel has joined ##java[10:14:40] <stixz> if i have nested for loops will break; stop both of them?[10:14:53] <svm_invictvs> stixz: no[10:15:03] * cybereal shuts his computer down each night because he doesn't need to waste power to buff up an uptime stat[10:15:05] <svm_invictvs> I think you need a goto in that case.[10:15:11] *** TooAngel has left ##java[10:15:21] <svm_invictvs> cybereal: But, uptime is an e-peen extension![10:15:24] <cybereal> heh[10:15:32] <cybereal> labelled continue![10:15:33] *** dunmer has joined ##java[10:15:34] * isr` keeps his computer on, because frankly, i'd like to see earth warm up a bit[10:15:40] <defenderBG> ok, I am trying to find a good example of sax, but all I can find is JAXP or examples, where half the methods/classes are deprecated, can anyone help me?[10:16:38] <cybereal> defenderBG: read the source code to xerces2 dom parser[10:16:47] <tazle> defenderBG: what do you think a good example would contain?[10:17:10] <isr`> cybereal: any ideas on that jfilechooser question ^^[10:17:20] <isr`> disabling the "save" or "open" button until a file is chosen[10:17:31] <cybereal> oh wow I was looking at the bd-rom prices for REWRITEABLE bwahaha regular disks are pretty cheap, about $15 for 25[10:17:57] <defenderBG> tazle: just the basic stuff, parse a document and see what was in it, yet all examples I could find had a few deprecated methods/classes[10:17:59] *** Levia has joined ##java[10:18:01] <cybereal> jeez prices vary wildly between vendors on these[10:18:14] * cybereal checks more reliable sources[10:18:51] <tazle> defenderBG: you do not parse a document and then see what was in it with SAX - you parse a document and then see what your parser got out of it[10:19:08] <isr`> damn, im getting this really annoying bug again.[10:19:19] <isr`> whenever i move mouse pointer over a window, it scrolls down all the way[10:19:25] <cybereal> ok 15 for 80, that's sounding more realistic[10:19:29] <isr`> its a lot more annoying than youd think[10:19:42] <isr`> for 80 rewritable blue ray disks?[10:19:59] <cybereal> no just writeable, it was like 125 for rewritable[10:20:01] <cybereal> or more[10:20:13] <cybereal> I am not interested in rewriteable for backup[10:20:17] <isr`> ya[10:20:31] <cybereal> not for this anyway, once I make one copy of a video file I can live with possibly losing a metadata correction :)[10:20:40] <cybereal> I just would rather not have to re-rip all my dvd's heh[10:20:42] <cybereal> that took a long time[10:20:57] <isr`> yeah that would stink[10:21:02] <cybereal> 464[10:21:05] <cybereal> DVD's[10:21:09] <defenderBG> tazle: ahh.... I know that I see what I get during the parsing and not after it is done (like in dom)... anyway if you have an example, I will be glad to read it[10:21:14] <isr`> ill be back in a bit this bug is driving me crazy[10:21:21] <cybereal> that I personally own and they now live in boxes :)[10:21:25] <durre> tazle: ahh, ok. %C3%B6 were not in fact swedish chars[10:21:35] *** isr` has left ##java[10:22:12] <tazle> durre: yes they are, they together make up one ö[10:23:01] <W_work> utf-8 wins[10:23:07] <cybereal> durre: url encoding is retarded, instead of encoding the codepoints, you encode the codepoints to their byte format then url encode that result, so %C3%B6 is a two byte utf-8 sequence not two different characters[10:23:37] *** alexbobp has left ##java[10:24:09] <tazle> defenderBG: you create an even handler, then create a parser and give it the event handler, then run the parser on some document and finally see what your handler managed to gather[10:24:22] <cybereal> me is happy that the Special Characters pallette in his mac allows him to enter the hex for utf-8 sequences as a search term for characters[10:25:32] <tazle> defenderBG: www.saxproject.org seems to have something - if you have a problem with their examples, you might want to ask more specific questions[10:25:46] *** pschriner has joined ##java[10:26:01] *** valcker has joined ##java[10:26:32] <defenderBG> tazle: that site looks promising, thanks[10:26:59] *** UT2K3 has joined ##java[10:27:20] <tazle> defenderBG: now, guess what was the number one hit on Google when I searched for "sax"?[10:27:37] <defenderBG> tazle: 69?[10:28:11] <tazle> defenderBG: #1[10:28:33] <tazle> err[10:28:39] <tazle> wel, you know what I mean[10:28:58] <cybereal> heh[10:29:37] <cybereal> I'm eating peanut butter whoppers. I bought them from walmart. I think I might be risking my life. Thrill of dangerous living++![10:30:34] *** smke has joined ##java[10:31:12] *** Junior has joined ##java[10:31:15] <W_work> heh I ate a bag of some choclatey snack here yesterday, then looked at the declaration and discovered that it had as many calories, and more fat, than four cheeseburgers[10:31:34] <cybereal> yeah that's the way it goes[10:31:37] <reisi> can i put binary numbers in java code somehow? in a way similar to 0xFF? i'm writing unit tests and really wouldn't like to risk these because i've converted the values wrongly in my head :)[10:31:46] *** unop_ has quit IRC[10:31:54] <cybereal> reisi: 0xff isn't binary it's hex and yes, you can do it, just like that[10:32:01] <W_work> reisi: you can - as String literals[10:32:26] * cybereal realizes he was tripped up by reisi's phrasing and answered that question incorrectly[10:32:26] <W_work> cybereal: he said similar, eg a numeric literal form that used binary /instead/ of hex[10:32:31] <cybereal> yes I see that now[10:32:44] <cybereal> ~literal[10:32:44] <javabot> cybereal, I have no idea what literal is.[10:32:47] <cybereal> seriously[10:32:51] <cybereal> ~literals[10:32:52] <javabot> cybereal, literals is the source code representation of primitive values, see http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10[10:33:05] <W_work> ~literal is <see>literals[10:33:06] <javabot> I have no factoid called "is <see>literals"[10:33:06] <svm_invictvs> cybereal: literal is for looking up factoids[10:33:11] <cybereal> of course[10:33:13] <svm_invictvs> ~literal be r0bby[10:33:14] <javabot> <reply>FileNotFoundException is a subclass of IOException; Exception won't directly catch that.[10:33:17] <W_work> ok, I fail at the javabot[10:33:35] <reisi> W_work: well.. how would you implement that? is there a similar prefix for specifying those?[10:33:46] <W_work> reisi: what?[10:33:46] <cybereal> Integer.parseInt("0011100110",2);[10:33:52] <cybereal> or something like that heh[10:33:56] <W_work> ah, yes[10:34:07] <reisi> W_work: ok, i guess that'll do[10:35:01] <svm_invictvs> ugh[10:35:09] <svm_invictvs> some daemon is failing to start.[10:35:12] <svm_invictvs> throwing io errors.[10:36:04] *** juc0 has quit IRC[10:37:33] <cybereal> reisi: I'd consider using octal though[10:38:46] * cybereal just uses his handy programmer's calculator to come up with hex[10:39:15] *** Spike1506 has joined ##java[10:40:00] *** isr` has joined ##java[10:40:40] *** cher has joined ##java[10:40:41] <mitch0> bc(1) ftw[10:43:43] <cybereal> http://files.me.com/zacheryjensen/0y9qfl ftw[10:45:56] *** gtapsycho has quit IRC[10:47:35] *** mosno has joined ##java[10:47:46] *** hoerup has joined ##java[10:49:29] *** UT2K3 has quit IRC[10:50:30] *** KermitTheFragger has joined ##java[10:57:31] *** Levia has quit IRC[10:58:46] *** Resistance has quit IRC[10:58:55] *** Resistance has joined ##java[10:59:48] *** slap_stick has joined ##java[11:00:09] *** Levia has joined ##java[11:00:38] *** BW^- has joined ##java[11:00:42] *** buntfalke has joined ##java[11:01:36] *** dv_ has joined ##java[11:01:45] <reisi> cybereal: i figure i'll get much less errors this way.. annoying error code collections![11:04:03] *** morkar-- has quit IRC[11:04:51] <BW^-> java.io.IOException: Keystore was tampered with, or password was incorrect[11:04:52] <reisi> this way, the next who comes trying to figure wtf was going on in my head sees the binaries and can immediateldy figure out that ok, they are from this manual here[11:04:54] <BW^-> anyone familiar with this one?[11:05:21] <cybereal> it's pretty clear[11:05:25] <cybereal> you have the wrong password[11:06:31] *** EspenG has joined ##java[11:09:31] <BW^-> cybereal: i'm 99% sure i have the right password[11:09:41] <BW^-> all the keystore creation and loading is made in the same fil[11:09:45] <BW^-> source code file[11:10:00] <BW^-> ah wait wait[11:10:05] <cybereal> well it could be a truncated file or something, it's basically telling you the decryption failed[11:11:00] *** delYsid has joined ##java[11:11:00] <BW^-> ah of course.[11:11:00] <BW^-> i found it, i think[11:11:13] *** beol has joined ##java[11:12:30] *** Copter has joined ##java[11:16:23] *** KikiJiki has quit IRC[11:17:08] *** Bevin has quit IRC[11:18:02] *** Bevin has joined ##java[11:18:37] *** l3ns has joined ##java[11:18:43] <l3ns> Hi everyone! =)[11:19:56] *** KikiJiki has joined ##java[11:20:23] *** monstrfolk has quit IRC[11:21:24] *** axod has joined ##java[11:21:41] <axod> hi, I had a stackOverlow, and am trying to work out what I can do to prevent such nastiness again[11:21:54] <axod> can a stackOverflow not be caught? :/[11:23:12] <cybereal> axod: don't recurse[11:23:45] <cybereal> java has no tail-call optimization, recursion should be avoided unless it really makes things extremely easier to understand and even then only if you know the depth is limited[11:25:34] <axod> it's a call to an external lib - json.org[11:25:55] <axod> can I not somehow protect?[11:26:07] <axod> I guess launching a separate thread would protect against it, but that seems horrible[11:26:19] <axod> what about increasing the max recurse length?[11:26:23] *** gdoko has quit IRC[11:26:23] <axod> possible?[11:26:46] <cybereal> axod: you can not do that but you can increase the stack size[11:26:47] <axod> maybe I should just find a non-recursive json parser[11:27:08] <cybereal> perhaps your heap is set very low, as stack will be set at a portion relative to the heap setting?[11:27:17] <cybereal> check out the parameters for the jvm and see what you have going on[11:27:33] <cybereal> at any rate, errors can't be recovered, not truly because the vm may be in an unknown state[11:27:57] <axod> sure, ok[11:28:06] <axod> never rely on external libs ;)[11:28:21] <cybereal> also there's a chance your parser's broken or doesn't protected against self-referencing things so it recurses infinitely, etc.[11:28:23] <axod> thx[11:28:57] <axod> sure. from the stack dump, it seems to be either a broken parser, or the data is like "[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...."[11:29:25] <W_work> surely you can just check the data[11:29:27] <cybereal> heh sounds like some kind of parsing problem[11:29:28] <axod> I'll see if anyone else is having issues with the json.org parser[11:29:39] <axod> W_work: a regexp count of [ and { ?[11:30:05] <axod> (those are the ones that recurse in the json data afaik)[11:30:19] <W_work> axod: no, I meant as a troubleshooting step - eyeball the document and see if that really is a problem[11:30:58] *** m4rtijn has joined ##java[11:30:59] <axod> W_work: sure, the pain is, this has happened once in 2 weeks on a production system, with 100k's of json data[11:31:01] <m4rtijn> hi all[11:31:10] <axod> and I only got a few bits+bobs from the logs[11:32:00] <axod> is there a way to tell how many recursions are safe?[11:32:04] <axod> before the stack explodes?[11:32:11] <m4rtijn> I'd like to know if anyone here is fammiliar with PDF writer APIs.. and if he/she can recommend a specific one..[11:32:17] <cybereal> axod: not really[11:32:19] <m4rtijn> I found iText[11:32:22] <axod> so you can say if(depth>maxDepth) return; // bail[11:32:27] *** m4rtijn has left ##java[11:32:37] *** m4rtijn has joined ##java[11:32:40] <m4rtijn> hoops..[11:32:48] <m4rtijn> re :p[11:32:53] <cybereal> axod: you could experiment to find out[11:33:20] <cybereal> it could also change from JIT and such[11:33:22] <axod> sure.. thx for the input[11:33:39] <axod> maybe I'll just put in a few broad sane checks for now[11:34:19] *** Daniel_H has joined ##java[11:35:17] <cybereal> could also try increasing the stack :)[11:35:25] <cybereal> oy I need sleep[11:35:26] *** cybereal has quit IRC[11:35:48] *** mengu has quit IRC[11:36:10] *** monstrfolk has joined ##java[11:36:19] <m4rtijn> .. can anyone recommend a pdf writer api?[11:36:29] *** dv_ has quit IRC[11:36:46] <Spike1506> m4rtijn: did you try to google it? :)[11:37:05] <m4rtijn> I did..[11:37:32] <m4rtijn> finding any is not the problem..[11:37:53] <m4rtijn> I'd just like to know if anyone here could recommend any of em.. with some experience[11:38:56] <m4rtijn> seems iText is the most known api[11:39:27] *** elindio has joined ##java[11:39:59] *** axod has left ##java[11:41:49] *** Spike1506 has quit IRC[11:42:35] *** squiddle has joined ##java[11:43:07] <W_work> ~pdf[11:43:08] <javabot> W_work, I have no idea what pdf is.[11:43:13] <W_work> guess not[11:45:35] *** m4rtijn has left ##java[11:45:41] *** m4rtijn has joined ##java[11:45:48] *** skoskav has quit IRC[11:45:57] <m4rtijn> hmm, this "close" button is to easy clickable :p[11:48:27] *** Partyzant has quit IRC[11:48:33] *** Partyzant has joined ##java[11:49:44] *** teralaser has quit IRC[11:51:03] *** Bevin has quit IRC[11:52:04] *** giaco has joined ##java[11:53:15] <isr`> ~microsoft[11:53:16] <javabot> isr`, microsoft is a coercive monopoly with business practices such as http://www.javaworld.com/javaworld/jw-06-1998/jw-06-iw-doj.html[11:53:38] *** UT2K3 has joined ##java[11:53:57] <BW^-> cybereal: now we got UnrecoverableKeyException: Given final block not properly padded , hm.[11:54:25] <BW^-> (googling)[11:54:42] <ilyak> BW^-: wrong password[11:55:08] <BW^-> ilyak: that error means wrong password too ?[11:55:29] <isr`> heh, so do most of you guys use linux?[11:56:34] <ilyak> BW^-: That's why I hate crypto - they would never tell you "wrong password"[11:56:46] *** Bevin has joined ##java[11:56:55] <ilyak> They rather tell you "unknown error"[11:57:29] *** bas-i has joined ##java[11:57:34] *** scizzo- has quit IRC[11:57:38] *** Carnage\ has quit IRC[11:57:51] *** kungen has quit IRC[11:58:22] <BW^-> ilyak: ah[11:58:36] *** lolsuper_ has joined ##java[11:58:41] <BW^-> ilyak: but.. i should really not have the wrong password here in this code.[12:00:12] <ilyak> Maybe the keyfile is corrupt?[12:00:31] <BW^-> just generated it.[12:00:52] <BW^-> tried to put it in a fiile and apply keytool to it[12:00:58] <BW^-> keytool -list -keystore key[12:00:58] <BW^-> keytool error: java.lang.Exception: Keystore file exists, but is empty: key[12:01:07] <BW^-> ..which is not true neiter[12:01:15] *** defenderBG has quit IRC[12:01:25] *** monstrfolk has quit IRC[12:02:03] *** squiddle has quit IRC[12:02:12] *** alex-c has joined ##java[12:02:23] *** ajnsit has joined ##java[12:02:32] <BW^-> ilyak: are you aware of any example code that shows how to put a private and a public key into a keystore after having generated it, and then loading and storing keystore?[12:02:46] *** ajnsit has left ##java[12:02:48] <BW^-> i've sought through google a bunch of times, there's *almost* examples that cover this, but not wholly.[12:05:20] *** bushwakko has joined ##java[12:06:49] *** monstrfolk has joined ##java[12:08:04] *** orgy` has joined ##java[12:08:20] <ilyak> This depends on the format of the keys[12:08:33] <ilyak> I've personally imported pfx (p12) keys into jks[12:08:34] *** assertsmart has joined ##java[12:08:39] <ilyak> and also crt files to jks[12:08:42] <ilyak> And it worked[12:09:51] *** squiddle has joined ##java[12:10:02] <BW^-> aha[12:10:37] <ilyak> I can show an example of either[12:14:15] *** blankthemuffin has quit IRC[12:15:28] *** sombriks has joined ##java[12:16:17] *** cher has quit IRC[12:18:57] *** lem_ has joined ##java[12:19:02] <lem_> hi everyone[12:20:19] *** cher has joined ##java[12:20:22] *** kungen has joined ##java[12:20:26] <elindio> anybody knows the difference between BorderLayout and FlowLayout in swing ?[12:20:44] <lem_> javafx keeps confusing me. where is the TextArea class located? even though I have a javafx.ui package in javafxrt.jar, at runtime the class TextArea can't be found. any idea? yes, javafxrt.jar is in the classpath.[12:22:06] *** ttmrichter_ has quit IRC[12:24:34] <isr`> javafx code looks odd[12:27:41] <lem_> you didn't see mine, it looks even worse[12:27:46] <lem_> but that's not the actual problem[12:28:21] *** LordMetroid has joined ##Java[12:28:51] *** lem_ is now known as lem[12:32:28] *** mgenov has joined ##java[12:33:21] *** asap18 has joined ##java[12:33:24] *** ankylose has quit IRC[12:37:10] *** foo-nix has joined ##java[12:38:40] *** BW^- has quit IRC[12:38:41] *** btb996 has joined ##java[12:39:03] <btb996> how to setMediaTime in JMF?[12:39:42] <btb996> I have tried to setMediaTime(new Time(4.5d)) in this way, but the media have about 3s delay.[12:39:58] *** BW^- has joined ##java[12:44:42] *** mosno has quit IRC[12:48:20] *** elmomalmo has joined ##java[12:49:01] *** Shirik has quit IRC[12:49:51] *** alex-c has quit IRC[12:53:12] <isr`> so i have a JFileChooser to import multiple files. I choose a few files to import, import them and all is well. If i click import again and the JFileChooser instance pops up, it shows the files i previously selected highlighted. I tried stopping this behavior with setSelectedFiles to no avail, any ideas?[12:56:37] *** lami1984 has joined ##java[12:56:39] <lami1984> hello[12:57:42] *** btb996 has quit IRC[12:59:55] *** musically_ut has quit IRC[13:00:05] <isr`> hey lami1984[13:00:21] *** teralaser has joined ##java[13:00:36] <isr`> its not really a big problem, its just kind of annoying not to get a fresh import file dialog every time, and wasteful if i instantiate a new one for each import files operation[13:00:44] <lami1984> I have a problem with convolution operator in java http://eugeneciurana.com/pastebin/pastebin.php?show=40471[13:01:23] <isr`> no idea lami1984 im sure someone knows[13:01:33] <isr`> were you born in 1984 or are you a fan of orwell?[13:01:35] *** Resistance has quit IRC[13:02:03] *** ries has joined ##java[13:03:18] <lami1984> born[13:03:32] <lami1984> both actually ;)[13:03:33] <isr`> ah i'm 2 years younger[13:03:40] <isr`> haha thats cool, i like orwell also[13:03:55] <isr`> interesting how life imitates art isn't it[13:04:36] *** nvictor has joined ##java[13:05:07] <lami1984> yeah, need to make a coffee[13:06:00] *** nvictor has left ##java[13:07:04] <lem> damn it[13:07:23] *** rdancer has joined ##java[13:07:49] *** shadewind has joined ##java[13:09:25] *** Resistance has joined ##java[13:18:28] <lami1984> can I easy convert from any image color model to another one?[13:20:57] *** Varox has joined ##java[13:22:20] <squiddle> lami1984: depends, most color models have differing color spaces[13:22:55] <lami1984> squiddle: does Java support some king of conversion to handle that?[13:23:12] *** litb has joined ##java[13:23:16] <litb> hello all[13:23:23] <litb> are objects first-class in java?[13:23:56] <squiddle> lami1984: yes http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Color.html[13:24:34] *** Hail_Spacecake has quit IRC[13:24:38] <litb> is it right to say that java objects are not first-class, but primitive type variables are first-class?[13:25:02] *** Bevin has quit IRC[13:25:16] <squiddle> lami1984: especially the ColorSpace class looks like it could help you[13:25:18] *** musically_ut has joined ##java[13:25:28] *** DragonLord- has joined ##java[13:25:44] <lami1984> thanks I'll check that[13:26:13] <squiddle> litb: what is the purpose of your question? first-class is not a defined term to use without context[13:26:24] <litb> oh[13:26:37] <elmomalmo> squiddle: it is, http://en.wikipedia.org/wiki/First-class_object[13:26:38] <litb> i thought first-class means that you can pass that thing to functions[13:27:38] <squiddle> elmomalmo: you are kidding this is not a definition at all it even says so "this can imply"[13:27:57] <squiddle> elmomalmo: and litb already proofed he understands something else too[13:27:58] <squiddle> :)[13:28:22] <lem> where is the TextArea class in the javafx distribution?[13:28:24] <elmomalmo> squiddle: safe assumption, I thought. :-)[13:28:25] *** deepjoy has joined ##java[13:28:57] <litb> hmm[13:30:03] <jottinger> lem: where in what way?[13:30:31] <jottinger> litb: you can pass object references to functions... IF your language has functions[13:30:41] <litb> squiddle: so i thought similar to what functions in C are called non-first class, objects in java are too[13:30:42] <lem> jottinger, where is it located. I can't find it[13:30:52] <jottinger> but according to your definition, java has no first-class or second-class objects, since it has no functions to pass them to[13:31:19] <litb> jottinger: so because i can't pass objects directly but only a reference to them that contains their address as value instead of the value of the object[13:31:30] <lem> I'm including filters.jar, javafxrt.jar and swing-layout.jar and this should be it[13:31:35] <litb> so i thought similar to functions in C objects in Java are non-first class[13:31:48] <jottinger> lem: you can use Swing components in JFX[13:31:50] <litb> but i think i'm not sure and may confuse teh matter. so i asked in here[13:32:07] <jottinger> litb: you can pass functions around to other functions in C[13:32:17] <jottinger> and this sounds awfully homeworky[13:32:31] <litb> jottinger: yeah that's what i wonder about. are they non-first class if we can't pass their value - but just their address?[13:32:52] <W_work> what's the difference?[13:32:54] <jottinger> litb: I have no idea.[13:33:05] <jottinger> I find that my lack of caring is kinda stunning in its depth.[13:33:13] <litb> jottinger: and is it the same in java? i mean, in java you can pass primitives itself directly. but objects need a "workaround" to be pseudo-passed, a reference to them[13:33:24] <jottinger> litb: except they don't[13:34:04] <W_work> litb: these terms only have meaning if defined in terms of how they affect program behaviour, and not if defined in terms of implementation details![13:34:08] <litb> but the wiki article says "having an intrinsic identity (independent of any given name)" which fits java objects. but it also has more items that doesn't fit java objects[13:34:09] *** Carnage\ has joined ##java[13:34:30] *** Levia has quit IRC[13:34:36] <litb> and it says it's relative to other entities in the language. and comparing objects to primitive typed values, i have feeling that they are non-first class[13:34:40] *** Levia has joined ##java[13:34:46] <litb> W_work: oh[13:34:49] <jottinger> it's not a workaround, it's a core process, it's hardly inefficient[13:34:52] *** Levia has quit IRC[13:35:00] <W_work> you can't say that "Java pass primitives directly" if what you mean is that the value is passed in a register in the processor - because that might not be true on several JVMs or platforms![13:35:09] <litb> jottinger: yeah i quoted it because it's not really a workaround[13:35:42] <squiddle> litb: you really should define first-class first and than just compare your definition with the reality :) i guess that's part of the thing called science (having clear definitions about scope, context and depth)[13:35:55] <litb> W_work: i mean it in terms of the language. not in terms of VMs or processors[13:36:01] <W_work> if what you mean is "If I do method(a); can method change what a points to in the calling code?" then is suddenly makes sense[13:36:11] <W_work> s/is/it[13:36:11] *** gfather has joined ##java[13:36:16] <litb> i mean what is passes is their value. and for objects, they are not passes but only as value their identity is passed[13:36:19] <gfather> hello guys[13:36:29] <gfather> any recomendation for a light ide , im on ubuntu[13:36:36] <litb> squiddle: yeah i'm not sure what first-class means. but it seems it's not really well defined[13:36:48] <litb> so ill avoid using it i think. what would you recommend?[13:36:51] <W_work> litb: I prefer to think that Java pass primitives and objects the same way - and that primitives are immutable[13:36:53] <jottinger> litb: imagine that. :)[13:37:00] <jottinger> gfather: what is a "light ide?"[13:37:24] <W_work> this, as far as I know, in no way conflicts with the Java language specification[13:37:28] <gfather> i mean a light ide , not heavy on the system[13:37:32] <litb> alright thanks guys i think it helped clearing it up[13:37:40] <elmomalmo> gfather: IntelliJ idea, it may not be "light" by any sensible definition but it rocks IMHO[13:37:47] *** Levia has joined ##java[13:38:14] <litb> W_work: there is the popular and correct assumption that objects are not passed at all. that's what i based my consideration on :)[13:38:25] <gfather> elmomalmo:)[13:38:38] <litb> anyway i fear i better stop talking about that now otherwise we are talking about this all day long again haha[13:39:02] <jottinger> gfather: it's probably the best ide[13:39:10] <jottinger> heck, I work for an eclipse vendor and I use IDEA :)[13:39:18] <litb> jottinger: oh[13:39:42] <jottinger> litb: ?[13:39:46] <litb> no good[13:39:50] <W_work> litb: when it comes to terms like "first-class" it's in relation to "first-class citizen of the type system" wording often used for functional programming languages - I'd say that Java doesn't even have citizenry.[13:39:50] <jottinger> s/for/with/[13:39:55] <jottinger> what's no good?[13:40:20] <litb> jottinger: not using your flagship haha[13:40:33] <jottinger> litb: well, I didn't say I don't use Eclipse[13:40:34] <litb> W_work: hmm i see[13:40:52] <W_work> you have a stratified type system, where primitives and classes don't mingle except through autoboxing, and methods and types don't mingle at all[13:41:02] <jottinger> http://www.enigmastation.com/?p=58[13:41:15] <elmomalmo> jottinger: you found a way of developing RCP stuff effectively in IDEA?[13:41:39] <litb> so ur working for enigmastation[13:41:40] <litb> i see[13:41:44] <jottinger> elmomalmo: No, I would develop RCP stuff on the platform in which it's deployed - although I've certainly used IDEA to do OSGi[13:41:54] <gfather> jottinger the pc im on now is slow , will it work good ? becouse im on an old p4[13:41:58] <jottinger> litb: no... I'm working WITH genuitec, the myeclipse people[13:42:09] <jottinger> the post refers to a product of theirs[13:42:16] <litb> oh ok[13:42:22] <BW^-> ilyak: still around?[13:42:27] <jottinger> I don't actually do anything with the core business, I'm sort of an external consultant for them for a client of their[13:42:28] <BW^-> ilyak: needed to get down from internet.[13:42:29] <ilyak> BW^-: yeah[13:42:30] <jottinger> theirs[13:42:32] <BW^-> ilyak: super![13:42:56] <BW^-> ilyak: yes, i would be very happy if you should show me some code that generates an RSA key, stores it into keystore, loads it, and uses it to decrypt and encrypt a message[13:42:59] <BW^-> just a string[13:43:20] <ilyak> I don't know that, because I didn't do homeworks: I've just imported various keys into jks[13:43:40] <ilyak> What kind of key do you want? I remember generating keys also, but that was waaay back[13:46:31] <BW^-> ilyak: i am successful in generating keys.[13:46:50] <BW^-> ilyak: however i thought it could be good to have a piece of code that shows it all, so i am sure all is put the right way[13:47:49] <ilyak> Well, my task was to make a keystore for the library to use[13:48:45] <BW^-> ilyak: how do you mean?[13:48:59] <litb> hmm[13:50:46] <ilyak> like, java org/mortbay/util/PKCS12Import Keyfile.pfx wmuser.jks[13:51:16] <BW^-> ilyak: ok[13:51:19] *** ldamwork has quit IRC[13:51:36] *** Techdeck has quit IRC[13:51:41] *** ldamwork has joined ##java[13:51:55] <letfunbegin> what is the standard way of obtaining a SecurityManager that is more permissive than the java.lang.SecurityManager? is it subclassing it and changing the relevant methods or something more clever?[13:57:11] *** ErebFaer has joined ##java[13:58:20] *** eidolon has quit IRC[13:58:40] *** AskHL has quit IRC[14:00:13] <jottinger> letfunbegin: System.setSecurityManager(new RMISecurityManager());[14:00:28] *** Resistance has quit IRC[14:01:05] <ErebFaer> i have an JScrollPane which shows an JList. the JList hast an DefaultListModel as model. when i add an element to the model the JScrollPane changes its size... how can i prevent the JScrollPane from that behavior?[14:01:25] *** asap18 has quit IRC[14:01:26] <isr`> setPreferredSize?[14:04:26] <letfunbegin> good, I became unsure when I read this in the API though: "Therefore an RMI application should use the SecurityManager class or another application-specific SecurityManager implementation instead of this class." (from http://java.sun.com/javase/6/docs/api/java/rmi/RMISecurityManager.html)[14:06:42] *** m4rtijn has left ##java[14:08:07] <jottinger> java WTF: http://thedailywtf.com/Articles/Some-Crazy-Reason.aspx[14:09:08] *** orgy` has quit IRC[14:10:56] *** deepjoy has left ##java[14:11:06] *** BW^- has quit IRC[14:11:10] *** scottyL has quit IRC[14:11:57] *** skoskav has joined ##java[14:12:30] *** AverageJoJo has joined ##java[14:12:37] <r0bby> hahaha[14:12:39] <r0bby> IDIOT[14:12:47] <AverageJoJo> I have some oz questions if u know oz plz join #oz :)[14:12:51] <r0bby> any moron with a half brain knows hex is 0 to 15.[14:12:51] *** AverageJoJo has left ##java[14:12:59] <r0bby> idiot[14:15:21] *** bas-i has quit IRC[14:15:57] *** Obeliks has joined ##java[14:16:36] *** FauxFaux has quit IRC[14:19:07] *** bas-i has joined ##java[14:19:51] *** jhonnyboy has joined ##java[14:20:17] <jhonnyboy> hey everyone how can i run a package in terminal? I already compiled the classes + the main but i'm having trouble running it.[14:20:27] *** FireSlash has joined ##java[14:20:56] <reverend> run a package?[14:21:20] *** durka42 has quit IRC[14:21:37] <letfunbegin> I guess he means a jar[14:21:47] <jottinger> Does he? He should say so.[14:22:17] *** vyoman has joined ##java[14:24:09] *** Levia has quit IRC[14:27:18] <jhonnyboy> sorry guys i was afk[14:27:39] <jhonnyboy> What i have is a simple class, and a main[14:27:43] <jhonnyboy> i saved both as .java[14:27:48] <jhonnyboy> and put them under a package.[14:28:01] <jottinger> so use the java command[14:28:02] <jhonnyboy> I was using Netbeans and i'm moving towards coding in the text editor[14:28:15] <jhonnyboy> I'm guessing package is something Netbeans needed[14:28:21] <jhonnyboy> so I'm going to remove that[14:28:24] <jottinger> no, it's something java uses[14:28:26] <reverend> whoa, whoa[14:28:28] <jhonnyboy> ah ok[14:28:29] <jottinger> so don't remove it[14:28:33] <jhonnyboy> you got it.[14:28:36] <jottinger> you might want to learn java at some point.[14:28:41] <ilyak> wow, it's cool[14:28:44] *** morkar- has joined ##java[14:28:45] <jhonnyboy> That's what i'm working on ><[14:28:46] <jhonnyboy> lol[14:28:55] <ilyak> append ?A[B]=C to any struts 1.x page[14:29:08] <reverend> consider dumping netbeans and going through the command line tutorial trail[14:29:09] <jhonnyboy> when i say "java Main"[14:29:10] <jottinger> CNN: "The founder of an Islamic television station in upstate New York aimed at countering Muslim stereotypes has confessed to beheading his wife, authorities said."[14:29:11] <ilyak> And see how it fails unrecoverably[14:29:11] <reverend> ~first cup[14:29:11] <javabot> A friendly web page to get you started with Java programming: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/[14:29:13] *** [A2K] has joined ##java[14:29:16] <ilyak> A healthy design decision![14:29:16] <jottinger> Way to counter stereotypes there, dude[14:29:17] <jhonnyboy> it gives me errors saying that the class wasn't found.[14:29:27] <W_work> jottinger: hahaha[14:29:28] <ilyak> Waaay to go! Crash in code where you can't handle anything[14:29:30] <jottinger> jhonnyboy: try java packagename.Main[14:29:32] *** FauxFaux has joined ##java[14:29:41] <jhonnyboy> jottinger: Thanks :)[14:29:44] <reverend> i have a feeling they aren't compiled yet[14:29:56] <jottinger> reverend: I have a feeling he's learning by mashing keys[14:30:13] <[A2K]> hello. if i make a cycle that uses one variable and do not use that variable later, that cycle does not run. How can i make it run?[14:30:19] *** csgeek has quit IRC[14:30:26] <reverend> a 'cycle' ?[14:30:32] <[A2K]> loop[14:30:34] <[A2K]> for, while[14:30:34] <jottinger> pastebin. test case.[14:30:54] <jhonnyboy> jottinger: the package name is "test". So i put in "java test.Main" and it didn't work :([14:30:58] <reverend> wow juniper consumer stuff sucks[14:31:11] <jottinger> jhonnyboy: then you may have done something else wrong.[14:31:32] <[A2K]> something like int a; for(int i=0; i<10000; i++) { a=a+10; }, and if i will not use 'a' later, this loop does not run[14:31:47] <jottinger> how do you know?[14:32:05] <jhonnyboy> jottinger: Thanks for all your help :)[14:32:08] *** jhonnyboy has quit IRC[14:32:21] *** Thorn has quit IRC[14:32:26] <[A2K]> i want to know how much time different arithmetic operations take and i am writing a test.[14:33:06] <[A2K]> long cycles complete instantly if their variables are not used later[14:33:07] <jottinger> well, discarding results like that is very informative[14:33:12] <jottinger> heh[14:33:16] <jottinger> logic fail[14:33:32] <[A2K]> i want to know time, not variable values[14:34:20] *** marvs has joined ##java[14:34:48] *** lem has quit IRC[14:35:07] <jottinger> [A2K]: think: if you're not USING the variable values, why can't the compiler remove them altogether?[14:35:12] *** spathi has joined ##java[14:35:39] <jottinger> "Gee, you are doing this long operation that you apparently don't care about; let me optimize that for you by wiping the operation from the compiled code."[14:36:04] <[A2K]> i understand that. i think i have to use them silently with minimal time consuming and no console output. is that possible?[14:36:13] *** mhoney_zzzz has joined ##java[14:36:57] <reverend> oh you fuckers, no 64 bit support, nor any planned[14:37:10] <tazle> [A2K]: just ensure that the value contributes to something that will be output in the end[14:37:23] <jottinger> [A2K]: not if you want to measure it.[14:37:33] <jottinger> reverend: in what?[14:38:27] *** csgeek has joined ##java[14:38:43] <reverend> juniper netscreen remote[14:38:55] <tazle> [A2K]: and be sure to do something other than "+=1" or "*=1" in a loop - the JIT will most likely inline such loops if only it can determine the number of iterations[14:39:04] <jottinger> oh, lots of remoting stuff is like that[14:39:13] <jottinger> tazle: and it'll optimize such things anyway[14:39:26] <jottinger> *=1 will be removed entirely; +=1 will be changed to an inc[14:39:52] <[A2K]> ok, i found a solution: i put value of one of the loop's variable to class's public variable[14:39:53] <tazle> jottinger: yes[14:40:03] <jottinger> [A2K]: startling.[14:40:32] <tazle> [A2K]: be sure to read the actual machine code the JIT generates before making conclusions that go too far[14:40:39] *** DragonLord- has quit IRC[14:40:43] <jottinger> tazle: hrm. How do you do that?[14:41:01] <[A2K]> that was something strange for me - i'm C/C++ coder.[14:41:15] <jottinger> [A2K]: it's surprising that Java actually does stuff faster sometimes, huh?[14:41:25] *** mhstif has joined ##java[14:41:31] *** ordex has joined ##java[14:41:34] <ordex> hi men[14:41:35] <tazle> jottinger: with debug VM and -XX:+PrintOptoAssembly or something like that[14:41:41] <[A2K]> it's surprising that Java sometimes does not stuff :)[14:41:43] <jottinger> tazle: nice[14:41:55] <jottinger> [A2K]: it doesn't do stuff that ends up in a no-op, sure[14:42:10] <jottinger> tazle: you should blog that :)[14:42:17] <[A2K]> ok, i got it.[14:42:22] <reverend> C/C++ :)[14:42:37] <tazle> jottinger: Kohsuke Kawaguchi alreadu blogged it sometime in 2008 :)[14:42:45] <jottinger> ah, col[14:42:52] <tazle> http://weblogs.java.net/blog/kohsuke/archive/2008/03/deep_dive_into.html[14:42:52] <jottinger> cool. Kohsuke's a good fellow.[14:43:08] <ordex> does WTK exists for 64bit systems?[14:43:11] *** lolsuper_ has quit IRC[14:43:16] <[A2K]> one more question. how to get time in clock ticks? like clock() in C[14:43:24] *** Resistance has joined ##java[14:43:31] <jottinger> System has a reference to nanoTime()[14:43:32] *** lolsuper_ has joined ##java[14:43:36] <jottinger> or something like it[14:43:57] *** Vogil has joined ##java[14:44:19] <[A2K]> jottinger: thank you![14:44:39] <jottinger> tazle: that's... totally fascinating, actually[14:45:08] *** FireSlash has quit IRC[14:45:22] <Vogil> I need some help, I'm trying to use a stateful web service that passes the session ID in a soap header. I'm creating a client for it, the weblogic client generator did not handle this well, so now I am trying axis. I'm told axis can do this, I just cannot seem to get it to maintian the session, I'm not sure if I need a client-config.wsdd or not? I'm deploying to a weblogic server.[14:45:31] <tazle> jottinger: yes, I've spent way too many hours reading x86 after I found that :)[14:45:34] *** [Steffy] has joined ##java[14:45:45] <jottinger> ~tazle++[14:45:46] <javabot> tazle has a karma level of 27, jottinger[14:46:40] <reverend> i remember reading this[14:46:56] <reverend> it's nice[14:47:11] <litb> ~litb[14:47:11] <javabot> litb, I have no idea what litb is.[14:47:18] <litb> mean :/[14:47:30] <mitch0> how wise is it to mix entityManager.persist() with hand-crafted queries operation on the same underlying table?[14:47:44] <mitch0> s/operation/operating/[14:48:35] <reverend> probably not unwise[14:48:47] *** jdolan_ has joined ##java[14:49:18] <jottinger> ~be litb[14:49:18] <javabot> I don't know who litb is. I don't even care. litb can jump in a lake.[14:49:22] *** _stack has joined ##java[14:49:37] <litb> lol[14:49:41] <litb> litb can swim[14:49:53] <mitch0> pasically, I have simple entities liek (id, owner, stamp). I fetch them with find(), create them with persist(), but I need to modify them with a special update, 'cos I can only update the record if owner didn't change in the meantime[14:50:01] <litb> ~be jottinger[14:50:01] <javabot> There are no stupid questions, only stupid people.[14:50:03] <mitch0> s/^p/b/[14:50:23] <[A2K]> can i put a data type in a function argument and create a variable of that type inside the function?[14:50:37] <jottinger> [A2K]: yes.[14:51:09] <[A2K]> is data type an object?[14:51:18] <jottinger> sure.[14:51:22] *** qeek has joined ##java[14:51:28] <[A2K]> cool.[14:51:35] *** lami1984 has quit IRC[14:51:45] <jottinger> void foo(Class c) { Object o=c.newInstance(); /* ignores exception handling */ }[14:52:20] *** _stack has quit IRC[14:52:40] <[A2K]> thank you![14:52:51] <litb> [A2K]: u can also make foo a generic, and then do T o = (T)c.newInstance(); to have o of the right type at compile time[14:53:02] <jottinger> it also assumes that c's type has a null-argument constructor[14:53:34] *** l2trace99 has joined ##java[14:54:13] *** [Steffy] has quit IRC[14:54:45] *** mhoney_zzzz has quit IRC[14:55:30] *** firen has joined ##java[14:55:39] *** deepjoy has joined ##java[14:57:15] *** etag has quit IRC[14:58:31] *** qeek has quit IRC[15:00:12] *** monkeycid has joined ##java[15:00:19] *** [trip] has joined ##java[15:00:45] *** indeterminatus has joined ##java[15:04:36] *** riotz has joined ##java[15:07:46] *** eidolon has joined ##java[15:07:57] <Vogil> anyone dealt with session IDs in soap headers before?[15:08:29] <Vogil> I'm having quite a time getting web service client to respond with the session the server is sending[15:08:58] *** Inc` has joined ##java[15:09:06] *** ordex has left ##java[15:10:17] *** ankylose has joined ##java[15:10:19] *** mohax has joined ##java[15:13:41] *** assertsmart has quit IRC[15:14:21] *** wfq has joined ##java[15:14:27] <wfq> hi guys[15:15:31] <wfq> I am looking for a opensource java api that allows me to extract images from a pdf file?[15:19:13] *** elindio has quit IRC[15:21:17] <cheeser> ~~ wfq java pdf[15:21:17] <javabot> wfq, I have no idea what java pdf is.[15:21:22] <cheeser> ~~ wfq google java pdf[15:21:22] <javabot> http://letmegooglethatforyou.com/?q=java+pdf[15:21:30] *** Vogil has quit IRC[15:23:11] *** NiallC has joined ##java[15:23:17] *** gfather has quit IRC[15:24:05] *** rollins has joined ##java[15:24:36] *** geaaru has joined ##java[15:25:16] *** waz has joined ##java[15:26:08] *** ankylose has quit IRC[15:27:31] *** morkar- has quit IRC[15:30:57] *** DragonLord- has joined ##java[15:31:38] *** JohnBat26 has quit IRC[15:33:25] *** Ven]n has joined ##java[15:35:30] *** monkeycid has quit IRC[15:35:39] <wfq> cheeser I had already read nearly all of them but none said that I can extract images from the pdf file but manipulate them. Hence I asked here just in case someone else had faced this problem before[15:35:42] *** dunmer has quit IRC[15:37:01] <wfq> and open source of course :)[15:37:18] *** Gracenotes has quit IRC[15:37:32] <jottinger> wfq: did you look at itext or BFO's docs?[15:37:51] *** monkeycid has joined ##java[15:37:55] <cheeser> or pdfbox?[15:40:06] *** HeatHawk[AP2] has left ##java[15:40:12] *** HeatHawk[AP2] has joined ##java[15:43:40] *** riotz has quit IRC[15:45:02] *** UT2K3 has quit IRC[15:45:38] *** skoskav has quit IRC[15:46:09] *** geaaru has quit IRC[15:48:13] <wfq> bof, it looks like yes: Extract and index text and images from PDF documents, including integration with Apache Lucene... Shame it is not free software[15:49:12] *** [mhoney] has joined ##java[15:49:31] <cheeser> cheap bastard[15:49:32] <cheeser> 8^)=[15:50:44] *** Scorchin has joined ##java[15:50:46] *** Levia has joined ##java[15:50:55] *** Junior has quit IRC[15:51:05] <Scorchin> anyone know of any good implementations of concurrent neural networks? thanks[15:51:08] *** [A2K] has quit IRC[15:51:10] *** mhoney has joined ##java[15:51:15] * Stephmw points to cheeser's brain[15:51:22] *** B|20CK has joined ##java[15:51:33] *** [mhoney] has quit IRC[15:51:39] <Scorchin> :0[15:51:46] <cheeser> Stephmw: he said "good"[15:51:52] <Scorchin> *good code implementations[15:51:59] <Scorchin> and what cheeser said ;)[15:52:17] <jottinger> Scorchin: depends on what good means[15:52:38] <jottinger> There's one called "encog" that's *written* well, but neural networks have a problem[15:52:56] <Scorchin> well, simple feed-foward ANN, able to run "x" many simultaneously, don't mind about the listener, as I will implement it[15:53:08] *** gdoko has joined ##java[15:53:12] <jottinger> Scorchin: http://www.enigmastation.com/?p=32[15:53:24] <jottinger> encog can do hopfield and backpropagation networks[15:53:47] <jottinger> I've got one as well but the problem it has is still that interacting with it is flippin' impossible[15:54:11] <jottinger> as far as multithreaded... do you mean USING the network or training it?[15:54:13] <Scorchin> yeah, that's where I seem to fall short[15:54:19] <Scorchin> bit of both[15:54:39] <jottinger> Scorchin: I haven't used encog in anger, but the author is a bright guy[15:54:54] <jottinger> Mine is slow going because I want it to make sense when I use it :/[15:55:17] <jottinger> Writing the actual network code is easy, making it comprehensible... is something else[15:55:25] <Scorchin> so that I can have x many neural networks placed together, workiing concurrently. then use evolutionary methods to cut away at the better ones. Finally, copying out the "best" ANNs to repeat again[15:55:32] <Scorchin> yup :D[15:55:45] <jottinger> Scorchin: well, that's a different technique, or a combination of techniques[15:56:06] <Scorchin> a combination[15:56:26] <jottinger> Scorchin: might I suggest getting a book? Tobey Segaran's "Programming Collective Intelligence" is an excellent resource on a wide array of AI techniques, although it's in Python[15:56:28] <Scorchin> just want something that works well on the lower (threads?) level, then will expand out from there[15:56:34] <Scorchin> cool[15:56:39] <jottinger> Segaran's a bright guy and a good one[15:56:47] *** b0red has joined ##java[15:57:09] <jottinger> bayesian classification is easy because the inputs and outputs are so easily generalized[15:57:29] <b0red> hi. I do java -jar gwt-dev-linux.jar, it gives me some info and says: Available main classes: com.google.gwt.dev.GWTShell, com.google.gwt.dev.GWTCompiler. now how can I start one of those?[15:58:34] *** firen has quit IRC[15:58:37] <chillitom> java -cp gwt-dev-linux.jar com.google.gwt.dev.GWTShell[15:58:50] <b0red> tried that already.. it gives me the same help msgs again[15:59:29] *** sombriks has quit IRC[15:59:35] <b0red> oh -cp[16:00:17] <b0red> Shared object "libc.so.6" not found, required by "libswt-pi-gtk-3235.so"[16:00:56] *** conan has quit IRC[16:01:04] <thpar> Hi. Problem with Runtime.getRuntime().exec(some_process) on a Fedora 10 machine. I used to be able to read from the outputstream of the process and send to its std in... since a few days, I can only read... not write anymore...[16:01:10] *** Angel-SL has quit IRC[16:01:17] <chillitom> b0red, why don't you just use the launch scripts?[16:01:19] <b0red> but it's there /usr/compat/linux/lib/libc.so.6[16:01:27] <b0red> chillitom: which ones?[16:01:36] *** hoerup has quit IRC[16:01:37] <chillitom> the ones that come with gwt[16:01:59] <b0red> there are none in gwt-linux-1.5.3[16:02:01] *** bitshuffler has joined ##java[16:02:04] *** _spm_Draget has joined ##java[16:02:09] *** DevInquiry has joined ##Java[16:02:18] <chillitom> applicationCreator makes them for you[16:02:29] *** Junior has joined ##java[16:02:31] <b0red> but i already have my application created[16:02:36] <DevInquiry> ah! XChat in Java for windows, right?[16:02:36] <b0red> (from windows)[16:02:49] <b0red> chillitom: and i'm trying to run it on FreeBSD now[16:03:02] <b0red> chillitom: though i haven't installed the GWT Designer..[16:03:06] <chillitom> it should have created some bat and sh files[16:03:21] <chillitom> have you tried asking in #gwt[16:04:02] <_spm_Draget> Is it possible to define an enum for an int value? I have a debuglevel for my app and I want to be able to compare the value numerically [like 'If (debuglevel > 3) then debug.printblah] but also want my IDe to offer me the levels in a dropdown-box. Is that psosible?[16:04:21] *** brrc has joined ##java[16:04:30] <jottinger> _spm_Draget: note that you can get enums' ordinal values[16:05:17] *** firen has joined ##java[16:05:47] <brrc> hello.. i'm starting in java and i coded this -> http://rafb.net/p/pDZHl179.html[16:06:06] *** t3mp3st_ has joined ##java[16:06:08] <brrc> it only acepts doubles with 2,5 and not 2.5 as an input[16:06:11] <brrc> is it normal ?[16:06:29] <Stephmw> are you using a french locale?[16:06:43] <brrc> french locale ?[16:07:10] <brrc> ?[16:07:22] *** DevInquiry has quit IRC[16:07:56] *** bushwakko has quit IRC[16:08:25] *** nater has joined ##java[16:08:31] <brrc> no[16:08:33] <brrc> maybe portuguese[16:08:38] <brrc> how do i change that ?[16:09:05] *** deepjoy has left ##java[16:09:11] *** B|20CK has quit IRC[16:09:55] *** _spm_Draget has quit IRC[16:10:37] <vol> ~scanner[16:10:37] <javabot> vol, scanner is A simple text scanner which can parse primitive types and strings using regular expressions. A Scanner breaks its input into tokens using a delimiter pattern[16:10:41] <vol> argh, no url.[16:10:47] <vol> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html[16:11:02] <vol> you'll want to set useLocale[16:11:50] *** tissue has quit IRC[16:13:42] *** gdoko has quit IRC[16:14:16] *** b0red has quit IRC[16:14:23] *** kungen has quit IRC[16:16:21] *** romanb has joined ##java[16:16:33] *** waz has quit IRC[16:19:54] *** waz has joined ##java[16:21:58] *** t3mp3st has quit IRC[16:22:17] *** durre has quit IRC[16:23:19] *** mohax has quit IRC[16:25:38] *** pschriner has left ##java[16:26:07] *** pschriner has joined ##java[16:26:57] *** andrewkasper has joined ##java[16:27:18] <brrc> vol thank you very much for you help ?[16:27:19] *** elementz has joined ##java[16:27:34] <brrc> but it's only about the os locale settings ?[16:27:36] <brrc> right ?[16:28:03] <vol> The OS locale setting specifies what the default locale java will use is. You can specify other locales to use.[16:28:28] *** jZep has joined ##java[16:28:58] *** Hink has joined ##java[16:29:54] <jZep> Hello there :). I have wrote a UDP file tranfer app that is working ok in windows. The only problem is that the file is not written when run the app on Linux. Any ideas? Thnx a lot :0[16:30:38] <W_work> jZep: you are probably not handling exceptions properly or there is some other logic error in your program[16:31:38] <jZep> im using FileOutputStream. Its not normal heh?[16:31:51] *** monstrfolk has quit IRC[16:31:57] <W_work> using FileOutputStream is entirely normal[16:32:00] *** Resistance has quit IRC[16:32:08] *** monstrfolk has joined ##java[16:32:20] <jZep> Yes I mean it is not norma to have a problem[16:32:46] <jZep> But its working on windows. Isnt that strange?[16:33:05] <vol> How are you specifying the output file? Remember that linux uses slashes instead of backslashes, are you hard coding backslashes?[16:33:21] *** hoxu has joined ##java[16:33:24] <jZep> hm nice point[16:33:42] <fragalot> don't forget directory permissions[16:33:46] <jZep> but im geting the filenames with the jfilechooser[16:33:46] *** hoxu has left ##java[16:33:56] <jZep> i run it in my home dir :)[16:34:00] <vol> permissions?[16:34:09] <vol> you could be trying to write to a file that doesn't have write permissions[16:34:10] <vol> or a dir[16:34:16] <vol> have you tried debugging?[16:34:23] <jZep> no[16:34:46] <jZep> but you gave me some good ideas :)[16:34:49] <jZep> ty :)[16:34:49] <rdancer> what is the getInstance() good for? why is the Calendar class not just instantiable?[16:35:06] <rdancer> i understand there is some bigger concept behind it, what is it?[16:35:19] <dmlloyd> the concept is "Calendar is a big hairy piece of crap"[16:35:32] <dmlloyd> actually the actual implementations are subclasses of Calendar[16:35:45] <dmlloyd> so e.g. GregorianCalendar[16:35:58] <dmlloyd> JSR-310 is much better in terms of thinking out the API[16:36:07] *** marvs has quit IRC[16:36:16] *** musically_ut has quit IRC[16:36:20] <dmlloyd> granted we'll all be on a new calendar system before it goes final, at this rate :)[16:36:34] * rdancer 's reading JSR-310[16:36:44] <r0bby> is that even gonna make it into java 7?[16:36:49] *** le_biloute has joined ##java[16:38:16] <ilyak> Different calendars are cool as an academic project; however, the problem is that nobody cares[16:38:16] *** mohax has joined ##java[16:38:43] <ilyak> We just want The calendar to work well with days/months/years and stuff[16:42:31] <jottinger> calendars are great,e xcept the world has too many of them[16:42:38] *** jZep has left ##java[16:44:18] <pr3d4t0r> Good morning.[16:44:32] *** ChanServ sets mode: -o pr3d4t0r[16:44:33] <jottinger> hey[16:44:42] *** lem has joined ##java[16:46:53] <AMcBain> ~jsr 310[16:46:54] <javabot> 'JSR 310: Date and Time API' can be found at http://www.jcp.org/en/jsr/detail?id=310[16:46:58] <AMcBain> ah[16:47:15] <jottinger> basically joda-time[16:47:20] <AMcBain> yeah[16:47:30] <jottinger> joda-time doesn't have a hebrew chronology yet, sadly[16:48:57] <pr3d4t0r> jottinger: If it supports the Mayan calendar but not the Hebrew one... I'd go after them.[16:49:08] *** t3mp3st_ has quit IRC[16:49:20] *** arpu has joined ##java[16:49:37] <jottinger> pr3d4t0r: I almost wrote a hebrew chronology for them but decided that it wasn't important enough for what I wanted[16:49:42] <jottinger> shorter path elsewhere[16:52:12] *** juc0 has joined ##java[16:53:06] *** Alterscapes has joined ##java[16:53:17] *** omaru has joined ##java[16:53:44] *** stixz has quit IRC[16:54:32] <dmlloyd> jottinger: I'm 60% sure JSR-310 will have a hebrew calendar - the difficulties surrounding "Adar", "Adar I", and "Adar II" (iirc) were central to discussion for a while[16:54:33] *** sombriks has joined ##java[16:54:44] <dmlloyd> if it doesn't, it will at least support it :)[16:54:52] *** t3mp3st_ has joined ##java[16:55:02] *** rlubke has joined ##java[16:55:21] *** gdoko has joined ##java[16:56:20] <mitch0> damn. it would be so nice if the java persistence query language automatically substituted "is null" in place of x = :x if :x is null ... :([16:57:00] <jottinger> dmlloyd: *nod*[16:59:46] *** xabbuh has quit IRC[17:00:50] *** thpar has quit IRC[17:01:41] *** morkar- has joined ##java[17:01:55] *** mele- has joined ##java[17:09:48] *** ldamwork has quit IRC[17:11:25] <brrc> can any tell me whats wrong with my code -> http://rafb.net/p/eEtf2L81.html[17:11:57] <brrc> is says Error:Error:line (16)unreported exception java.lang.Exception; must be caught or declared to be thrown[17:12:07] <pr3d4t0r> ~tell brrc about your code.[17:12:07] <javabot> brrc, your code is making me ponder what you're up to. You need to see this before we continue: http://tinyurl.com/2pyzae[17:13:02] *** elindio has joined ##java[17:13:11] <brrc> lol[17:13:21] <brrc> pr3d4t0r until that point i know :D[17:13:23] <brrc> hehe[17:13:42] <pr3d4t0r> brrc: Now, you need to either implement try { ... } catch { ... } finally { ... } or you need to throw the exception upward.[17:13:45] *** orgy` has joined ##java[17:14:06] <pr3d4t0r> brrc: Can you please paste that to http://eugeneciurana.com/pastebin ? I can't open rafb.net :([17:14:27] <brrc> ok[17:14:36] <vol> pr3d4t0r: http://eugeneciurana.com/pastebin/pastebin.php?show=40482[17:14:42] <isr`> what does SomeGeneric<? extends SomeClass> mean[17:14:43] <lem> is there something similar in the new javafx distribution to Splitview?[17:14:50] <vol> ~generics[17:14:50] <javabot> For a tutorial on generics, please see http://javachannel.net/wiki/pmwiki.php/Main/Generics[17:14:51] <isr`> the ? extends part[17:14:57] <pr3d4t0r> vol: Thanks.[17:15:09] <vol> ? means "I dunno".[17:15:11] <isr`> vol i know what generics are.[17:15:14] <isr`> oh[17:15:20] <vol> that means some odd class that extends SomeClass[17:15:24] <isr`> so it just means aClass extends SomeClass[17:15:31] <vol> as I understand it yes[17:15:36] <pr3d4t0r> brrc: http://eugeneciurana.com/pastebin/pastebin.php?show=40483 -- this is pretty much all you need.[17:15:37] <isr`> ...[17:15:45] <pr3d4t0r> brrc: But you need to understand why and what it's doing.[17:15:50] *** docmorb has joined ##java[17:15:51] <pr3d4t0r> ~tell brrc about exceptions[17:15:52] <javabot> brrc, exceptions is http://java.sun.com/tutorial/essential/exceptions[17:15:55] <isr`> but i thought you could just put SomeGeneric<SomeClass>[17:16:04] <isr`> or does that depend on the generic type[17:16:13] <pr3d4t0r> brrc: Check that out and ask questions afterward.[17:16:28] <isr`> like, ArrayList<AbstractClass> should be able to hold classes that extend AbstractClass[17:16:33] <brrc> ok[17:16:38] <brrc> i'll check it :d[17:16:39] <brrc> thank you[17:16:41] <brrc> :D[17:16:45] <isr`> or do you have to do ArrayList<? extends AbstractClass>[17:17:39] <vol> isr`: http://java.sun.com/docs/books/tutorial/extra/generics/wildcards.html[17:17:41] *** epalm has joined ##java[17:17:43] <vol> this explains it better than I can[17:17:49] *** l2trace99 has left ##java[17:17:50] <vol> mostly because my brain is mush today[17:17:51] *** musically_ut has joined ##java[17:18:00] <vol> mushy mush mush[17:18:00] *** dpy has quit IRC[17:19:04] <isr`> ahh okay[17:19:05] <isr`> wildcards[17:19:11] <isr`> thanks vol[17:22:42] *** beol has quit IRC[17:24:16] *** ridoo has joined ##java[17:26:52] *** monestri has quit IRC[17:27:33] *** litb has quit IRC[17:29:43] *** shadewind has quit IRC[17:30:05] *** marvs has joined ##java[17:30:49] *** feydr has joined ##java[17:33:01] *** asap18 has joined ##java[17:34:15] *** larmeh_ has joined ##java[17:34:21] <larmeh_> hi there[17:35:03] *** vesz has quit IRC[17:35:07] <larmeh_> is there a way to configure log4j from within my program? i.e. i don't want to read a configuration file such as log4j.properties first[17:35:12] *** mhstif has quit IRC[17:35:32] *** pschriner has left ##java[17:35:44] *** durre has joined ##java[17:35:50] *** mele- has quit IRC[17:36:16] *** BlindHunter has joined ##java[17:36:22] <larmeh_> is this what the PropertySetter is for?[17:37:12] <cheeser> ~tias[17:37:12] <javabot> Try it and see. You learn much more by experimentation than by asking without having even tried.[17:38:35] *** Carnage\ has quit IRC[17:38:49] <svm_invictvs> larmeh_: uh...you just package a log4j in your jar...[17:38:56] *** reval has joined ##java[17:38:58] <larmeh_> that's what i'd like to avoid. experimentation is time consuming and that's what i don't have right now[17:39:29] <cheeser> yeah. learning can suck that way.[17:41:09] *** Ivellina has joined ##java[17:41:55] *** lem has quit IRC[17:42:00] *** B|ackPanther has quit IRC[17:42:25] *** elindio has left ##java[17:42:52] <svm_invictvs> but...there's no experimentation involved.[17:42:56] <svm_invictvs> I just told you how to do it.[17:43:19] <svm_invictvs> You dont' have to load it...[17:43:25] <svm_invictvs> It's loaded by log4j automatically.[17:43:29] <svm_invictvs> When you load up a logger.[17:44:31] <larmeh_> svm_invictvs: thats not what i meant[17:44:47] <larmeh_> i didn't ask how to use it, but how to configure it[17:44:47] *** feydr has left ##java[17:44:54] <reisi> can someone explain why does my console get sometimes warnings from RMI-accept loop, when running with local-only jre6 (under linux, sun-jre6) and using either jconsole or visualVM?[17:45:02] *** _spm_draget has joined ##java[17:45:04] <svm_invictvs> Then you're being exceptionally lazy.[17:45:22] <larmeh_> svm_invictvs: i'm not sure what you're talking about[17:45:30] <_spm_draget> Can anyone recommend a good active java board?[17:45:34] <svm_invictvs> larmeh_: It's realy easy to set up a logger with log4j[17:45:42] <durre> new File(fullPath + fileName).exists() returns false ... but I've verified that the file is actually there. the problem only exist in linux and with swedish characters. but when I do new File(fullPath + fileName).getAbsolutePath() it shows the swedish char properly[17:45:54] *** shadewind has joined ##java[17:46:28] <larmeh_> i know, you just create a logger object, been there... but how do you configure it, e.g. the log format (date, time etc.) without loading this parameter from an external file?[17:46:57] <Ven]n> If I run my method openFile and then click cancel in the dialog box that opens asking for file, I dont get any errors. However, if I select a file, open it and then try to open a new file and press cancel instead, I get a java.lang.NullPointerException. Any ideas? http://rafb.net/p/XKrJN979.html[17:48:33] *** rollins has quit IRC[17:49:08] *** Yustme has joined ##java[17:49:09] <sombriks> which line you got nullpointer?[17:49:16] <Ven]n> playerPanel.remove(p.getVisualComponent());[17:49:48] <Ven]n> heres the full error: http://rafb.net/p/fL1utI36.html[17:49:54] *** Varox has quit IRC[17:50:06] *** omaru has quit IRC[17:50:37] *** omaru has joined ##java[17:51:27] <Ven]n> the first time I press open, p = null, but after I have opened something thats when the IF on line 4 kicks in I believe[17:51:49] *** orgy` has quit IRC[17:53:07] <Alterscapes> so either playerpanel or p.getVisualComponent() is null. My hackish way to debug would be to println the value of both playerPanel and getVisualComponent() and see what's null.[17:53:28] <Ven]n> ill try :p[17:53:51] *** orgy` has joined ##java[17:53:54] <sombriks> p is attribute on your class; maybe it's being changed by another thread when you click several times in the button[17:54:14] *** tag has joined ##java[17:54:43] <sombriks> debug it and just see how many threads changes the p's value[17:55:29] *** rollins has joined ##java[17:55:30] <Ven]n> none of them are null[17:55:37] *** durre has quit IRC[17:56:19] <Ven]n> or wait.. the print on p.getvisualComponent doesnt show[17:57:00] *** Resistance has joined ##java[17:58:00] *** deca has joined ##java[17:58:14] *** luiX_ has joined ##java[17:58:22] <luiX_> hi, someone to help out with a JQL query?[17:58:31] <cheeser> ~anyone[17:58:31] <javabot> Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.[17:59:05] *** Acedip has joined ##java[17:59:32] *** mgenov has quit IRC[18:00:12] <Ven]n> Alterscapes, http://rafb.net/p/ldtRR419.html[18:01:19] <luiX_> i'm trying to get a list of integer values through a JQL query like this: select cp.clientId from ClientPeople cp where cp.personId = 1, where clientId and personId are integers[18:01:36] <luiX_> or the exception the query must be malformed, anyone to help me?[18:02:12] <cheeser> luiX_: so what error are you seeing?[18:03:27] <luiX_> a JPQLException saying: "Error compiling the query [select cp.clientId from ClientPerson cp where cp.personId = :personId]. Unknown abstract schema type [ClientPerson]."[18:04:43] *** popcornPanic has joined ##java[18:04:45] <cheeser> ClientPerson isn't marked with @Entity and/or you don't list it in persistence.xml[18:06:17] *** bushwakko has joined ##java[18:06:54] *** bushwakko has quit IRC[18:07:14] <luiX_> nop, that's not the problem, that's done[18:09:54] <luiX_> any idea?[18:10:57] <Acedip> on the right hand side[18:11:34] <cheeser> luiX_: http://is.gd/jQhW[18:11:52] *** doc`` has quit IRC[18:12:05] *** doc`` has joined ##java[18:13:06] *** [trip] has left ##java[18:13:34] *** durka42 has joined ##java[18:13:44] <brrc> hello i made it but now i would like to make the program stop[18:13:45] <brrc> http://eugeneciurana.com/pastebin/pastebin.php?show=40486[18:13:47] <brrc> and like this[18:13:56] <isr`> System.exit(0)[18:13:57] *** timte has joined ##java[18:13:59] <brrc> or i put the exit and it stops on one exception[18:14:10] <brrc> but i want it to continue[18:14:17] <brrc> and stop with a particular command[18:14:20] <vol> Please don't use System.exit : ([18:14:27] <vol> ever[18:14:33] <brrc> ou ok[18:14:35] <vol> you can just return from main here[18:14:44] *** casmo has joined ##java[18:14:45] <cheeser> using System.exit() is fine[18:15:03] <vol> only if you know it exists in your code[18:15:07] <isr`> vol how would you exit from a graphical app[18:15:08] <cheeser> what?[18:15:09] *** langenberg has joined ##java[18:15:19] <brrc> vol[18:15:27] <brrc> http://eugeneciurana.com/pastebin/pastebin.php?show=40486[18:15:30] *** LordMetroid has quit IRC[18:15:30] <brrc> my program is this[18:15:38] <isr`> whats up cheeser[18:15:39] *** svm_invictvs has quit IRC[18:15:43] <brrc> i know it sucks but it's my first day in this :d[18:15:44] <brrc> hehe[18:16:00] <cheeser> hacking on grizzly. same as most days.[18:16:00] <cheeser> 8^)=[18:16:01] *** svm_invictvs has joined ##java[18:16:05] <vol> yes, I saw.[18:16:17] <vol> You want your program to exit on exception?[18:16:30] <vol> you should probably put lines 31 - 33 inside of the try block[18:16:34] *** dk_schrute has joined ##java[18:16:46] <cheeser> why?[18:17:04] <luiX_> cheeser, you know what? i'm working on netbeans, and you need to make a "clean and make" for that changes you said to be taken in count when running :P[18:17:05] <svm_invictvs> becaues[18:17:06] <luiX_> it sucks[18:17:08] <cheeser> there's nothing there that'd throw one. except for maybe DivByZero[18:17:09] <luiX_> xDDDD[18:17:34] <vol> doesn't parseDouble throw NFE if it hits a character?[18:17:39] <svm_invictvs> Is there a way to get eclipse to stop nagging me about usage statistics?[18:17:40] <cheeser> luiX_: oh, because of file timestamps on the copying of resources[18:17:46] <svm_invictvs> ffs[18:17:49] <svm_invictvs> this is annoying shit.[18:17:54] <cheeser> ~~ svm_invictvs eclipse faq[18:17:54] <javabot> I don't think so. But maybe there's a plugin...[18:18:20] *** docmorb has quit IRC[18:18:32] <AMcBain> svm_invictvs: I think you can tell it to stop sending them.[18:18:38] <AMcBain> (or asking, one of the two)[18:18:56] <svm_invictvs> AMcBain: I told it to just upload automatically but it sees fit to keep pissing me off.[18:19:02] <AMcBain> ah.[18:19:21] <svm_invictvs> "You keep hitting it, Shake."[18:19:23] <AMcBain> I had to tell mine twice to stop asking me, then it finally got the point and stopped popping the dialog.[18:19:27] <svm_invictvs> "BECAUSE IT KEEPS PISSING ME OFF!"[18:19:31] *** Resistance has quit IRC[18:19:40] <cheeser> you'll have to build from source, i think.[18:19:45] *** thefalling has joined ##java[18:19:49] <thefalling> If i want to move a JLabel over another widget, how do i make it print on top of that widget, rather than be hidden under?[18:20:56] *** consmash has joined ##java[18:21:15] <luiX_> cheeser, didn't get " on the copying of resources" but i make an idea.... :P[18:21:16] <luiX_> xDDDD[18:21:40] <cheeser> if the dest file is "newer" than the source, then it's not copied[18:21:41] *** MisterN has joined ##java[18:23:11] <consmash> got a problem with understanding of memory-mapped files[18:23:22] <jottinger> consmash: no, I don't.[18:23:26] <luiX_> cheeser, ouch, didn't know[18:23:27] *** patintin has joined ##java[18:23:29] <jottinger> but thanks for asking.[18:23:43] <cheeser> luiX_: it's a build-time optimization to reduce unnecessary work[18:24:11] *** teralaser has quit IRC[18:24:12] <consmash> jottinger: very well, then you'll be the first to answer ;)[18:24:30] <svm_invictvs> You think after all these years that sun would have made some Windows shell extension so that executable jar files show up with their own icon and you don't have to associate the files yourself.[18:24:49] *** SportChick has quit IRC[18:24:51] <jottinger> consmash: there was a question?[18:25:07] *** kibibyte has quit IRC[18:25:28] *** SportChick has joined ##java[18:25:44] <consmash> b.eckel says that they boost the performance by reading only a part of file to memory, but afaik DataInputStream also doesnt read a full file into memory so what's the point?[18:26:05] <reverend> svm_invictvs: the jre does that as far as i can tell[18:26:18] <svm_invictvs> does it?[18:26:21] <jottinger> consmash: you realise that tuning stuff like that is kinda in-depth[18:26:39] <svm_invictvs> To be fair, I usually install the jdk.[18:26:47] <patintin> is there a way to set an applet an unsigned one?[18:27:09] <consmash> jottinger: yeah, i know i just want to understand a difference[18:27:41] <patintin> that means, when you download an applet from a web server, you don't get the pop-up window to confirm for security?[18:28:23] <svm_invictvs> patintin: Sign it.[18:28:45] <jottinger> consmash: mostly degree and manual control.[18:29:29] <patintin> svm_invictvs: is there a way not to sign it and when you download the applet, you will not get the pop-up window?[18:29:37] <jottinger> patintin: nope[18:29:40] <jottinger> that's what the popup is for[18:29:43] <jottinger> "this is not signed"[18:29:54] <jottinger> if you could circumvent it, then ... err...[18:30:29] <patintin> is there a way on an applet not to have this message?[18:30:41] * jottinger sighs[18:30:45] <jottinger> yes. Sign the applet.[18:30:58] <patintin> ok[18:31:47] *** b3nn3tt has joined ##java[18:31:48] <svm_invictvs> jottinger: Is there a way I can leave my house unlocked, but make sure nobody breaks in? I mean, I don't wanna deal with the hassle of keys.[18:32:00] <jottinger> svm_invictvs: buy a dog.[18:32:05] *** amnesiac has joined ##java[18:32:08] <jottinger> but yes, I get the analogy :)[18:32:09] <patintin> so, it's ok to have it self-signed not to do it through a commercial ca cert?[18:32:24] <vol> It's signed. You just may not be trustworthy.[18:32:24] <svm_invictvs> commercial...[18:32:40] <AMcBain> dog? the little ones that just sit there scared and piss on the rug when something happens?[18:32:50] <jottinger> AMcBain: depends on the dog, really[18:32:55] <svm_invictvs> patintin: Are you just doing it for testing?[18:33:11] <patintin> svm_invictvs: for now, yes[18:33:24] <svm_invictvs> You can self sign and add yourself as a CA for testing.[18:33:52] <patintin> svm_invictvs: i see..[18:33:58] <patintin> ok.. thanks guys.. ;)[18:34:08] <patintin> sorry for the newbie questions[18:34:43] *** agnul has quit IRC[18:34:52] <consmash> eckel writes 4e6 ints into a file, then he reads them with DataInputStream[BufferedInputStream].readInt() next he reads with IntBuffer.get() and the difference comes out to be ten times faster[18:36:11] *** MigoMipo has joined ##java[18:38:28] *** medjr||afk has joined ##java[18:38:30] <consmash> jottinger: do you know how it works so without any tuning?[18:39:08] <medjr||afk> does anybody know something about asterisk-java[18:39:09] <medjr||afk> ???[18:39:17] <svm_invictvs> patintin: I had a similar problem. We were deploying web start apps on a closed network and The Boss thought that spending $200.00 every 4 years was just outrageous.[18:39:38] <svm_invictvs> But was equally outraged by the warning message.[18:39:40] *** KikiJiki has quit IRC[18:40:15] *** patintin has quit IRC[18:40:42] <cheeser> custom certs++[18:41:24] <svm_invictvs> The actual solution was far less sophisticated.[18:41:27] <svm_invictvs> (spelling?)[18:41:49] *** wfq has quit IRC[18:41:52] <svm_invictvs> It involved instructing the install techs to run the program once and then add the exception so the end users weren't freaked out.[18:41:58] *** medjr||afk has left ##java[18:42:07] *** smke is now known as smke|aw[18:42:14] <svm_invictvs> Thus defeating the purpose of a web start application.[18:43:47] <AMcBain> haha[18:44:38] <cheeser> what about upgrades, though. did you have to go through that again ?[18:44:50] <svm_invictvs> SO the first time somebody wanted ot use it, everybody was instructed to call a technician and ask them to install it.[18:45:04] <brrc> vol thank you very much[18:45:20] *** isr` has left ##java[18:45:23] <svm_invictvs> The techs were biomedical engineers.[18:45:24] <brrc> but i don't want it to exit at exception i wanna have a particular word like end[18:45:31] <brrc> or exit or something[18:45:42] <svm_invictvs> Because technically it was "clinical" equipment.[18:45:53] <svm_invictvs> Because it was installed on a nurse's workstation[18:45:57] <_W_> svm_invictvs, sounds like a lovely place to work[18:46:14] *** lokedk has joined ##java[18:46:31] <svm_invictvs> _W_: I didn't work there, it wa sproduct sold to hospitals.[18:47:06] *** reval has quit IRC[18:47:58] <EdwardIII> biomedical engineers clicking 'yes' and adding a cert? i like it[18:48:03] <svm_invictvs> yeah[18:48:38] <jottinger> I'm doing clinical stuff, woot[18:49:26] *** tomvolek has joined ##java[18:49:44] <svm_invictvs> I honestly dont' know how it was eventually deployed. I quit right before the product was shipped.[18:49:55] <svm_invictvs> But, i had to explain all this to everybody.[18:50:13] *** larmeh_ has quit IRC[18:50:37] <EdwardIII> it's a funny story - what country, svm_invictvs?[18:50:41] <svm_invictvs> US[18:50:52] *** Acedip has left ##java[18:50:55] <svm_invictvs> EdwardIII: why do you ask?[18:51:00] <EdwardIII> ooooo private healthcare? $200/4 years is nothing, surely? heh[18:51:02] <EdwardIII> just curious[18:51:06] <svm_invictvs> Yeah[18:51:08] <svm_invictvs> I know.[18:51:22] <svm_invictvs> Considering that the cert is good forever.[18:51:27] *** zubeen has joined ##java[18:51:38] <svm_invictvs> Once you sign the app, that cert should always be valid, iirc.[18:52:01] <EdwardIII> hmm[18:52:01] <AMcBain> people who tend to be the stereo-typical boss don't like to spend money, want a bigger salary, and don't understand much :P[18:52:11] <EdwardIII> i don't know a CA root authority who signs certificates forever?[18:52:24] <EdwardIII> surely they'd be doing themselves out of a recurring sale heh?[18:53:19] <svm_invictvs> AMcBain: He was a dipshit, his whole team ended up walking out on him[18:53:33] <AMcBain> ah yeah[18:53:44] <svm_invictvs> He was known as "Captain Asshole"[18:53:44] <EdwardIII> i've heard it said a number of times that people who end up in management positions could be described as pathological[18:53:48] <zubeen> hey.. can anyone help me with a link to my first java tutorial?[18:53:52] <svm_invictvs> And everybody would call him "Captain" to his face.[18:53:57] <AMcBain> nice[18:53:59] <cheeser> ~~ zubeen anyone[18:53:59] <javabot> Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.[18:54:06] <zubeen> i have worked on c++[18:54:17] <EdwardIII> zubeen: i just followed the java books tutorial - seemed pretty good to me. contains code examples[18:54:31] <svm_invictvs> EdwardIII: "Time-stamping service provided, allowing distribution of signed code beyond certificate expiration"[18:54:32] <EdwardIII> http://java.sun.com/docs/books/tutorial/[18:54:36] <sombriks> ~~ zubeen rbi[18:54:37] <javabot> zubeen, reallybigindex is http://java.sun.com/docs/books/tutorial/reallybigindex.html[18:54:41] <zubeen> EdwardIII: thanks[18:54:42] <zubeen> k[18:54:43] <sombriks> that's the big one[18:54:55] <cheeser> http://www.javatutorials.com/[18:54:56] <zubeen> thanks..[18:55:01] <cheeser> dunno how good those are[18:55:02] <EdwardIII> hrm well there you go, i guess it's specific to software dev - i'm mostly used to SSL for websites[18:55:49] <zubeen> can anyone suggest a good ide on linux for java?[18:56:25] <cheeser> ~~ zubeen newbie ide[18:56:25] <javabot> Newbies shouldn't start with IDEs. It's important to learn the environment and fundamentals of a language before offloading those to an IDE. Learn about packages and imports and classpaths. Learn how to compile and use the JDK tools. Get some basic grasp of the API layout. Learn how to do things then switch to an IDE to do them faster. See http://tinyurl.com/yvks48 and and http://tinyurl.com/2cpn6o for more info.[18:56:59] <sombriks> go with geany or kate for now zubeen;[18:57:13] <zubeen> sombirks thanks[18:57:19] <sombriks> also take carefully each stacktrace in your fist steps.[18:57:21] <zubeen> cheeser thanks for the motivation[18:57:23] <sombriks> *first[18:57:24] <ernimril> sombriks: if you got to use a text editor why not use vim or emacs?[18:57:31] <sombriks> ;)[18:57:33] <svm_invictvs> jedit, vim[18:57:38] <svm_invictvs> or good old notepad.[18:57:45] <sombriks> i like ladies names for code editors[18:57:54] <svm_invictvs> kate?[18:57:56] * EdwardIII is using vim with syntax highlightong on and smart indenting[18:58:02] <svm_invictvs> kate is an abbreviation.[18:58:06] <sombriks> :)[18:58:08] <svm_invictvs> KDE Advanced Text Editor[18:58:09] <cheeser> for katherine[18:58:11] <cheeser> 8^)=[18:58:23] <svm_invictvs> ugh[18:58:28] <svm_invictvs> I hate women whose names begin wiht "k"[18:58:34] <EdwardIII> bad experience?[18:58:37] <svm_invictvs> 'cept Kim[18:58:38] <svm_invictvs> yeah[18:58:42] <EdwardIII> me too[18:58:43] <svm_invictvs> EdwardIII: yeah...[18:58:53] *** ycy has quit IRC[18:58:53] <EdwardIII> let's write some java[18:59:30] *** Ivellina has quit IRC[18:59:55] *** KermitTheFragger has quit IRC[19:00:46] *** ridoo has quit IRC[19:05:44] *** Gracenotes has joined ##java[19:07:37] *** monkeycid has quit IRC[19:08:20] *** Carnage\ has joined ##java[19:09:55] *** gdoko has quit IRC[19:10:24] *** valcker has quit IRC[19:14:06] *** xenoterracide has joined ##java[19:14:26] <xenoterracide> I hate to ask a stupid question. but jar files are java's version of shared libraries right?[19:15:04] <cheeser> one of them, yes.[19:15:19] <ernimril> xenoterracide: depending on the answer you want you can pick either yes or no[19:15:27] <cheeser> heh[19:16:01] *** em_pleh has joined ##java[19:16:09] <em_pleh> hello[19:16:14] <xenoterracide> oh I wish I knew what answer I wanted...[19:16:17] <ernimril> xenoterracide: A class is more like a .dll/.so, you can load it and use its method, a jar is more like a full set of .so/.dll[19:16:29] <xenoterracide> ah[19:17:06] <xenoterracide> I'm in a debate with some java programmers about there fork of some foss jar files that apparently there open source project depends on[19:17:20] <em_pleh> i created a class http://mibbit.com/pb/ol1wQO and when i try to create an array of it "private menuItem menuItems[5];" i get ']' expected[19:17:26] <xenoterracide> and I'm trying to explain why distro's would want to use upstreams versions[19:17:30] *** gflash has joined ##java[19:17:49] <cheeser> em_pleh: take out the 5[19:17:59] <cheeser> you don't spcify the size in the type declaration[19:17:59] <em_pleh> ok[19:18:18] <cheeser> ~~ em_pleh arrays[19:18:18] <javabot> em_pleh, arrays is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html[19:18:46] <em_pleh> http://mibbit.com/pb/4CN7Ow so this is my code without the 5 and it fails at menuItems[i]=m_Item;[19:18:58] <gflash> hello, i have a problem: I try to import javax.comm.*, but it seems not to be there; how can i install it?[19:19:25] *** isr` has joined ##java[19:19:31] <cheeser> gflash: get that jar[19:19:40] <cheeser> gflash: and don't use * imports[19:20:15] <em_pleh> oh i was it because i did not have menuItems = new menuItem[9]; ?[19:20:26] *** ciaron has joined ##java[19:21:01] <gflash> cheeser: thanks, but where to get it? on the sun homepage i have to use some download tool i don't want to install[19:21:15] <cheeser> you download it from sun[19:21:24] <gflash> cheeser: what is the file name? then i can google[19:21:45] *** durka42 has left ##java[19:21:46] <EdwardIII> cheeser: don't use * imports?[19:21:48] <cheeser> i have no idea[19:21:50] <cheeser> EdwardIII: correct[19:21:54] <EdwardIII> ever?[19:22:21] <cheeser> yes[19:22:28] <EdwardIII> why? code readability?[19:22:36] <EdwardIII> ~don't use *[19:22:37] <javabot> EdwardIII, I have no idea what don't use * is.[19:22:39] <cheeser> ~* imports[19:22:39] <javabot> cheeser, star imports is http://en.wikibooks.org/wiki/Java_Programming/StarImports[19:22:40] <ernimril> gflash: not sure there are any good alternatives, try the gnu version rxtx[19:22:41] <EdwardIII> heh ok[19:22:51] <cheeser> that covers some of it.[19:23:20] <cheeser> we had som epoor sod in here the other day that expected his * import to recursively import every class in a package[19:23:26] <isr`> cheeser: what the heck is a jfraim[19:23:34] <gflash> ernimril: just found it, too. but installinge the package from my distribution didn't work[19:23:45] <cheeser> isr`: why the hell are you asking me?[19:23:55] <isr`> oh nevermind[19:24:08] <EdwardIII> i see, enlightened[19:24:12] <isr`> it was an example[19:24:24] <xenoterracide> cheeser: do jar files usually/ever contain the source to build them?[19:24:33] <isr`> cheeser: because i figure, as the grumpiest member of ##java, you may know the most[19:24:34] <cheeser> xenoterracide: sometimes[19:24:44] <cheeser> oh, i'm far from the grumpiest[19:24:48] <isr`> bs[19:24:52] <isr`> who's the grumpiest then[19:24:59] <cheeser> i just have the most ability to project what grump i have[19:25:00] <cheeser> 8^)=[19:27:46] *** GunZ has joined ##java[19:28:20] <isr`> you certainly do[19:29:00] <jottinger> al right, guys, you need to hit my new article on TSS a lot :)[19:29:09] *** AskHL has joined ##java[19:29:11] <selckin> more linking then[19:29:33] <jottinger> ~be jottinger[19:29:34] <javabot> Everybody dies, and that's yumm-o.[19:29:43] <jottinger> cheeser is NOT the grumpiest person in ##java[19:29:54] <jottinger> he's far from the curmudgeonliestlike[19:30:12] <cheeser> isr`: what you see as grump is more protection of ##java than anything else.[19:30:16] *** ankylose has joined ##java[19:30:25] <EdwardIII> ~be cheeser[19:30:25] <javabot> how is this java?[19:30:30] <cheeser> i don't want a repeat of efnet's #java, e.g.[19:30:32] <jottinger> ~be jottinger[19:30:32] <javabot> Kindness is a lie.[19:30:44] <EdwardIII> heh does he pick random comments from that channel member?[19:30:48] <EdwardIII> ~be EdwardIII[19:30:48] <javabot> EdwardIII, I have no idea what be EdwardIII is.[19:30:52] <EdwardIII> pffff[19:30:58] <jottinger> well, see, we've had a screenfull of text without reference to body functions, so it's better than EFnet #java already[19:31:04] <cheeser> and with 300+ people, if we don't keep it close to on topic, things get pretty muddled rather quickly[19:31:34] *** musically_ut has quit IRC[19:31:36] *** quarsaw has joined ##java[19:31:41] *** teralaser has joined ##java[19:32:22] *** mgenov has joined ##java[19:33:04] *** t3mp3st_ has quit IRC[19:33:34] <sombriks> ~be sombriks is programmer[19:33:34] <javabot> Okay, sombriks.[19:33:39] <sombriks> ~be sombriks[19:33:39] <javabot> sombriks, be sombriks is programmer[19:34:22] *** GunZ has quit IRC[19:34:45] <thefalling> Is there a way to throw a jlabel in the same location as another container, but make have the jlabel be drawn on the screen last?[19:35:17] <Levia> Anyone know why a JTextPAne resizes to show it's complete contents, while it is wrapped in a JScrollPane, which should start showing scrollbars? It does show scrollbars, but then it suddenly switches to the JTextPane resizing to show all of it's contents[19:36:01] *** convivial has quit IRC[19:36:37] *** mitchnull has joined ##java[19:37:08] *** Gracenotes has quit IRC[19:37:23] <isr`> protecting ##java from me?[19:38:23] <isr`> hmm[19:38:29] <isr`> isr`-- is broken[19:38:34] <isr`> err[19:38:40] <isr`> nevermind. i wont break it[19:38:45] <isr`> i wonder if it would break it though[19:39:51] <isr`> Levia: did you set a preferred size?[19:39:56] <EdwardIII> in #perl someone tried to get the expression-evaluation bot to fopen /etc/passwd, was geek-funny[19:40:06] *** UK-sHaDoW has joined ##java[19:40:33] <Levia> isr`: no, but the problem is, is that I want it to remain compatible for other resolutions. preferred size is an idea though, hold on ill try it[19:41:13] *** njan is now known as james[19:41:15] <isr`> Levia: and did you put the text box inside a JScrollPane?[19:41:30] <Levia> isr`: yes.[19:42:08] *** james is now known as njan[19:42:20] <Levia> isr`: what happens is, actually, the frame seems to resize[19:42:25] <Levia> maybe that's what's happening[19:42:44] <Levia> it justs gets bigger, as in higher (or lower). so big that I can't see the bottom anymore[19:43:24] <isr`> hm[19:43:27] <isr`> thats really odd[19:43:31] <Levia> then it just doesn't know what to do[19:43:31] *** Gracenotes has joined ##java[19:43:36] <Levia> it adds a scrollbar, and removes it again[19:43:38] <isr`> i haven't been using swing for that long though[19:43:39] <Levia> and keeps going[19:43:47] <isr`> sounds pretty messed up to me[19:43:58] <Levia> yeah :S[19:44:07] <Levia> but it's fine on Mac OSX. I'm testing it on linux[19:44:10] <Levia> and works on windows too[19:44:54] *** hydrogenated has joined ##java[19:45:12] *** hydrogenated has left ##java[19:45:21] *** FauxFaux has quit IRC[19:45:24] *** consmash has quit IRC[19:47:25] <EdwardIII> hrm very very simple stuff here, but the docs say that the compiler automatically imports "the current package (the package for the current file). " - so i'm building Feed.class first, then EddFeedReader requires that to create a Feed object: http://pastebin.com/d7cca8366[19:47:54] <jottinger> errr... what?[19:48:23] <jottinger> it doesn't automatically import it, it's just available in the compilation unit[19:48:48] *** TooAngel has joined ##java[19:48:58] <EdwardIII> they both belong to package 'madduck'. Feed.java makes Feed.class no problem but then the compiler won't create a Feed object when i try to in EddFeedReader.java[19:49:29] <EdwardIII> jottinger: maybe i'm misunderstanding it? the whole line: "For convenience, the Java compiler automatically imports three entire packages for each source file: (1) the package with no name, (2) the java.lang package, and (3) the current package (the package for the current file). " from http://java.sun.com/docs/books/tutorial/java/package/usepkgs.html[19:49:38] <jottinger> EdwardIII: with what message?[19:49:57] *** FauxFaux has joined ##java[19:50:22] <EdwardIII> http://pastebin.com/d535b8c86[19:50:32] <ciaron> can anyone recomment a java driven cms?[19:50:39] <EdwardIII> i'm sure i'm just doing something uberfoolish[19:51:00] <jottinger> ciaron: alfresco, magnolia, Sling[19:51:31] <csgeek> I'm trying to prevent a JFrame from being resized.. I set the MaximumSize and it still lets me resize it.. anything else I'm missing?[19:51:32] <ciaron> jottinger: cool cheers, and your favourite out of those 3?[19:51:39] <jottinger> EdwardIII: paste the code for the classes[19:51:45] <jottinger> ciaron: Mine? errr... sling[19:51:49] <Alterscapes> csgeek: JFrame.setResizable(false); ?[19:52:30] <EdwardIII> jottinger: sure let me just set that up - it is going to be very upsetting, i'm very new to the java game and this is very early stage stuff, just a bit of an exercise[19:52:47] <csgeek> well.. that just makes way too much sense...[19:52:48] <csgeek> :P[19:52:52] <csgeek> thanks Alterscapes[19:52:59] *** indeterminatus has quit IRC[19:53:51] <EdwardIII> ah, figured it out - it was super stupidness[19:54:05] <EdwardIII> jottinger: i had my constructor returning 'void'[19:54:07] <jottinger> ~sling[19:54:07] <javabot> Apache Sling is an application that basically gives you a view into a CMS, held in a java content repository. You can use filters to dress up the content and reformat it if necessary. Great stuff. http://incubator.apache.org/sling/site/index.html[19:54:12] <jottinger> EdwardIII: then it wasn't a constructor :)[19:54:13] *** dmead has quit IRC[19:54:18] * cheeser nods.[19:54:43] <EdwardIII> jottinger: right[19:54:46] <jottinger> EdwardIII: but good for you that you figured it out[19:54:50] <EdwardIII> thanks![19:55:08] <jottinger> better than a lot of the homework-driven 'tards in here[19:55:18] * cheeser nods.[19:55:51] <EdwardIII> i guess java is the most common academicly taught language? certainly seems that way here in the UK[19:56:13] <cheeser> one of them at least[19:56:17] <cheeser> for better and for worse[19:56:48] <EdwardIII> well Sun apparently do jaw-dropping discounts for the academic institutions in the UK on software and hardware[19:57:45] *** musically_ut has joined ##java[19:58:41] *** TooAngel has left ##java[19:58:58] *** Goundy has joined ##java[19:59:51] *** convivial has joined ##java[20:00:22] *** CSSipi has quit IRC[20:00:23] *** t3mp3st has joined ##java[20:00:41] *** Varox has joined ##java[20:02:22] *** Elvanor has joined ##java[20:02:46] <Elvanor> How can I convert a ByteArrayOutputStream to a ByteArrayInputStream[20:02:59] <Elvanor> eg, I copied all my data to the outputstream, now I need to reread it[20:03:04] <cheeser> read from one and write to the other[20:03:14] *** SinisterBen has quit IRC[20:03:23] *** SinisterBen has joined ##java[20:03:27] <cheeser> ~download[20:03:27] <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/[20:04:07] <Elvanor> I cannot write to the InputStream, so what do you mean?[20:04:15] *** SinisterBen has quit IRC[20:04:25] *** SinisterBen has joined ##java[20:04:53] *** SinisterBen has joined ##java[20:04:57] <Elvanor> The only way seems to use toByteArray() on the output stream and create a new input stream with that buffer[20:05:00] <Elvanor> Am I correct?[20:05:16] *** spathi has quit IRC[20:06:19] *** chrismaster1 has joined ##java[20:06:34] <cheeser> sure. tias.[20:06:37] *** xenoterracide has left ##java[20:06:55] <Elvanor> I can try it, I think it will work, just wondering if there would be a better way[20:07:05] <Elvanor> as this would need the allocation of a new buffer[20:07:19] <Elvanor> (the one from the outputstream cannot be reused as is??)[20:07:42] <cheeser> 1. get it working. 2. optimize if necessary[20:08:31] <EdwardIII> seems like you guys are big advocates of doing it the dirty way then refactor afterwards? i guess if you're very new (as i am) that's the best way to go[20:08:35] <jottinger> ~cheeser++[20:08:36] <javabot> cheeser has a karma level of 610, jottinger[20:08:45] <jottinger> EdwardIII: not "the dirty way"[20:08:50] <EdwardIII> ~cheeser++[20:08:50] <javabot> cheeser has a karma level of 611, EdwardIII[20:08:59] <Elvanor> I know for sure that I wont need optimization here, but just curious *what* would be the optimization[20:09:06] <EdwardIII> ~jottinger++[20:09:06] <javabot> jottinger has a karma level of 238, EdwardIII[20:11:02] *** squi has quit IRC[20:11:10] *** squi has joined ##java[20:11:44] *** lami1984 has joined ##java[20:11:49] <lami1984> hello[20:12:03] *** gflash has left ##java[20:13:27] *** Seldon75 has joined ##java[20:14:19] <Seldon75> all your base are belong to me[20:15:20] <EdwardIII> i hardly think so[20:15:22] *** q2dm1 has joined ##java[20:15:39] *** Alterscapes has quit IRC[20:16:20] *** foo-nix has quit IRC[20:16:25] <q2dm1> hey can anyone tell me how JScrollBar intercepts mouse events when the mouse cursor isnt exactly over the control?[20:17:24] *** tag has quit IRC[20:17:53] *** krad has joined ##java[20:18:01] <krad> hi. can you do non-blocking sockets in Java[20:18:32] *** Goundy has quit IRC[20:18:36] <alvin_3> what is the proper syntax to add stuff to String?[20:18:39] <alvin_3> String test = '';[20:18:46] <krad> +=[20:18:48] <alvin_3> can i do test +='good'?[20:18:51] <alvin_3> krad[20:18:52] <krad> or use StringBuffer[20:18:58] <alvin_3> krad: thx[20:19:02] <benJIman> or StringBuilder as StringBuffer is olde.[20:19:10] <q2dm1> you need to use " though[20:19:11] <q2dm1> not '[20:19:18] <krad> one's methods are synchronized the others are not[20:19:26] <selckin> what's the easiest way to achieve auto-updating without restarting, would using osgi be overkill?[20:19:26] <krad> other*[20:19:44] <EdwardIII> mmm alvin_3 i'm also willing to bet that depending on the context it may be better to use a StringBuilder rather than String += "my string"[20:19:57] <Seldon75> selckin: thats what we use Knopflerfish for[20:20:22] <jottinger> ew[20:20:34] <jottinger> knopflerfish is icky compared to felix and equinox :)[20:20:41] <Seldon75> krad: += is no different to using StringBuffer or Builder anymore I believe[20:20:56] <cheeser> ~felix++[20:20:57] <javabot> felix has a karma level of 1, cheeser[20:21:11] <cheeser> Seldon75: it is different in some cases[20:21:12] <jottinger> Felix is growing on me, like a fungus[20:21:24] <Seldon75> actually right now I have a strange problem occurring in my Knpflerfish application - when I try to run it on Vista 64-bit I get a NullPointerException in sun.swing.table.DefaultTableCellRenderer.getColumnSortOrder()[20:21:27] <cheeser> i like the lack of eclipse encumberances[20:21:37] <Seldon75> its ok in other versions of windze[20:21:41] <jottinger> The admin console isn't as good but it's doable[20:22:07] <EdwardIII> Seldon75: really? in .NET if you're using += instead of a stringbuilder inside of a loop or something FxCop will warn you that a SB is faster and uses less memory[20:22:09] <Seldon75> jottinger: do you have specific complaints regarding KF vs. the others[20:22:14] <cheeser> felix is the default container for glassfish, iirc[20:22:34] <Seldon75> EdwardIII: it used to be that way in Java but they 'fixed' string concatenation somewhat[20:22:39] <krad> can we do non-blocking sockets in Java[20:22:45] <Seldon75> krad: nio[20:22:46] <cheeser> ~nio[20:22:47] <javabot> cheeser, nio is http://java.sun.com/javase/6/docs/technotes/guides/io/example/index.html and http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf[20:22:55] <cheeser> ~grizzly[20:22:55] <javabot> cheeser, grizzly is a framework to build scalable and robust server applications using nio. Grizzly is used in GlassFish and SJSAS PE 8.1. For more information see https://grizzly.dev.java.net/ or see Jean-Francois Arcand's blog: http://weblogs.java.net/blog/jfarcand/archive/2005/06/grizzly_an_http.html[20:22:57] <cheeser> 8^)=[20:22:58] <EdwardIII> Seldon75: oh ok cool[20:23:04] <jottinger> Seldon75: I just found the others more pleasant to work with, honestly - felix and equinox were nicer than prosyst, too[20:23:04] *** spathi has joined ##java[20:23:43] *** osmosis has joined ##java[20:23:47] <krad> you refering to SocketChannel?[20:24:01] <Seldon75> cheeser: is there a reference you can point us to regarding the cases where += is different to using a SB?[20:24:19] <cheeser> not that i know of[20:24:21] <q2dm1> no swing gurus here?[20:24:38] <jottinger> in java6, there's not any difference, with sync elision[20:24:39] <Seldon75> jottinger: damn, I was hoping for something meaty that I could present to our PM to free us from KF[20:24:50] <jottinger> Seldon75: user friendliness is important[20:25:02] <csgeek> java supports .png for Icons?[20:25:07] <cheeser> Seldon75: http://www.antwerkz.com/string-concatenation-options/[20:25:09] <csgeek> or.. Button Images that is[20:25:10] <jottinger> just wait until I get genuitec to do soemthing with pulse and you'll have an option[20:25:12] <Seldon75> jottinger: problem is our app is meant to have no GUI[20:25:18] <cheeser> a little write up i did a couple of weeks ago.[20:25:28] <Seldon75> cheeser: ta[20:25:33] <EdwardIII> seems like an awful lot of the questions in here are swing related - when i've finished my dodgy command-line version of this dodgy feedreader i might experiment by creating another version in swing[20:25:53] <cheeser> now, those numbers might shift when the String is being built up across loop iterrations rather than created/destroyed each time[20:26:10] <jottinger> Seldon75: genuitec doesn't need a GUI either[20:26:22] *** Carnage\ has quit IRC[20:26:58] <Seldon75> jottinger: that's good; I just meant I cant use that as an argument with my PM ;S[20:27:08] <jottinger> I know[20:27:15] <Seldon75> k[20:27:21] <jottinger> I'd have to crank up knopflerfish again to recall what it was that annoyed me so much[20:27:22] <cheeser> PMs should never drive technological decisions.[20:27:29] <EdwardIII> what's a PM?[20:27:35] <Seldon75> project manager[20:27:39] <EdwardIII> ah, happy days[20:27:59] <krad> getByes![20:28:45] <Seldon75> cheeser: this is a PM/team lead[20:29:02] <Seldon75> small co.[20:29:05] <cheeser> ah[20:29:17] <jottinger> what drove him to knopflerfish in the first place?[20:29:17] <Seldon75> I should have said team lead[20:29:19] <cheeser> i used to be in that role, too, at my last gig.[20:29:29] <cheeser> jottinger: dire straits fan[20:29:36] <krad> what's the diff between PM and team leader?[20:29:42] <Seldon75> the decision was made between him and another architect before I came to the project[20:29:46] <jottinger> ooo, knopflerfish had a new release in december[20:30:03] <waz> krad: depends almost wholly on the company[20:30:04] <EdwardIII> haha[20:30:07] <waz> many times none[20:30:25] <krad> do companies suck in general[20:30:30] <jottinger> krad: yes[20:30:37] <jottinger> they never deliver when they promise you a macbook[20:30:43] <Seldon75> ha[20:30:58] <krad> i hate companies[20:30:59] <Seldon75> ssh! i bet a lot of the pople here are LLCs[20:31:07] <Seldon75> people*[20:31:10] <krad> what's this new term[20:31:37] <jottinger> Seldon75: ... whoa, knopflerfish has some new capabilities I didn't know about[20:32:01] <Seldon75> jottinger: yeah well to make matters worse we're on an ancient revision[20:32:30] <krad> how is non blocking socket implemented in Java, does it use C's poll/select[20:32:38] <Seldon75> LLC = limited liability companies; often a 'sole trader' or self-employed[20:32:57] <ernimril> krad: no...[20:33:07] <ernimril> krad: it uses epoll/kpoll/<similar>[20:33:10] *** vix85 has joined ##java[20:33:19] <ernimril> krad: (that is the efficient version of poll/select depending on your OS)[20:33:20] <krad> ernimril, but not all of these are available on all systems[20:33:29] <Seldon75> companies are great if you hate liability and hate tax[20:33:29] <krad> yup[20:33:30] <krad> ok i see[20:34:08] *** nmatrix9 has joined ##java[20:34:24] <Elvanor> I am using readLine() on an input stream, if it returns -1 how can I know how much characters were read?[20:34:43] <dmlloyd> inputstream doesn't have readLine[20:34:54] <isr`> Elvanor: why dont you use a Scanner?[20:35:03] *** q2dm1 has left ##java[20:35:11] <Elvanor> dmlloyd: ServletInputStream does.[20:35:18] <dmlloyd> don't use that[20:35:25] *** paulweb515_ has joined ##java[20:35:25] <dmlloyd> if you want readLine, use a Reader[20:35:27] <jottinger> Seldon75: which rev are you using?[20:35:34] <jottinger> and what tools do you use for doing OSGi?[20:35:52] <Elvanor> dmlloyd: I cannot use a reader, I am rading binary data[20:35:54] <ernimril> Elvanor: you can not ask a general inputstream how many bytes you have read, but you can do it for a few specialized streams and you can write your own counting stream[20:36:03] <dmlloyd> Elvanor: then you can't use readLine() either[20:36:12] *** Goundy has joined ##java[20:36:45] <Elvanor> dmlloyd: I am actually trying to implement something we discussed (you and I) a few monthes back. but you probably dont remember[20:37:02] <Elvanor> I need to scan a ServletRequest to get its encoding in a Filter[20:37:12] <krad> i hate java input/output streams, they're too complicated compared to the way C/C++ deals with io read/write[20:37:18] *** lami1984 has quit IRC[20:37:22] * jottinger blinks at krad[20:37:23] <Seldon75> jottinger: rev 1.3;. time to update[20:37:29] <jottinger> Seldon75: heh[20:37:34] *** NiallC has quit IRC[20:37:44] <Elvanor> I would have though C++ I/O is even harder... both confuse me actually.[20:37:59] <krad> C's the best[20:37:59] <Elvanor> But I think this is largely due to the fact I am not an english native speaker so names dont speak to me[20:38:05] <krad> for these things, in my opinion[20:38:06] <dmlloyd> Elvanor: you could use a BufferedInputStream with mark() support, read a big chunk of the data, put it into a buffer, and use Charset to auto-detect[20:38:07] <Elvanor> streams etc[20:38:26] <dmlloyd> Elvanor: then rewind it back to the start, wrap it in the right Reader[20:38:29] <dmlloyd> and go from there[20:38:42] <Elvanor> dmlloyd: the encoding is actually present in the request, I just have to extract it[20:39:06] <dmlloyd> Elvanor: ok then the rewind trick will still work for you.[20:39:07] <bhz-> krad, what makes C's IO best, the fact that you have to worry about managing the memory of your buffers, instead of concentrating on reading the data?[20:39:08] <Elvanor> when we discussed you suggested that I made an HttpServletRequestWrapper and pass that on to the next filter[20:39:19] <Elvanor> dmlloyd: is rewinding better?[20:39:31] <krad> bhz-, but that's really not hard[20:39:36] <dmlloyd> Elvanor: I dunno, I think they're both OK. depends on where you want the logic[20:39:37] <Elvanor> Is it even allowed within the servlet framework[20:39:57] <bhz-> krad, it's harder than not worrying about it[20:39:58] <krad> bhz-, i mean many have made a big fuss of managing memory in C.. i find it very easy[20:40:30] <cheeser> i find it unrelated to java, peronsally[20:40:37] <Elvanor> Anyway, how would I read data from my Servlet input stream then[20:40:49] <cheeser> Elvanor: it's just a stream...[20:40:53] *** quarsaw has left ##java[20:40:59] <Elvanor> Yeah, but why cant I use readLine() ?[20:41:02] <krad> cheeser, C++ is getting a conditional GC[20:41:04] <Elvanor> If it's present in the API[20:41:12] <cheeser> krad: i don't really care[20:41:32] <cheeser> Elvanor: InputStream doesn't have a readLine()[20:41:40] <krad> cheeser, well you should, that's more freedom, you can either employ it or not[20:41:47] <dmlloyd> Elvanor: because... there's no known encoding. How do you know what the encoding is? how do you think the servlet input stream does?[20:41:49] <cheeser> krad: i don't use C++[20:41:52] <Seldon75> krad: just what it needs! so what happens to 'delete'?[20:41:58] *** lem has joined ##java[20:42:00] <waz> cheeser: you're not free[20:42:10] <Elvanor> dmlloyd: Isnt \n the same in all encodings?[20:42:23] <Seldon75> do the destructors still get called?[20:42:29] <Seldon75> sorry; o/t[20:42:40] <Elvanor> dmlloyd: also wrt to the rewind method, maybe markSupported would return false for a servlet input stream[20:42:50] <Elvanor> (not sure about that, just something I was thinking about)[20:43:03] *** convivial has quit IRC[20:43:22] <vol> Seldon75: destructors aren't guarenteed to ever get called.[20:43:52] <Seldon75> perfect[20:43:57] <dmlloyd> Elvanor: that's why you'd use BufferedInputStream[20:43:57] <jottinger> finalizers, not destructors[20:44:14] <jottinger> in C++, destructors *definitely* get called, no?[20:44:15] <Elvanor> dmlloyd: well but then I would still have to subsequently wrap the request[20:44:25] <Seldon75> vol: if you meant finalizers, we were offtopic - not talking about Java[20:44:25] <krad> jottinger, yes[20:44:34] <vol> sorry, yess[20:44:38] <vol> thought you meant finalizers[20:44:42] <krad> Seldon75, well java has finalize[20:44:48] <Seldon75> oh jeez[20:44:51] <vol> that will teach me to jump in[20:44:52] <Seldon75> lets just drop it[20:44:55] *** yoR has joined ##java[20:44:56] <cheeser> which isn't guaranteed[20:45:02] <Elvanor> or do I?[20:45:08] <cheeser> using finalise is almost universally dumb[20:45:16] <jottinger> cheeser: it's horribly slow[20:45:18] <Seldon75> it seems pointless if not guaranteed[20:45:32] <dmlloyd> Elvanor: sure, but then at worst you can just rewind the buffered stream, and wrap it with another ServletInputStream[20:45:36] <jottinger> I ran a test on GC with finalizers... incredible differences, even with empty finalizers[20:45:41] <krad> it'll get called when the GC decides to remove your objects[20:45:43] *** fcky has joined ##java[20:45:44] <cheeser> jottinger: having a flinze defined can keep your object around for 2 different GC cycles[20:45:45] <jottinger> Seldon75: no, it's not pointless. But it's potentially expensive.[20:45:51] <jottinger> cheeser: i know.[20:45:57] *** kennyd has joined ##java[20:46:00] <ernimril> jottinger: it would be interesting to see if that changes with G1[20:46:03] <cheeser> grizzly just got bit by that[20:46:04] <cheeser> 8^)=[20:46:06] <Elvanor> dmlloyd: I think I am starting to get it[20:46:08] <jottinger> ernimril: I still have the test. :)[20:46:09] <ernimril> jottinger: (I do not think it changes, but still)[20:46:39] <jottinger> when I took out finalizers, I ended up with 1500ns survivor GCs[20:46:46] <Elvanor> Would like to at least have an implementation working with my initial idea though. So can anyone explain me why there is a readLine() method for ServletInputStream?[20:46:46] <jottinger> when I had the finalizers... 600ms[20:47:01] <cheeser> ~javadoc ServletInputStream[20:47:03] <javabot> cheeser: http://is.gd/jRCx [javax.servlet.ServletInputStream][20:47:09] *** convivial has joined ##java[20:47:43] *** Scorchin has left ##java[20:47:50] <krad> what's a survivor GC[20:47:55] *** z4chh has joined ##java[20:48:06] <dmlloyd> Elvanor: don't worry about why, especially when you're dealing with Sun APIs :)[20:48:11] <z4chh> how can i specify the height and width of a panel?[20:48:18] <cheeser> where all the objects are put on an island and compete[20:48:25] <dmlloyd> ~~ z4chh javadoc JPanel.setHeight(*)[20:48:25] <javabot> I don't know of any documentation for JPanel.setHeight(*)[20:48:29] <Elvanor> dmlloyd: do you mean it's there but should absolutely *never* be called?[20:48:29] *** jcp has joined ##java[20:48:29] <dmlloyd> ~~ z4chh javadoc JComponent.setHeight(*)[20:48:29] <javabot> I don't know of any documentation for JComponent.setHeight(*)[20:48:32] <ernimril> z4chh: why do you have to?[20:48:38] <dmlloyd> cheeser: need inherited method support :([20:48:42] <cheeser> i need to add support for super classes[20:48:46] <ernimril> z4chh: you normally set the preferred size and then let the layout manager handle it[20:48:48] <cheeser> dmlloyd: patches welcome![20:48:49] <cheeser> 8^)=[20:48:50] <krad> do you guys know about user land kernel land[20:49:04] <cheeser> krad: yes. and it ahsnothing to dow with java[20:49:06] <dmlloyd> cheeser: I could look at the code again. Last time was almost as much as I could handle.[20:49:07] <dmlloyd> :)[20:49:13] <cheeser> 8^)=[20:49:17] <krad> cheeser, nothing to do with java ok[20:50:47] <krad> i asked earlier how java implements non blocking io... i was being told with variants of poll/.. depends on the OS[20:51:16] <krad> what about the new feature that the FS signals you on file change, how is that implemented[20:51:45] <ernimril> krad: you can download openjdk and find out[20:52:01] <krad> but that's a feature of the FS or Java?[20:52:13] <cheeser> java[20:52:15] <dmlloyd> both, probably[20:52:17] <cheeser> not all FS support that.[20:52:24] *** christo_m has joined ##java[20:52:32] <dmlloyd> they all do on linux iirc - it's a kernel thing[20:52:39] <dmlloyd> the inotify subsystem[20:52:44] <christo_m> how can i multiply a string, i tried mystring.multiply(5) for example and i get an errer[20:52:46] <christo_m> error*[20:52:58] <dmlloyd> ~~ christo_m javadoc String[20:52:59] <javabot> christo_m: http://is.gd/6UoM [java.lang.String]; http://is.gd/iaWp [javax.print.DocFlavor.STRING]; http://is.gd/iaWp [javax.print.DocFlavor.STRING][20:53:06] <christo_m> im aware[20:53:11] <dmlloyd> christo_m: the first link. Where on that class did you see a multiply() method?[20:53:25] <dmlloyd> just random guessing?[20:53:30] <christo_m> well then how can i go about multiplying[20:53:31] <krad> ok, not all systems[20:53:32] <christo_m> no i googled[20:53:33] *** neuro_damage has joined ##java[20:53:59] <cheeser> christo_m: use a loop[20:53:59] <dmlloyd> christo_m: do it with a for loop. are you one of those people who can't do something if it's not built into the language?[20:54:09] <krad> but ive always had a question.. do all the feature of java get eventually implemented in C?[20:54:11] <dmlloyd> no x operator - pack up and go home![20:54:17] <christo_m> yea im one of those people thats used to overloaded operators[20:54:29] <cheeser> "blah".multiply(x) is one of the dumbest requests for a language/api extension[20:54:37] <dmlloyd> krad: everything the JDK supports has to be implemented, yes[20:54:39] <christo_m> you should be able to do "hello" * 4[20:54:49] *** aksn has joined ##java[20:54:56] <Elvanor> If I use write() with a byte[] argument on a OutputStream, it will copy the whole array even if some positions in the array are not defined?[20:54:58] <selckin> go use perl then[20:54:58] <dmlloyd> christo_m: you "should"? is it a moral imperative?[20:55:01] <cheeser> christo_m: that's retarded[20:55:12] <krad> dmlloyd, my question is whether in C or not[20:55:22] <ernimril> Elvanor: byte has no undefined value[20:55:27] *** vinse has joined ##java[20:55:28] <dmlloyd> krad: maybe. Maybe C++, or assembly, or fortran. It's implementation-defined.[20:55:33] <Elvanor> ernimril: what's the default value then ?[20:55:40] <vinse> join #jquery[20:55:41] <cheeser> 0[20:55:43] *** thecarlhall has joined ##java[20:55:44] <krad> I see[20:55:45] <vinse> ./sigh[20:55:45] <cheeser> vinse: no![20:55:52] <dmlloyd> Elvanor: byte[] are always fully defined. They're initialized to 0s.[20:56:00] <vinse> cheeser: do it now i command it![20:56:09] <cheeser> kneel before zod![20:56:12] <Elvanor> Ok. So there is no way of doing what I want.[20:56:24] *** squi has quit IRC[20:56:26] <Elvanor> No way of knowing how many bytes were actually read when it returns -1[20:56:35] <krad> what's a file descriptor mapped to in Java?[20:57:01] <cheeser> File most likely[20:57:03] <krad> i.e. i want to poll to see which fd's are set and read teh set ones[20:57:07] <vol> FileDescriptor?[20:57:15] <krad> that's what i usually do in C[20:58:29] <ernimril> Elvanor: "no way"? you can keep track yourself, you can easily wrap your stream inside a CountingInputStream that keeps the count[20:59:05] <Elvanor> How would I keep track myself?[20:59:13] <Elvanor> (except reading byte by byte)[20:59:24] *** DjZemich has joined ##java[20:59:35] <ernimril> Elvanor: create the CountingInputStream and let it keep track[21:00:12] <dmlloyd> Elvanor: why do you need to know? you could always just use read() in a loop and save yourself a lot of screwing aroudn[21:00:16] *** NiallC has joined ##java[21:00:53] <Elvanor> dmlloyd: Probably I dont get it right, but I thought I needed to know to be able to write these bytes to an output stream[21:01:11] <Elvanor> It basically boils down to copying all the bytes from an input stream to an output stream, line by line[21:01:26] <dmlloyd> why an output stream? why line by line?[21:01:30] *** krad has quit IRC[21:01:40] <cheeser> streams don't have lines[21:01:44] *** krad has joined ##java[21:01:49] <ernimril> Elvanor: loop{ read a line; write the line; }[21:02:12] <dmlloyd> better yet: loop { read N bytes; write N bytes; }[21:02:26] <Elvanor> Ok but what when I am at the end?[21:02:34] <dmlloyd> then close the stream?[21:02:35] <krad> why theres Byte but not Bit[21:02:42] <dmlloyd> ~why[21:02:42] <javabot> why is a silly question[21:02:55] <cheeser> ~~ krad about javadoc Boolean[21:02:56] <javabot> Too too many many abouts abouts, krad[21:02:58] <Elvanor> I mean I cannot read N line if there are only N / 2 left[21:03:02] <cheeser> ~~ krad javadoc Boolean[21:03:02] <javabot> krad: http://is.gd/jRLA [java.lang.Boolean][21:03:12] <Elvanor> s/line/bytes[21:03:24] <dmlloyd> Elvanor: read into a 1024 byte buffer. However many bytes it returns, you write. When read() returns -1, you're done.[21:03:44] <dmlloyd> with read(byte[]), the return value is the number of bytes read, or -1 at the end of the stream.[21:03:53] <cheeser> ~be api barbie[21:03:54] <javabot> <barbie>Javadoc is *hard*</barbie>[21:03:56] <dmlloyd> ~~ Elvanor javadoc InputStream.read(byte[])[21:03:57] <javabot> Elvanor: http://is.gd/jRM5 [java.io.InputStream.read(byte[])][21:04:01] <krad> cheeser, not boolean i mean bit[21:04:06] <Elvanor> Hmm, and it works the same with lines?[21:04:09] <cheeser> krad: i know[21:04:18] <cheeser> they're effectively the same[21:04:21] <cheeser> logically at least[21:04:28] <cheeser> ~javadoc BitSet[21:04:29] <javabot> cheeser: http://is.gd/jRMh [java.util.BitSet][21:04:55] *** cybereal has joined ##java[21:05:24] *** Meshezabeel has joined ##java[21:05:26] *** crackintosh has joined ##java[21:05:31] <svm_invictvs> grumblefuck[21:05:38] <Elvanor> Ok, this maybe stupid, but I really would like to know what did Sun's engineers thought when they designed that readLine() function for ServletInputStream[21:05:43] <krad> Java Byte confuses me[21:05:47] <Elvanor> I cannot keep that out of my mind... :([21:05:51] <krad> in C there's no such thing[21:05:52] <cheeser> Elvanor: just ignore it and move on[21:06:01] <krad> im really scared of 'Byte'[21:06:03] <cheeser> or at least stfu about it here because we don't care why. 8^)=[21:06:03] *** monkeycid has joined ##java[21:06:07] <ernimril> Elvanor: what makes you think they did use the grey goo between their ears?[21:06:22] *** luiX_ has quit IRC[21:06:23] <cheeser> i can ask rajiv if you really want to know[21:06:24] <cheeser> 8^)=[21:06:28] <dmlloyd> Elvanor: no, the readLine() docs imply that it's broken. I wouldn't touch it.[21:06:45] <Elvanor> dmlloyd: how do you infer that from the docs?[21:06:54] <Meshezabeel> I have a screen area of 800x450, I have 25 images to put on the screen in a grid layout. The images have a default size (such as 130x120). Since the 25 images are obviously too big to fit the screen area, how do I resize them proportionally to fit the screen area? What I'm looking for is a formula, as the numbers and sizes may change.[21:07:20] <dmlloyd> Elvanor: "This method returns -1 if it reaches the end of the input stream before reading the maximum number of bytes." implying bytes are read that are not reported. == broken[21:07:21] <krad> cheeser, Byte and char are the same right[21:07:41] <ernimril> krad: one is an Object, the other is a primitive[21:07:44] <Seldon75> krad: no[21:07:56] <Elvanor> dmlloyd: I guess this is why I got completely confused[21:07:58] <ernimril> krad: byte is 8 bits signed, char is 16 bits unsigned[21:08:16] *** christo_m has quit IRC[21:08:22] <jcp> ls[21:08:23] <javabot> jcp: wrong window, Einstein[21:08:25] <dmlloyd> krad: byte and Byte are different things[21:08:28] <Elvanor> I could not understand why I could not get the length of those read bytes[21:08:31] <jcp> erg, ignore that[21:08:44] <Seldon75> jcp: oh, we will[21:08:52] <Elvanor> dmlloyd: Ok, so now that this function has been labeled as broken I will try to move on, sorry for the noise :)[21:09:03] <dmlloyd> krad: if you know C types: int8_t == byte, int16_t == short, uint16_t == char, int32_t == int, int64_t == long[21:09:21] <krad> but in C char is 1 byte[21:09:25] <krad> not 2[21:09:26] <dmlloyd> krad: wrong[21:09:37] <dmlloyd> krad: read the C99 spec again :)[21:09:44] <dmlloyd> krad: that's a topic for ##c though[21:09:50] <jcp> wait a sec, java chars are unsigned?[21:09:50] <krad> ok i forgot some stuff about C then when i started java[21:09:59] <ernimril> jcp: yes[21:09:59] <jcp> I thought all java types were signe[21:10:02] <dmlloyd> jcp: yup[21:10:23] <r0bby> except char.[21:10:49] *** Junior has quit IRC[21:10:56] <krad> what's the difference between signed/unsigned, one can hold negative values and the others cannot?[21:11:17] *** pandora-- has joined ##java[21:11:37] <vol> yes[21:12:04] <jcp> krad: so in that case, char can hold values from 0 to 65535[21:12:05] <vol> an unsigned data type uses the sign bit to store one more bit of information, so instead of storing -128 to 127, it can store 0 to 255.[21:12:12] <jcp> but short can hold values from 032768 to 32767[21:12:18] *** brrc has quit IRC[21:12:20] <jcp> *-32768[21:12:20] *** thecarlhall has quit IRC[21:12:54] *** vix85 has quit IRC[21:13:19] <Elvanor> http://rafb.net/p/owulsO95.html[21:13:26] <Elvanor> Could I have that in a more elegant form?[21:13:31] *** musically_ut has quit IRC[21:13:32] <krad> but on some systems Byte isn't 8 bits[21:13:40] <Elvanor> I dont like the double test on length != -1[21:13:44] <jcp> krad: right[21:13:48] <ernimril> krad: byte and Byte are two very different things[21:14:04] <krad> isn't int to Integer what byte is to Byte[21:14:11] <jcp> Yes[21:14:11] <Seldon75> vol: your analogy isnt very good because the range of the signed value will be half[21:14:31] <jcp> Seldon75: no it won't[21:14:36] <vol> Seldon75: ...What analogy[21:14:38] <jcp> It's just shifted downward[21:14:42] <Seldon75> if you use the same number of bits[21:14:44] <vol> that's the difference between an unsigned and a signed byte[21:14:51] <jcp> Exactly[21:14:59] <jcp> Seldon75: The range is still the same[21:15:05] <jcp> It's just shifted halfway down[21:15:07] <ernimril> krad: a byte is the smallest addressable unit, on most systems today it is 8 bits, on java it is 8 bits, on older systems there have been 31 and 36 bit bytes[21:15:21] <vol> Elvanor: while ( (length = inputStream.read(bytes)) != -1) { ... }[21:15:21] <Seldon75> oh, my bad[21:15:22] <jcp> 127 - -128 is 255[21:15:28] <jcp> 255 - 0 is 255[21:15:29] <jcp> so same range[21:15:31] <jcp> ok[21:15:35] <krad> ernimril, but they just told me char is 2 bytes[21:15:45] <Elvanor> vol: thx, that was what I was searching for[21:15:50] <jcp> krad: byte != char[21:15:54] <ernimril> krad: in java a char is 16 bits[21:16:00] <Elvanor> but (length = inputStream.read(bytes) thus returns length ?[21:16:02] <krad> ernimril, same in C no?[21:16:08] <r0bby> krad: every primitive data type has a corresponding wrapper class[21:16:10] <jcp> no[21:16:12] <jcp> char is 8 bits in java[21:16:16] <jcp> s/java/c++[21:16:20] <r0bby> including void[21:16:34] <krad> dmlloyd said not[21:16:40] *** thecarlhall has joined ##java[21:16:42] <jcp> char = 16 bits in java, char = 8 bits in c++[21:16:49] <ernimril> krad: when I learned C (many years ago) a byte and a char were the same thing[21:16:50] <krad> yeah[21:16:56] <jcp> c++ doesn't have such a thing as byte[21:17:01] <svm_invictvs> char[21:17:02] <dmlloyd> jcp: does the C++ spec say char is always 8 bits?[21:17:17] <svm_invictvs> dmlloyd: no, it says it shall represent 1 byte.[21:17:19] <jcp> dmlloyd: I don't remember, but it's 8 bits on every system I've used[21:17:21] <krad> dmlloyd, i told you it's 1 byte[21:17:37] <dmlloyd> krad: don't lecture me until you've read the spec as much as I have.[21:17:43] <ernimril> krad: please differentiate between a byte in java and a byte in general[21:17:48] <krad> dmlloyd, i know this from usage[21:17:58] <dmlloyd> krad: usage is NOT the same as specification[21:18:05] <svm_invictvs> I think that ISO C++ says that a byte shall be at least 8 bits.[21:18:11] *** mers has joined ##java[21:18:15] <krad> ernimril, why[21:18:17] <vol> under penalty of death[21:18:42] <mers> hi guys. is it possible to specify a generic that means "extends Class C and implements interface I"?[21:18:49] <svm_invictvs> sizeof(long) >= sizeof(int) >= sizeof(short) >=sizeof(char) iirc[21:19:01] <cybereal> mers: extends C & I[21:19:02] <ernimril> krad: because a byte is specified in java, but as I told you a byte on other systems may have different length, it is just the smallest addressable unit on that cpu/architecture[21:19:05] <benJIman> mers: T extends C & I[21:19:11] <mers> thanks![21:19:17] <yoR> Why are we having this byte discussion anyway..?[21:19:25] <krad> ernimril, in general it's that?[21:19:28] <jottinger> fun and profit[21:19:47] <ernimril> krad: if I make my own cpu I may make the byte on that cpu be 42 bits if I want[21:19:48] <yoR> Ah, thats cool, everything for fun and profit[21:20:01] <krad> ernimril, but java still treat is as 8 bits?[21:20:05] <jcp> Yes[21:20:07] <r0bby> yes[21:20:11] *** AhtiK has joined ##java[21:20:11] <krad> ok ~[21:20:11] <r0bby> ~~ krad jls[21:20:12] *** dfas has joined ##java[21:20:12] <javabot> krad, jls is The Java Language Specification: http://java.sun.com/docs/books/jls/[21:20:17] <r0bby> krad: go read that.[21:20:27] <krad> no it's boring i tried once[21:20:27] <ernimril> krad: a jvm running on my cpu would have to handle whatever convertion that needs to be done[21:20:28] <letfunbegin> here actually: http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.2[21:20:29] <r0bby> every java implmentation MUST follow that spec[21:20:38] <jcp> Java is nice in that regard, as compared wiht c++, in that all datatypes stay the same size regardless of what it's being run on[21:20:44] <krad> ernimril, i see[21:21:02] *** ciaron has quit IRC[21:21:07] <letfunbegin> it's an excellent read[21:21:22] <krad> ernimril, but on systems where byte is 8 bits, i can assume java byte is the same as general bye[21:21:24] <krad> byte&[21:21:40] <jcp> That would be the case[21:22:06] <krad> if i print byte i'll see binary ones and zeroes?[21:22:16] <ernimril> ~~krad tias[21:22:16] <javabot> Try it and see. You learn much more by experimentation than by asking without having even tried.[21:22:16] * krad tires[21:22:19] * krad tries*[21:22:23] *** taxon has joined ##java[21:22:35] <r0bby> krad: no you'll likely see the two's complement Decimal value.[21:22:50] <krad> i hate 2s complement[21:22:54] <letfunbegin> so what's with these types anyway?[21:23:00] <r0bby> it's how java data types aside from char work.[21:23:04] <svm_invictvs> What's wrong with two's compliment?[21:23:09] <r0bby> it's not that hard[21:23:14] <r0bby> invert and add 1.[21:23:15] <krad> r0bby because they're all signed?[21:23:18] <jcp> krad: So if you System.out.println((byte)'A') you'll get 65[21:23:34] <r0bby> int negi = -2; int i = ~negi + 1;[21:23:41] <r0bby> there ya go two's complement.[21:23:45] <krad> r0bby, only java char is unsisnged?[21:23:52] <jcp> and if you System.out.println('A') then you'll get 'A'[21:23:57] <jcp> krad: yes[21:24:02] <r0bby> krad: what the fuck have we been telling you for the past 10+ min utes?[21:24:03] <krad> r0bby, but how can int then store negative values :S[21:24:14] <r0bby> krad: two's complement[21:24:15] <jcp> krad: int is signed[21:24:21] <r0bby> oh fuck[21:24:23] <krad> oh ok[21:24:25] <r0bby> i msiread[21:24:27] <krad> signed = +-[21:24:29] <krad> sorry my bad[21:24:33] <cybereal> krad: java has no unsigned types mean to be used as numbers[21:24:36] <r0bby> krad: go read the spec[21:24:45] <r0bby> ~~ krad unsigned[21:24:45] <cybereal> char is unsigned but it's mean to be used for.... characters :)[21:24:46] <javabot> krad, unsigned is something Java doesn't have, see http://in.relation.to/Bloggers/HandholdingSucksJavaNeedsUnsignedTypes for some workarounds and debate.[21:24:47] <krad> cybereal, char is unsined[21:24:49] <r0bby> has tricks[21:24:56] <cybereal> krad: please learn to read entire sentences[21:25:08] <krad> ok i'll tias[21:25:27] *** dmead has joined ##java[21:25:44] *** ofl_ has joined ##java[21:25:46] <jcp> What, exactly, is the point of having char unsigned if it holds only characters?[21:25:53] <jcp> Seems pointless to me[21:26:14] <jottinger> errrr[21:26:16] <r0bby> what is the ascii value -32?[21:26:17] <krad> why it seems pointless?[21:26:24] <jottinger> what is a signed character?[21:26:29] <r0bby> ascii values are all positive...[21:26:35] <krad> signed is +-[21:26:39] <r0bby> and like you've been told it's for characters not integer values.[21:26:41] <reverend> jcp: char is an integral type.. it holds numbers[21:26:50] <r0bby> krad: we know what a siotgbed number is :)[21:26:50] <cybereal> jcp: a better question would by, why would you need a negative number char?[21:26:58] * jcp refers reverend to cyberreal's above comment[21:27:08] <cybereal> there are no negative codepoints in unicode and char represents unicode codepoints so...[21:27:17] <krad> integral means belongs to Z?[21:27:29] <jcp> cybereal: no, I was actually thinking that it might be less work for the vm creator if all types were signed[21:27:34] <r0bby> krad: go read the language spec it can be a lot more specific[21:27:39] *** marvs has quit IRC[21:27:39] <jottinger> jcp: errrr[21:27:41] <jcp> And I couldn't see any obvious value to unsigned ints if they're all characters[21:27:48] <cybereal> jcp: heh why would it be any more or less work?[21:27:49] <jcp> but I can kind of see the ascii thing[21:28:12] <jcp> cybereal: Because it seems to me that if all types are signed then you don't have to write additional code to work with unsigned types[21:28:19] *** t3mp3st_ has joined ##java[21:28:20] <reverend> 'characters' are represented by positive numbers[21:28:22] <jcp> Not a big deal though[21:28:22] *** sphenxes has joined ##java[21:28:29] *** BlindHunter has quit IRC[21:28:33] <reverend> so there's no point in having negative char values[21:28:51] <jcp> Boy, everyone seems to be overlooking my initial point[21:28:57] <jcp> but nevermind, I don't like starting arguments[21:29:19] <cybereal> jcp: and so you'd have to jump to the next practical integer size in order to represent characters, needlessly doubling the memory usage of String again[21:29:29] *** krad has quit IRC[21:29:32] <cybereal> strings already require over double their length in memory to represent...[21:29:40] *** krad has joined ##java[21:29:54] <krad> <krad> integral means belongs to Z?[21:29:54] <krad> * Disconnected[21:30:04] *** vix85 has joined ##java[21:30:08] <r0bby> krad: go read the language spec[21:30:10] <jcp> cybereal: why? byte arrays store negative values, but I've yet to hear of anyone speak of a "negative byte"[21:30:11] <svm_invictvs> ugh[21:30:14] <r0bby> stop asking questions you can answer on your own[21:30:21] <krad> r0bby, i want to know what's integral and literal[21:30:34] <cybereal> jcp: you haven't lived long enough, I guess[21:30:36] <jottinger> WE HATE YOU[21:30:40] <letfunbegin> haha[21:30:42] <cybereal> so please, stop asking stupid ass questions[21:30:47] <jottinger> did you know there are -0?[21:30:54] <r0bby> krad: your questions are basically dumb[21:31:00] <krad> r0bby, no they're not[21:31:03] <r0bby> you need to read more[21:31:13] <krad> i just forgot some stuff[21:31:13] <r0bby> krad: they are when they're answered by reading[21:31:22] <krad> i'm too lazy to read the stuff i forgot at midnight[21:31:24] <r0bby> ~~ krad rbi[21:31:24] <javabot> krad, reallybigindex is http://java.sun.com/docs/books/tutorial/reallybigindex.html[21:31:39] *** zubeen has left ##java[21:31:42] <r0bby> krad: we're too lazy to give a fuck about you[21:31:48] <jcp> If you're too lazy to read, then we're too lazy to help.[21:31:49] <krad> but its not midnight for you[21:31:52] *** marvs has joined ##java[21:31:55] *** ciaron has joined ##java[21:32:02] <r0bby> krad: no it's 333 pm.[21:32:03] <krad> no i help with what i know, no effort needed[21:32:16] <r0bby> krad: now go read[21:32:29] <r0bby> for your own sake, so you don't wind up getting banned[21:32:32] <krad> rtfm![21:32:34] <jcp> really good rule of thumb: if you can find out stuff yourself, then do it![21:32:50] <krad> jcp, but this requires effort[21:32:50] <mers> cybereal: benJIman: is there any way to say a particular field extends C and implements I ... e.g. private Class<? extends C & I> clazz;[21:32:55] <krad> i'll do that tomrorow[21:32:57] <r0bby> krad: what a shocker[21:33:02] <jcp> AND YOU THINK WE'LL PUT EFFORT INTO IT IF YOU WON'T?[21:33:12] <krad> you're free not to[21:33:15] *** convivial has quit IRC[21:33:17] <r0bby> krad: nobody is going to help you now[21:33:19] <jottinger> mers: why would that be necessary?[21:33:44] <r0bby> congrats you just basically fucked yourself over.[21:33:45] <jcp> Then don't ask[21:33:48] <krad> r0bby, it's ok i'll idle[21:33:55] <krad> r0bby, no i haven't[21:33:55] <jcp> It wastes our time when you ask questions that you know we won't help you with[21:34:00] *** jottinger sets mode: +b *!*i=k@78.108.175.*[21:34:00] *** krad was kicked by jottinger (idle elsewhere)[21:34:07] <r0bby> dumbass[21:34:15] <r0bby> I've seen nothing intelligent out of him[21:34:18] <jcp> finally[21:34:57] <r0bby> he's too dumb to see he totally admitted "I'm a lazy SOB[21:35:48] <mers> jottinger: i'll pastebin an example, one sec[21:35:54] *** morkar- has quit IRC[21:35:58] <mers> ~pastebin[21:35:59] <javabot> http://pastebin.stonekeep.com Paste the final url after you've pasted your stuff there.[21:36:13] <svm_invictvs> Is there any way to not get the unchecked warning on line 10? http://rafb.net/p/HTBy4822.html[21:36:15] <jottinger> mers: I understood what you wanted to do[21:36:16] <jottinger> but WHY[21:36:29] *** t3mp3st_ has quit IRC[21:36:38] <mers> because C is an enum and this is the only way i can standardize its behaviour[21:36:47] <mers> since i can't extend it[21:36:51] *** monestri has joined ##java[21:37:34] *** gunnar has joined ##java[21:37:35] <benJIman> Wait, what?[21:37:36] <r0bby> svm_invictvs: @SupressWarnings({"unchecked"})[21:37:38] <svm_invictvs> Or shoul dI just suppress warnings?[21:37:40] <svm_invictvs> grumble[21:37:41] <svm_invictvs> yeah.[21:37:42] <r0bby> on main[21:37:47] <cybereal> mers: an object that is C will never be more than C[21:38:09] <cybereal> mers: C includes any and all interfaces it implements[21:38:36] *** elderK has joined ##java[21:38:39] <elderK> Yo people.[21:38:42] <elderK> AWT or Swing?[21:38:48] <elderK> I'm figuring Swing, yeah?[21:38:52] <svm_invictvs> sure...[21:38:55] *** Goundy has quit IRC[21:38:55] *** convivial has joined ##java[21:38:59] <cybereal> elderK: ask a real question, no polling here[21:39:00] <benJIman> mers: Maybe you'd be better of defining a wrapper class or something.[21:39:01] <jottinger> elderK: errr...[21:39:04] <benJIman> *off[21:39:05] <elderK> polling?[21:39:05] *** jottinger sets mode: -b *!*i=k@78.108.175.*[21:39:09] <cybereal> ~polling[21:39:09] <javabot> cybereal, I have no idea what polling is.[21:39:11] <cybereal> ~poll[21:39:12] <javabot> Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.[21:39:13] <jcp> Who got kicked?[21:39:26] <svm_invictvs> elderK: got banned[21:39:31] <jcp> oh heh[21:39:31] <elderK> o_O[21:39:32] <mers> benJIman: it's ok, i think i have it sorted[21:39:33] <cybereal> elderK: it's what you're doing, get a dictionary...[21:39:42] <svm_invictvs> er no[21:39:44] <svm_invictvs> he dind't.[21:39:48] <mers> thanks for the help[21:39:54] <gunnar> I want to instantiate an object (embedded db) in a class "X" then to use a method (get connection) in the same class the use another method in other class "Y", but I want the SAME object to do it[21:39:57] <elderK> What the hell is going on?[21:39:58] <gunnar> how can I do it?[21:40:09] <svm_invictvs> elderK: I thought jottinger banned you, I misread the hostmask.[21:40:16] *** elderK has left ##java[21:40:18] <gunnar> then use**[21:40:48] <r0bby> cute[21:40:53] <svm_invictvs> ?[21:41:06] <cybereal> heh[21:41:17] <r0bby> it was probably him[21:41:17] <cybereal> This channel is positively comical today[21:41:21] *** krad has joined ##java[21:41:28] <r0bby> aw damn.[21:41:37] <jottinger> he promised to keep his mouth shut[21:41:42] <r0bby> bs.[21:41:45] <jottinger> so you keep yours shut too[21:41:54] <cybereal> r0bby: shut-it![21:41:56] *** r0bby was kicked by jottinger (I have about as much respect for you as I do him)[21:42:15] *** r0bby has joined ##java[21:42:29] *** blankthemuffin has joined ##java[21:42:59] *** cybereal has quit IRC[21:43:20] <gunnar> in other words, i need the same object in two different classes[21:43:25] <Zharf> n[21:43:28] *** gnuskool has joined ##java[21:43:54] * Seldon75 respects jottinger as much as he respects all Halberd-owners[21:44:44] *** geaaru has joined ##java[21:44:49] <jottinger> I don't have a halberd. But... as proof of how geeky i am, I did have a conversation centering around halberds, pikes, lucernes, and some other similar medieval weapons in wal-mart a couple of days ago[21:44:50] *** t3mp3st has quit IRC[21:45:11] <jottinger> centering around the merits of swords (or their lack of merit) as hand-to-hand weapons.[21:45:26] <gnuskool> is there a separate channel for javafx?[21:45:28] *** Ivellina has joined ##java[21:46:14] <Seldon75> give me a bo-staff any day[21:46:22] <Seldon75> anyway,..[21:46:27] <jottinger> Seldon75: depends on who you're against :)[21:46:49] <jottinger> against me? I'll wipe you out if you have a bo. You're better off with a longbow. :)[21:47:03] <jottinger> and if an AH-64 isn't handy, well, use an actual bow.[21:47:30] *** Resistance has joined ##java[21:49:29] <svm_invictvs> ah64?[21:49:37] *** cybereal has joined ##java[21:49:38] <Seldon75> ass-hat[21:50:32] *** sphenxes has quit IRC[21:50:32] <jottinger> ah64 is the apache helicopter, also known as a "longbow"[21:51:24] <EdwardIII> oh goody i'm making some real progress with this little test feedreader - i'm getting the xml feed off the web, putting it into a Feed object, then the Feed object creates a collection of Entries which it can pass back... the main() prints out each Entries title - delightful![21:51:44] <EdwardIII> except at the moment it just prints out 1 title 30 times instead of each of the different 30 titles, but that's just a small typo somewhere i'm sure[21:52:04] <svm_invictvs> Hm...trying to build an XML file wiht JAXP...[21:52:16] <svm_invictvs> Is there a good example for that?[21:52:28] <krad> we use xstream at work[21:52:31] *** orgy` has quit IRC[21:52:51] <jottinger> EdwardIII: why are you not using Rome?[21:53:19] *** cyth has quit IRC[21:53:21] *** giaco has quit IRC[21:53:38] *** cyth has joined ##java[21:54:04] *** neuro_damage has quit IRC[21:55:06] <EdwardIII> jottinger: jottinger it seemed like a good exercise - plus i wouldn't mind having a custom rss reader on my phone but i daren't try and get on with midp/midlet api until i'd at least got the hang of the java one[21:55:48] *** ciaron has quit IRC[21:56:04] <EdwardIII> but i might check out their source code at some stage for ideas[21:56:39] <dmlloyd> ~~ svm_invictvs javadoc XMLStreamWriter[21:56:40] <javabot> svm_invictvs: http://is.gd/jS9W [javax.xml.stream.XMLStreamWriter]; http://is.gd/jS9X [javax.xml.stream.XMLStreamWriter][21:56:48] <dmlloyd> the simplest XML writing API on the planet[21:56:52] *** bindaas has quit IRC[21:56:55] <dmlloyd> fast too[21:57:36] <svm_invictvs> Can I validate against a schema?[21:57:38] *** convivial has quit IRC[21:57:58] <dmlloyd> on write? probably[21:58:09] <dmlloyd> though if you're writing the XML...[21:58:17] <dmlloyd> I mean, unless you don't trust yourself...[21:58:43] <svm_invictvs> I'm making a builder class ot build these XML meta data files.[21:58:45] <dmlloyd> hm actually, it doesn't look like it[21:59:01] <dmlloyd> ~~ svm_invictvs javadoc XMLOutputFactory[21:59:01] <javabot> svm_invictvs: http://is.gd/jSbe [javax.xml.stream.XMLOutputFactory]; http://is.gd/jSbf [javax.xml.stream.XMLOutputFactory][21:59:37] *** ycy has joined ##java[22:00:04] *** pertl has joined ##java[22:01:20] *** convivial has joined ##java[22:02:18] *** eidolon has left ##java[22:06:00] <alvin_3> out.println("$('#signup_link').html(\"<a href=\"https://test.com/registration.html\">Register</a>\");");[22:06:02] <krad> knowing that utf8 is represented on 2 bytes, then any utf8 char can be stored in a char[22:06:04] <svm_invictvs> thanks dmlloyd[22:06:08] <EdwardIII> man this stuff is addictive, it's like 9.07pm here, i gotta eat![22:06:13] <dmlloyd> np[22:06:36] <alvin_3> how can i escape that link so that it will output like <a href=\"https://test.com"\"> ?[22:06:52] <krad> \\[22:06:54] <alvin_3> thats a line that is outputing javascript[22:07:06] <jottinger> this is #java, not javascript[22:07:06] <alvin_3> krad: on both side?[22:07:15] *** lem has quit IRC[22:07:24] <alvin_3> but is outputing from "java"[22:07:56] <krad> you have /a btw[22:08:00] *** tuxtheslacker has joined ##java[22:08:26] *** TooAngel has joined ##java[22:08:39] <dmlloyd> alvin_3: in java, you use \\ to print a \[22:08:49] <dmlloyd> alvin_3: and \" to print a "[22:08:54] <dmlloyd> so to print \", you do...[22:08:58] *** TooAngel has left ##java[22:09:23] <krad> \a => \\a[22:09:25] <tuxtheslacker> hey. can someone help me with figuring out if a port is in use on an external server?[22:09:38] <selckin> netstat -anp[22:09:39] *** gnuskool has quit IRC[22:09:40] <krad> tuxtheslacker, you mean programmatically?[22:09:44] *** _spm_draget has quit IRC[22:09:45] <tuxtheslacker> mmhmm.[22:09:54] *** foo-nix has joined ##java[22:09:58] <tuxtheslacker> er, yes, rather.[22:10:12] *** vix85 has quit IRC[22:10:19] <krad> but closed != firewalled[22:10:27] <krad> you have too many options[22:10:46] <tuxtheslacker> I mean, I need to find what ports I have access to.[22:10:48] *** _spm_Draget has joined ##java[22:10:58] <krad> tuxtheslacker, then use nmap[22:11:01] *** magmarules has joined ##java[22:11:02] <_spm_Draget> Can anyone recommend a good java-forum?[22:11:13] *** sebr_afk is now known as sebr[22:11:17] <tuxtheslacker> krad: I need to do it so that I can give open ports to an external app.[22:11:29] <tuxtheslacker> so nmap really isn't the ideal option.[22:11:45] <krad> why not? nmap + Runtime.exec[22:11:51] <krad> + some parsing :p[22:11:58] <tuxtheslacker> I'd like to have something like....[22:12:10] <alvin_3> krad: can i do this ? out.println("locate(\\"logoverlay\\",-270,20)"); ?[22:12:15] <tuxtheslacker> you try to bind to a port.[22:12:31] <tuxtheslacker> then see if it fails, then return either pass or fail.[22:13:09] <krad> alvin_3, no, you need to use +[22:13:18] <alvin_3> ?[22:13:32] <tuxtheslacker> krad: nmap really isn't an option.[22:13:42] <krad> tuxtheslacker, so this is local[22:13:51] <tuxtheslacker> the less external, the better[22:13:56] <tuxtheslacker> krad, no.[22:14:01] *** gunnar has quit IRC[22:14:07] <krad> how can you bind to a remote port?[22:14:15] *** pgib has joined ##java[22:14:19] *** ycy has quit IRC[22:14:19] *** mitch0 has quit IRC[22:14:35] <deufrai> tuxtheslacker: found what you want with a simple google query. Second result[22:14:36] <tuxtheslacker> krad it needs to find 3 open ports in a given range...[22:14:59] <deufrai> have you ever tried googling for "java port scanner" ?[22:15:05] *** yoR has quit IRC[22:15:17] <tuxtheslacker> krad: exactly.... I can't bind to it... I was giving you an example of what type of solution I need[22:15:23] <tuxtheslacker> deufrai: I haven't.[22:15:29] <deufrai> http://www.cafeaulait.org/course/week12/16.html[22:15:35] <deufrai> second result ![22:15:37] <krad> alvin_3, you can't have String _str = "som"innerdoublequotes"ething"; in Java[22:15:43] *** ycy has joined ##java[22:16:09] <krad> tuxtheslacker, so you want to make a port scanner in Java?[22:16:23] <svm_invictvs> why?[22:16:39] <krad> why what?[22:16:45] <svm_invictvs> would you make a portscanner in java[22:16:46] <tuxtheslacker> thanks deufrai.[22:17:00] <deufrai> tuxtheslacker: don't thanx me[22:17:00] <tuxtheslacker> svm_invictvs: that's not really what I want it for....[22:17:08] <svm_invictvs> nmap++[22:17:08] *** Forexs has joined ##java[22:17:13] <tuxtheslacker> I just need to find three open ports externally.[22:17:14] <krad> yeah, he's not being precise[22:17:19] <tuxtheslacker> that are left open.[22:17:24] <svm_invictvs> what ports?[22:17:25] <tuxtheslacker> that I can stream video over.[22:17:33] <tuxtheslacker> anything from 5000-6000.[22:17:58] <svm_invictvs> So attempt a connection, if it fails, try the next?[22:18:10] *** morkar- has joined ##java[22:18:11] <svm_invictvs> You';re going to thrash the server, tho[22:18:19] <krad> use nio[22:18:25] <tuxtheslacker> that's what I was asking for....[22:18:36] <tuxtheslacker> Socket sock = new Socket(this.getIpAddress(), 8080);[22:18:38] <svm_invictvs> krad: doesn't change the fact that he's gonna thraaash the server trying to open 1000 ports.[22:18:48] <tuxtheslacker> that will not throw and exception....[22:18:55] <tuxtheslacker> and it still works.[22:19:02] <krad> svm_invictvs, he's trying to scan 1000 ports on a remote server no?[22:19:07] <tuxtheslacker> svm_invictvs: I'm not... I'm trying to find 3 starting at the bottom of the list.[22:19:42] <svm_invictvs> You want to open 3 ports starting at 5000?[22:19:57] *** dvayanu has joined ##java[22:20:01] <dvayanu> hi[22:20:01] *** NinoScript has joined ##java[22:20:13] <dvayanu> quite offtopic, anyone here is working in scrum teams?[22:20:33] <jottinger> yes[22:20:56] *** toytoy has quit IRC[22:21:06] *** DoYouKnow has joined ##java[22:21:18] <dvayanu> jottinger: happy with it? :-)[22:21:26] <tuxtheslacker> svm_invictvs: I need to find the first three that are open starting at port 5000.[22:21:37] <tuxtheslacker> that are already*[22:21:39] <jottinger> dvayanu: when the scrums are run well, sure[22:21:42] <svm_invictvs> tuxtheslacker: on the localhost?[22:21:52] <svm_invictvs> What the fuck is scrum?[22:21:58] <Seldon75> a small team of coders[22:22:05] <Seldon75> its part of agile[22:22:08] <svm_invictvs> oh[22:22:08] <dvayanu> jottinger: do you have any architects, build masters, release manager, who are not part of the teams?[22:22:13] <svm_invictvs> I hate agile development...[22:22:18] *** convivial has quit IRC[22:22:20] <Seldon75> ~agile++[22:22:20] <javabot> agile has a karma level of 1, Seldon75[22:22:22] <tuxtheslacker> svm for now that'd work....[22:22:25] <jottinger> no, unless it's me in those roles[22:22:29] <tuxtheslacker> I may need to check from the external.[22:22:39] <dvayanu> jottinger: how many teams?[22:22:59] <jottinger> I'm involved in only one client actively using scrum right now[22:23:10] <svm_invictvs> tuxtheslacker: you really are confusing me. You want to connect to a remote host on port 5000-6000 or you want to open up a socket on which to listen for connections?[22:23:11] <Ven]n> Im trying to make a progress bar (JSlider) in a media player that updates the picture while scrolling it. Is there a way to force getVisualComponent() to repaint its picture?[22:23:20] <benJIman> It is great when done properly.[22:23:22] <dvayanu> jottinger: are you a product company or software development?[22:23:27] <benJIman> Like most things :)[22:23:27] <tuxtheslacker> svm_invictvs: it's a confusing problem....[22:23:35] <jottinger> product company, medical robots[22:23:44] <tuxtheslacker> I need to check for 3 open ports on the local machine... from the external IP.[22:23:47] <tuxtheslacker> not localhost.[22:23:53] <tuxtheslacker> or 127.0.0.1[22:23:59] <dvayanu> jottinger: by product company i mean things like google or match.com, one product, permanent updates[22:24:03] <svm_invictvs> tuxtheslacker: huh?[22:24:06] <krad> lol[22:24:08] *** pluisje has joined ##java[22:24:16] <svm_invictvs> tuxtheslacker: you wanna see if ports 5000-5002 are open?[22:24:17] <jottinger> dvayanu: we do medical robots, multiple revisions and versions of them[22:24:29] <dvayanu> jottinger: but you actually deliver them?[22:24:39] <jottinger> dvayanu: do *I*?[22:24:48] <dvayanu> jottinger: i mean the company[22:25:06] *** orgy` has joined ##java[22:25:10] <krad> svm_invictvs, so what was going to trash the server? opening 1000 ports on it?[22:25:11] <tuxtheslacker> svm_invictvs: yes.[22:25:13] <jottinger> the cmopany delivers them, yes[22:25:16] <jottinger> they're real robots[22:25:27] *** l3ns has quit IRC[22:25:51] <dvayanu> jottinger: do you like scrum?[22:25:58] *** steve-e has joined ##java[22:26:04] <jottinger> dvayanu: i'm neutral, actually[22:26:15] <svm_invictvs> krad: no, trying to connect to 100 ports on a remote server until you find one that's open. It's hardly a good way of oding it.[22:26:35] *** convivial has joined ##java[22:26:47] *** NinoScript has left ##java[22:26:49] <krad> svm_invictvs, but that's not gonna trash the remote server if that's what you meant[22:26:49] <svm_invictvs> tuxtheslacker: new ServerSocket.... no?[22:27:02] <dvayanu> jottinger: how me sprints do you have already?[22:27:04] <tuxtheslacker> can I point that to an external addy?[22:27:08] <tuxtheslacker> address*[22:27:13] <jottinger> dvayanu: two[22:27:16] <svm_invictvs> krad: It's gonna thrash the server if every client has to keep opening sockets to find an open port....[22:27:18] <jottinger> I've done a number of them, though[22:27:19] <dvayanu> heh ;.)[22:27:52] <tuxtheslacker> svm_invictvs: what would you suggest?[22:28:01] <dvayanu> jottinger: but thanx anyway[22:28:08] <jottinger> dvayanu: I have used a LOT of techniques like that. Most are okay.[22:28:13] <krad> svm_invictvs, but that can be dealt with to some extent no?[22:28:17] <krad> (on the server)[22:28:26] <Elvanor> dmlloyd: I have a new problem... how can I correctly override getInputStream() on my HttpServletRequestWrapper?[22:28:29] <svm_invictvs> Yeah, you specifcy a single fucking port to listen[22:28:56] <Elvanor> it should return an ServletInputStream. but this class is abstract, I dont really know how to create such an object[22:29:07] <Elvanor> and I dont want to have container-specific code[22:29:22] <tuxtheslacker> btw, this is off topic, but I need a reminder... do I need to put locks on servlets?[22:29:26] <tuxtheslacker> or does it not share memory space[22:29:27] <tuxtheslacker> ?[22:29:40] <dvayanu> jottinger: also XP?[22:30:03] <jottinger> dvayanu: yes. I actually enjoyed XP's pair programming, but that's because it allows me to flex my mentorin' muscles[22:30:30] <dvayanu> jottinger: also story cards and stuff?[22:30:49] <krad> hehe[22:31:06] *** crackintosh has quit IRC[22:31:45] *** bas-i has quit IRC[22:32:27] <krad> tuxtheslacker, what?[22:32:45] <tuxtheslacker> krad: I'm writing a web app with a servelet.[22:33:03] <tuxtheslacker> I was wondering if it will share memory space or if it is done by tomcat?[22:33:10] <tuxtheslacker> when the servlet is accessed.[22:33:17] <tuxtheslacker> stupid question I know but I can't remember.[22:33:24] <krad> what's shared memory space[22:33:27] <krad> share*[22:33:57] <tuxtheslacker> umm, meaning you would be using the same variable as n other users.[22:34:38] *** riotz has joined ##java[22:34:40] *** yorky501 has joined ##java[22:34:48] *** yorky501 has left ##java[22:35:26] *** pluisje has left ##java[22:35:52] *** convivial has quit IRC[22:36:22] <krad> tuxtheslacker, I don't know how to answer that question[22:37:05] <krad> but from what I remember service() is called on every access on the url mapped to this servlet[22:37:27] *** NiallC has quit IRC[22:38:35] <krad> tuxtheslacker, i think it's your responsibility to notifies the users of an accessed servlet if you want to[22:38:38] <krad> notify*[22:39:22] <tuxtheslacker> no worries.[22:39:30] <tuxtheslacker> but back to the original question (thanks, btw)[22:42:05] <cheeser> tuxtheslacker: servlets are not threadsafe[22:42:15] <cheeser> you should not have state in your servlet[22:42:24] *** ScottG489 has quit IRC[22:42:39] <tuxtheslacker> ugh.[22:43:02] <tuxtheslacker> cheeser: so I do need to lock variables that are used?[22:43:25] <tuxtheslacker> or will tomcat create a new thread for each of the connections to it?[22:43:34] *** giaco has joined ##java[22:44:02] <cheeser> tuxtheslacker: no you need to stop using instance embers in your servlets[22:44:06] <cheeser> members[22:44:23] <tuxtheslacker> define instant members?[22:44:37] <tuxtheslacker> instance*[22:44:39] <cheeser> nonstatic, nonlocal variables.[22:44:46] <cheeser> fields[22:44:57] <tuxtheslacker> so long as it's private I'm golden, correct?[22:45:09] <tuxtheslacker> as in I can create an object in a servlet, and then use it?[22:45:17] <tuxtheslacker> just no statics?[22:45:19] <cheeser> as long as its a local variable.[22:45:35] <tuxtheslacker> good news. thanks cheeser![22:45:53] <cheeser> i doubt you really grok that yet, but we'll see[22:45:53] <cheeser> 8^)=[22:46:10] <tuxtheslacker> cheeser bassically don't do anything that would be "shared"[22:46:44] <cheeser> right[22:46:49] <tuxtheslacker> If I would like one variable to stick around in all instances loaded... I COULD create a static variable that would be avaialable to all of them?[22:47:03] <cheeser> which means that if you're using anything other than method params or local variables, you're doing it wrong.[22:47:10] <cheeser> sure[22:47:20] <cheeser> though static in a web app is less universal than you'd think[22:47:44] <tuxtheslacker> well then I shouldn't use that for what I was thinking of. haha.[22:48:45] *** KingBilly has joined ##java[22:48:47] <svm_invictvs> Hm...[22:48:53] <svm_invictvs> Illegal Access Exceptions![22:49:03] <KingBilly> hey do any of you have any previous experience using JCDatabase?[22:49:10] <tuxtheslacker> svm_invictvs: how would you suggest solving the initial problem if not checking that way?[22:49:11] <svm_invictvs> fucking wonderful[22:49:11] <cheeser> ~anyone[22:49:11] <javabot> Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.[22:49:33] <svm_invictvs> tuxtheslacker: Are you writing a server or a client?[22:49:55] <tuxtheslacker> neither.... I guess.[22:50:06] <tuxtheslacker> technically a client.[22:50:08] <svm_invictvs> P2P/[22:50:08] <svm_invictvs> ?[22:50:14] <tuxtheslacker> I guess is how it would be define.[22:50:17] <tuxtheslacker> a web app.[22:50:27] <svm_invictvs> But you're opening a server?[22:50:28] <svm_invictvs> er[22:50:30] <KingBilly> im looking to sort my JCDatabase table "godtimes" in order of the column "START_TF" but i dont know how[22:50:31] <svm_invictvs> socket to listen?[22:50:34] <tuxtheslacker> it'll be checking for open ports on whatever server I will be streaming video from.[22:50:55] <svm_invictvs> So somebody visits your site, and then opens a port.[22:50:59] *** tag has joined ##java[22:51:23] <Elvanor> I am back to my original problem. How can I create a ServletRequestWrapper that will use a different underlying body?[22:51:37] *** MigoMipo has quit IRC[22:51:54] *** zrunn has joined ##Java[22:51:58] <cheeser> underlying body?[22:51:59] <tuxtheslacker> svm_invictvs: someone visits the site....[22:52:07] <tuxtheslacker> then it will write a streaming video file.[22:52:07] <Elvanor> cheeser: or inputstream[22:52:17] <tuxtheslacker> that needs the open ports on the video streaming server.[22:52:19] <cheeser> wth would you want to do that?[22:52:20] <svm_invictvs> tuxtheslacker: Somebody visits your site and that prompts a port to open for listening[22:52:33] *** _stijn_ has joined ##java[22:52:37] <Elvanor> cheeser: because the request I get does not specify the encoding[22:52:37] <svm_invictvs> then the user's client connects to that port...and reads the video stream?[22:52:38] <tuxtheslacker> cheeser I can't really say :-/.[22:52:45] <cheeser> are you still trying to do the read/write thing?[22:52:48] <tuxtheslacker> svm_invictvs: yes.[22:52:49] <Elvanor> I have to grok through the body to get it[22:52:53] <cheeser> tuxtheslacker: i wasn't talking to you[22:52:53] <cheeser> 8^)=[22:53:05] <Elvanor> cheeser: no, done already, but it's for the same ultimate goal[22:53:06] <svm_invictvs> tuxtheslacker: And it reports in the site the port it opened?[22:53:10] <tuxtheslacker> sorry cheeser[22:53:13] <cheeser> Elvanor: why do you need to know the encoding?[22:53:30] <tuxtheslacker> svm. idealy that port should have been closed before connecting.[22:53:31] <Elvanor> well if I dont know the encoding I cannot correctly decode the body[22:53:36] *** _stijn_ has quit IRC[22:53:38] <svm_invictvs> tuxtheslacker: what?[22:53:42] <Elvanor> (or in that case, the HTTP parameters that are in the body)[22:53:46] <Elvanor> (this is a POST)[22:53:51] *** t3mp3st has joined ##java[22:54:01] *** _stijn_ has joined ##java[22:54:08] <cheeser> Elvanor: and request.getParameter("bob") isn't working for you?[22:54:08] <t3mp3st> is there a simple way to perform a "join" across a collection?[22:54:14] <tuxtheslacker> svm_invictvs: it shoulnd't reopen.... but yeah, it would start streaming over those ports.[22:54:16] <svm_invictvs> tuxtheslacker: why does it have to be between 5000, and 6000?[22:54:18] <cheeser> t3mp3st: yep. a loop.[22:54:27] <Elvanor> cheeser: no, since it wont know the encoding[22:54:31] <tuxtheslacker> svm that's arbitrary.[22:54:34] <svm_invictvs> tuxtheslacker: You said you wanted ot open the port?[22:54:41] <tuxtheslacker> just a random port range that was chosen.[22:54:51] <svm_invictvs> so jus topen a fucking listen socket?[22:55:11] *** AskHL has quit IRC[22:55:16] <svm_invictvs> look you open a socket to listen or you open one to connect to another host.[22:55:25] <krad> lol[22:55:27] <cheeser> ~~ Elvanor javadoc ServletRequet.getCharacterEncoding()[22:55:27] <javabot> I don't know of any documentation for ServletRequet.getCharacterEncoding()[22:55:29] <svm_invictvs> I fyou open one ot listen and the port is busy, then you get an exception.[22:55:29] <cheeser> ~~ Elvanor javadoc ServletRequet.getCharacterEncoding(*)[22:55:30] <javabot> I don't know of any documentation for ServletRequet.getCharacterEncoding(*)[22:55:36] <cheeser> ~~ Elvanor javadoc ServletRequest.getCharacterEncoding(*)[22:55:36] <javabot> I don't know of any documentation for ServletRequest.getCharacterEncoding(*)[22:55:39] <svm_invictvs> It's that *fucking* simple[22:55:40] * cheeser sighs.[22:55:40] <Elvanor> By default my container thinks the encoding is utf-8 when no encoding is set, but in that case it is in fact something else[22:55:46] *** mitchnull has left ##java[22:55:51] <zrunn> Does anyone know if I add this annotation to an entity: @GeneratedValue(strategy=GenerationType.IDENTITY), does the identity strategy make the code non portable? Or do all JPA supported databases support identity fields?[22:55:53] <Elvanor> cheeser: getCharacterEncoding() wont work[22:55:58] <cheeser> why?[22:56:01] <Elvanor> since the container has NO way of knowing the encoding[22:56:03] <krad> Elvanor, run 'file' on it :P[22:56:05] <tuxtheslacker> svm, I tried that with...[22:56:11] <tuxtheslacker> Socket sock = new Socket(this.getIpAddress(), 8080);[22:56:14] <cheeser> this has worked for thousands upon thousands of people[22:56:18] <tuxtheslacker> and that doesn't throw an exception.[22:56:22] <Elvanor> because the HTTP request that comes in does not specify an encoding.[22:56:29] <tuxtheslacker> and that's the port that tomcat is sitting on....[22:56:37] <Elvanor> It's only specified in the parameters (that's stupid I know)[22:56:40] <tuxtheslacker> so yeah, I just need one that isn't accepting a connection.[22:56:49] <cheeser> Elvanor: then get that parameter[22:56:52] <Elvanor> I did[22:57:03] <Elvanor> but I have to get it via the input stream[22:57:10] <cheeser> uh...[22:57:13] <cheeser> ~show us[22:57:14] <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.[22:57:18] <Elvanor> ok[22:57:44] <Elvanor> http://rafb.net/p/75u9X024.html[22:58:01] *** josemoreira has joined ##java[22:58:33] <zrunn> PayPal have a Java API you can download[22:58:44] <Seldon75> zrunn: that is amazing[22:58:51] <cheeser> Elvanor: and once you read that stream, the downstream filters don't get aything do they?[22:58:57] *** TJC09 has quit IRC[22:59:02] <Elvanor> cheeser: yes[22:59:08] * cheeser nods.[22:59:19] <cheeser> that was my first bug to resolve when I joined sun.[22:59:20] <cheeser> 8^)=[22:59:21] <tuxtheslacker> svm_invictvs: do you have any ideas?[22:59:30] <Elvanor> cheeser: ?[22:59:34] <cheeser> the fix: don't do that.[22:59:42] *** korney has joined ##java[22:59:49] <Elvanor> What are the alternatives?[22:59:50] *** shadewind has quit IRC[23:00:06] <korney> does anyone know whether j2ee will run on top of 64bit linux? can't find an installer on the site[23:00:28] <cheeser> Elvanor: so if what I'm seeing is correct, you're trying to pass your own RequestWrapper down the filter chain?[23:00:34] <Elvanor> yes.[23:00:35] <cheeser> korney: yes, it iwll[23:00:38] <sproingie> korney: apt-get install glassfish[23:00:43] <cheeser> Elvanor: and the problem with *that* is?[23:00:46] <Elvanor> It does not work though, because I dont really know what to override[23:00:49] <Elvanor> and how[23:00:51] <korney> cheeser, where is the installer? i don't see it at java.sun.com[23:01:02] <cheeser> korney: installer for what?[23:01:06] <Elvanor> I overrided getReader() fine but it is never called[23:01:16] <svm_invictvs> tuxtheslacker: I told you...open...the...socket.[23:01:22] <korney> cheeser: the jars i need[23:01:22] <Elvanor> and I have no idea how to override getInputStream() properly[23:01:28] <tuxtheslacker> svm_invictvs: thanks. with?[23:01:37] <svm_invictvs> new ServerSocket[23:01:40] <svm_invictvs> Or use nio[23:01:47] *** _acid__ has joined ##java[23:01:53] *** timte has quit IRC[23:02:08] <cheeser> Elvanor: so wo what's the error?[23:02:11] <tuxtheslacker> nio?[23:02:14] <tuxtheslacker> what is nio?[23:02:20] <sproingie> ~nio[23:02:20] <javabot> sproingie, nio is http://java.sun.com/javase/6/docs/technotes/guides/io/example/index.html and http://gee.cs.oswego.edu/dl/cpjslides/nio.pdf[23:02:34] <Elvanor> cheeser: what do you mean?[23:02:40] <sproingie> also see xnio[23:02:49] <Elvanor> the error is that later, on my wrapped request, I get no parameters[23:03:02] <dmlloyd> ~xnio[23:03:02] <javabot> dmlloyd, xnio is an NIO replacement framework, which keeps Channels but does away with Selectors, developed by ##java's very own dmlloyd. The project can be found at http://www.jboss.org/xnio - have fun![23:03:12] <Elvanor> I dont know exactly how the processing is done... it seems getParameterMap() does not call getReader()[23:03:31] <Elvanor> or maybe it does, but since it calls getParameterMap() on the original request I cannot see it[23:03:37] *** bitshuffler has quit IRC[23:03:40] <Elvanor> The Decorator pattern does not suit me very well...[23:03:43] *** ScottG489 has joined ##java[23:03:51] <sproingie> i never did learn nio[23:04:23] *** _some0ne has joined ##java[23:04:38] <cheeser> Elvanor: so let's see the code for your wrapper[23:04:44] <Elvanor> ok[23:05:05] <Elvanor> http://rafb.net/p/1V8y7i14.html[23:05:10] <cheeser> and you get no parameters downstream or at that println at line 34?[23:05:33] <Elvanor> these println were debugging code, I actually get some exceptions now that I have them[23:05:36] <cheeser> you don't want a BufferedReader there.[23:05:43] <cheeser> you just want an InputStreamReader[23:05:59] *** Varox has quit IRC[23:06:01] <mers> can someone explain why you can define a parameterized type <T extends A & B> but not define a variable Class<? extends A & B> ? just want to know if i'm missing something[23:06:02] <tuxtheslacker> svm_invictvs: Socket sock = new Socket(this.getIpAddress(), 8080); why does that not fail with an exception?[23:06:06] <Elvanor> according to the API, it's a bufferedReader though[23:06:10] <tuxtheslacker> 8080 is in use by tomcat.[23:06:30] <Elvanor> eg, getReader() returns a BufferedReader[23:06:31] <_some0ne> if the parameters of 0 and 8 were passed to generate the following http://rafb.net/p/7kj0Ya61.html , then how could i write a recursive function that would generate it? the parameters are (int indentation_of_leftmost_line, int number_of_stars_of_longest_line)?[23:06:32] *** omaru has quit IRC[23:06:34] <KingBilly> im looking to sort my JCDatabase table "godtimes" in order of the column "START_TF" but i dont know how, would appreciate any help[23:06:43] <cheeser> Elvanor: hrm.[23:06:56] <Elvanor> cheeser: and anyway this function is never called on my wrapper[23:06:57] <vol> godtimes?[23:06:59] <tuxtheslacker> svm_invictvs: sorry for being a pain, I'm just trying to understand.[23:07:02] <vol> sacrilicious[23:07:07] <cheeser> Elvanor: check and see if getInputStream is.[23:07:07] <Elvanor> eg, the println "getReader()" is never executed.[23:07:13] <cheeser> i have a feeling it's calling that.[23:07:14] <KingBilly> heh its for a game i play[23:07:22] <Elvanor> No, getInputStream() is not.[23:07:25] <cheeser> you want to save off that BAIS you create in the constructor and return that there.[23:07:41] <Elvanor> yeah but the API says I should return a ServeltInputStream[23:07:47] <Elvanor> and I have no idea how to create one[23:07:51] <Elvanor> this is an abstract class[23:08:03] <svm_invictvs> tuxtheslacker: I odn't know what you're trying to do. An dI'm taking a best guess. And the way you describe your problem, it seems to me you have a serious lack of understanding as to how sockets work.[23:08:30] <cybereal> Elvanor: read the specification of the class's interface, subclass it, and make sure you implement it properly?[23:08:31] <svm_invictvs> ~~ tuxtheslacker ServerSocket[23:08:31] <javabot> tuxtheslacker, I have no idea what ServerSocket is.[23:08:36] <svm_invictvs> ~~ tuxtheslacker javadoc ServerSocket[23:08:36] <javabot> tuxtheslacker: http://is.gd/jSKS [java.net.ServerSocket][23:08:51] <Elvanor> cybereal: hmm[23:08:57] <cheeser> Elvanor: so return an anonymous inner class that wraps the BAIS and behaves accordingly[23:08:59] <cybereal> You probably won't have to do much[23:09:01] *** jabalsad has quit IRC[23:09:21] *** jabalsad has joined ##java[23:09:28] <Elvanor> cybereal: The only method is readLine(), and dmlloyd just pointed out it's bugged anyway... so...[23:09:39] <tuxtheslacker> svm_invictvs: that's kinda the problem.... I am trying to think of a way to solve it. I just need to find 3 open ports locally....[23:09:42] <tuxtheslacker> we'll make it local.[23:09:44] <Elvanor> cheeser: an anonymous inner class. you lost me there[23:09:47] <tuxtheslacker> cuz that's what I need now.[23:09:59] <Elvanor> and anyway that getInputStream() method is not called[23:10:10] <tuxtheslacker> svm_invictvs: I just need to find three open ports between the port range 5000 and 6000[23:10:17] <sombriks> see also http://java.sun.com/j2se/1.4.2/docs/guide/nio/example/[23:10:48] <svm_invictvs> tuxtheslacker: you open them to listen or to connect?[23:11:11] <Elvanor> cheeser: The only way I see out of this mess is to manually parse the parameters out in a Map, and then override getParameterMap(0 in the wrapper[23:11:16] <Elvanor> That's just plain ugly though.[23:11:39] *** t3mp3st has quit IRC[23:12:10] *** krad has quit IRC[23:12:18] <cheeser> how do you know that neither getReader() nor getInputStream() are getting called?[23:12:29] *** DoYouKnow has quit IRC[23:12:30] <tuxtheslacker> svm_invictvs: I don't open them... darwin streaming server will sue them.[23:12:33] <Elvanor> Well, I put out a println line on each of these methods[23:12:38] <Elvanor> And it gets never printed[23:12:44] <tuxtheslacker> I just need to know which three aren't being used so that I can tell dss to use it.[23:12:54] <zrunn> tux just use telnet or something[23:12:55] <Elvanor> getParameterMap() does get called though.[23:12:57] <cybereal> better at least fill those methods with "throw new IAmSeriouslyLazyAndDidNotWantToImplementThisException()"s[23:13:07] <svm_invictvs> tuxtheslacker: So...your java process just...does what then?[23:13:26] <svm_invictvs> tuxtheslacker: so some other process has them open?[23:13:31] <Elvanor> cybereal: that was for me?[23:13:35] <cybereal> Elvanor: yes[23:13:43] <Elvanor> Why, since I call the super class method[23:13:52] <Elvanor> no need to throw exceptions[23:13:59] <cybereal> does that do what it's supposed to?[23:14:00] <tuxtheslacker> svm_invictvs: I don't want it used if another one has them open as in being used.[23:14:08] <tuxtheslacker> I need to find three ports that aren't being used at all.[23:14:14] *** magmarules has quit IRC[23:14:15] <Elvanor> Well, it then calls the methods on the original object.[23:14:16] *** indeterminatus has joined ##java[23:14:21] <Elvanor> Of course, that's not what I need.[23:14:29] <cybereal> right so it sounds like the answer is "no"[23:14:38] <Elvanor> but I cannot find an elegant way to make it work as it should.[23:14:41] <cybereal> which means the operations aren't supported/implemented properly[23:14:46] <Elvanor> Maybe it is not even possible...[23:14:47] <cybereal> then do it INelegantly[23:14:55] <cybereal> talk less code more[23:15:04] <cybereal> Do it. Do it right. Do it well....[23:15:08] <svm_invictvs> tuxtheslacker: then open a socket..starting at 5000...if it fails...open 5001...and keep doing that until you find three ports[23:15:13] <Elvanor> cybereal: well the only way I thought, as I said, was to manually parse the params in a Map[23:15:20] <cybereal> then do it[23:15:22] <Elvanor> but that's absurd[23:15:25] <cybereal> sounds like you have a simple solution right there[23:15:26] <tuxtheslacker> svm_invictvs: that's what I'm trying to do?[23:15:30] <cybereal> why is it absurd?[23:15:32] <Elvanor> I am redoing all the work of the servlet container[23:15:36] <tuxtheslacker> svm_invictvs: but server_socket doesn't fail.[23:15:38] <tuxtheslacker> ?[23:15:40] <Elvanor> reimplementing what they did etc[23:15:44] <cybereal> Elvanor: indeed, why ARE you trying to do that?[23:15:46] <Elvanor> Well, a small part anyway ;)[23:15:49] <svm_invictvs> tuxtheslacker: then the port is available.[23:15:56] <Elvanor> cybereal: what do you mean?[23:16:00] <svm_invictvs> tuxtheslacker: and you have it now.[23:16:05] <Elvanor> Why do I *need* to do that ?[23:16:12] <zrunn> svm, doesn't he have to call accept first before it will throw the exception?[23:16:12] <cybereal> Elvanor: I mean I have no idea why you would ever need to return a ServletInputStream if you're not a servlet container[23:16:14] <svm_invictvs> tuxtheslacker: so you found an open port?[23:16:21] <svm_invictvs> ~next[23:16:21] *** karl_s has joined ##java[23:16:21] <javabot> Another satisfied customer. Next![23:16:25] <cybereal> Elvanor: so yes, why do you need to do this? what is it that you're even doing?[23:16:27] *** raybr has joined ##java[23:16:28] <cheeser> filtere aren't really intended for what you're trying I don't think[23:16:48] <Elvanor> I have to because stupid PayPal does not specify the encoding of the request in a header[23:16:50] <Elvanor> but in a parameter[23:16:55] <tuxtheslacker> svm_invictvs: oh, I think we're defining open differently.[23:17:01] <Elvanor> However, this encoding is crucial to get the data decoded correctly[23:17:01] <tuxtheslacker> tomcat is sitting and listening on port 8080[23:17:15] <cheeser> Elvanor: so you're processing a respose *from* paypal?[23:17:16] <Elvanor> cheeser: Well, if filters are not the correct solution... what is ??[23:17:17] <cybereal> so decode the data in your filter and place it in the request context[23:17:24] <Elvanor> cheeser: yes, from paypal[23:17:25] *** karl_s has left ##java[23:17:30] <cheeser> maybe servlets/forwards are a better choice[23:17:34] <svm_invictvs> tuxtheslacker: no, you can't just test if a port is open. Testing if it's open and opening it are the same operation.[23:17:39] <cheeser> Elvanor: then wtf are you using a servlet?[23:17:43] <cybereal> heh[23:17:51] <Elvanor> cheeser: I dont get it?[23:18:07] <Elvanor> The servlet will process the PayPal's HTTP request[23:18:23] <tuxtheslacker> svm_invictvs: lemme restate this... I need to find three ports that aren't used by anything.[23:18:25] <zrunn> this is like watching paint dry[23:18:32] <cybereal> Elvanor: your servlet can read the parameter and decode the input stream, why is this hard?[23:18:49] <Elvanor> To read the parameter you need to have the encoding before hand[23:18:53] <tuxtheslacker> if I use a socket...[23:19:00] <cheeser> Elvanor: why are you using a servlets to talk to another server's servlets?[23:19:02] <svm_invictvs> tuxtheslacker: and do what with them?[23:19:02] <Elvanor> you cannot redecode once you started reading out the params[23:19:11] <cheeser> ise http-components[23:19:20] <cybereal> Elvanor: sure you can, just keep the bytes[23:19:23] <tuxtheslacker> as far as the java is concerned nothing... just to know that they're not being used by anything.[23:19:32] <tuxtheslacker> then I'll start darwin streaming server using those ports.[23:19:34] <cybereal> use a BufferedInputStream and .mark()[23:19:40] <Elvanor> cheeser: Of course I am using httpclient, but after[23:19:41] <cybereal> whatever works for your preference[23:19:42] <svm_invictvs> tuxtheslacker: you can't do that.[23:19:52] <Elvanor> the first request from PayPal must go through a servlet[23:19:52] <cheeser> Elvanor: after what?[23:19:53] <cybereal> cheeser: when paypal's done, it POSTs to your server[23:19:58] <Elvanor> exactly[23:20:06] <tuxtheslacker> svm_invictvs: I have it done in php....[23:20:09] <svm_invictvs> tuxtheslacker: just start darwing streaming service and ask it if it was successful.[23:20:12] <cheeser> oh, i see.[23:20:32] <Elvanor> cybereal: If I keep the bytes, I can decode later, but only manually[23:20:36] <tuxtheslacker> svm_invictvs: you need to tell it three to run on. I need to have several users doing this at once. having it fail... doesn't work.[23:20:38] <cheeser> Elvanor: what happens downstream? why not just do all this in a servlet?[23:20:40] *** Seldon75 has quit IRC[23:20:43] <Elvanor> Eg, if I parse the params manually[23:20:59] <tuxtheslacker> svm_invictvs: That's not an acceptable solution.[23:21:01] <cheeser> it sounds like you're just overengineering this thing to death[23:21:03] <Elvanor> downstream I am processing the params[23:21:08] <Elvanor> I dont think so[23:21:12] <cybereal> Elvanor: I don't believe that paypal's been working all these years, owned by a company with one of the largest deployments of java based web tech on the internet, and they don't do POST properly[23:21:14] <cheeser> i do.[23:21:23] <Elvanor> I DO !!!!!!![23:21:30] <Elvanor> Test and you will see :)[23:21:30] <cheeser> yeah. you're doing something wrong.[23:21:55] <Elvanor> cheeser: My initial implementation was extremely easy. And works fine most of the times[23:22:03] <Elvanor> but it fails when the params are in a weird encoding[23:23:19] <Elvanor> Because what you need to do is to post the data back to their server exactly as they sent it to you[23:23:21] *** _some0ne has quit IRC[23:23:28] <svm_invictvs> tuxtheslacker: you have no guarantee that between the time you check the port and the time that darwin streaming opens the port that something else will not have stolen the port.[23:23:31] *** Lorde has joined ##java[23:23:37] <Elvanor> so if you decode with a wrong encoding, you are f**[23:23:42] <tuxtheslacker> svm_invictvs: you're right.[23:23:45] *** [Steffy] has joined ##java[23:23:50] <tuxtheslacker> that's something I can deal with :-)[23:23:59] <tuxtheslacker> and that's expected.[23:24:01] <svm_invictvs> tuxtheslacker: That's why no API exist...[23:24:03] <tuxtheslacker> if the streaming fails that's okay.[23:24:03] <Lorde> how do i test the value of an enum in <s:if> ? <s:if test="%{#enum == 'DESIRED_VALUE'}"> doesn't seem to work, neither if i set == 0 or ==1 instead of a string value... ?[23:24:18] <svm_invictvs> tuxtheslacker: why not just do new Socket(5000);?[23:24:22] <cheeser> what is <s:if>?[23:24:23] <svm_invictvs> And then close it right away?[23:24:41] *** davyg has joined ##java[23:24:42] *** _stijn_ has quit IRC[23:24:47] <Lorde> cheeser - a struts JSP tag[23:24:59] <tuxtheslacker> svm_invictvs: I need to check if it's available externally.[23:25:23] <zrunn> Elvanor, here's a suggestion... use Commons-FileUpload.. even though it's mainly for file uploads, it can read an inputstream and decode each field with a different encoding if you want..[23:25:42] <Elvanor> wont help[23:26:04] <zrunn> why not? copy the bytes into a byte[], create a ByteArrayInputStream and use it as many times as you need[23:26:27] <davyg> is Object newObject = (Object)otherObject the same as Object newObject = new Object(otherObject)? (assuming a copy constructor)[23:26:28] * cheeser leaves Elvanor to doing the stupid and goes back to his own mess of cocde[23:26:47] <svm_invictvs> tuxtheslacker: how does PHP do it?[23:26:50] <cheeser> ~~ davyg casting[23:26:50] <javabot> type casting is a way of changing the type of a reference (it NEVER changes an object), or a sloppy way of converting between different primitive types. (Type) expression type-casts the result of expression to Type.[23:27:06] *** buntfalke has quit IRC[23:27:06] <davyg> thx[23:27:13] <svm_invictvs> tuxtheslacker: link the PHP function you'veused before and let's try to find a Java equivalent[23:27:13] <tuxtheslacker> svm binds to the port.[23:27:22] <reverend> ~conventions[23:27:23] <javabot> reverend, conventions is http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html , or "ThisIsAClassName, thisIsAVariableOrMethodName, THIS_IS_A_CONSTANT_NAME"[23:28:09] <Elvanor> What is stupid is that as soon as you call reading the stream, any other method won't work[23:28:29] <cheeser> because you can only read the stream once[23:28:33] <Elvanor> eg getParameter()[23:28:41] <Ven]n> Im making a media player in JMF, but I cant get my JSlider to update the video frame while dragging. Any ideas?[23:28:43] <Elvanor> yeah, but I hoped to get around that with a wrapper cheeser[23:29:22] <zrunn> Elvanor, the method I told you will let you read it as many times as you want[23:29:28] *** TooAngel has joined ##java[23:29:31] <tuxtheslacker> svm_invictvs: $portOpen = @socket_bind($sock[$socketNumber], $serverExternalIP, $i);[23:29:38] <tuxtheslacker> that's the php version.[23:29:42] <Elvanor> I dont think It will help me.[23:29:51] <tuxtheslacker> if it fails it returns false.[23:29:54] <Elvanor> I need the parameters accessible in the standard servlet framework afterwards[23:29:56] <tuxtheslacker> svm_invictvs: ^^[23:29:58] *** yobo2 has joined ##java[23:30:06] *** TooAngel has left ##java[23:30:28] *** t3mp3st has joined ##java[23:30:46] *** TooAngel has joined ##java[23:30:48] <zrunn> Elvanor, you could write a proxy then[23:30:55] <zrunn> haha[23:31:02] <t3mp3st> is it incorrect/inefficient to build up strings from various primitive types using the "+" operator?[23:31:17] <Elvanor> zrunn: sure... but THIS is clearly overengineered[23:31:28] <t3mp3st> (these are fixed strings; there is no loop involved -- just "plugging in" certain values to yield the final string)[23:31:32] <cheeser> it's fine but can incur performance penalties[23:31:45] <yobo2> hey guys; sorry this question is really off topic but maybe somebody in here has dealt with it before. i'm documenting an enterprise system (most components *are* written in java, heh), and i'm trying to make this uml diagram, but i can't figure out what the "component" shape is for. its a rectangle, with two smaller rectangles hanging off the left side of it. has anybody ever seen/used this shape in a system diagram?[23:31:49] <yobo2> and knows what its for?[23:32:00] <zrunn> I'm pretty sure the compiler will optimize concating primitives into a StringBuilder[23:32:10] <tuxtheslacker> van someone name a port that's always in use that isn't a listener?[23:32:16] <tuxtheslacker> er that isn't listening?[23:32:18] <t3mp3st> zrunn: is a StringBuilder the "correct" way to do this sort of thing?[23:32:33] *** pertl has quit IRC[23:32:48] <yobo2> t3mp3st: didnt see the beginning of you rquestion but stringbuilder *is* the correct, commonly used, and efficient way of building up strings incrementally.[23:32:49] <zrunn> t3mp3st: If you're really that eager to get optimization, you could try both methods and then decompile the class files with jad or something[23:33:04] <Elvanor> cheeser: If I use a forward(), can the input stream be read once more?[23:33:23] * Elvanor does not know well yet how forwarding works[23:33:28] <cheeser> decompiling should never be the first step in optimization[23:33:34] <t3mp3st> yobo2,zrunn: thanks! I've just got a whole lot of +ing and figured I should fix my bad habbit[23:33:40] <zrunn> t3mp3st: If you don't have a loop I'm pretty sure the compiler will optimize it into a StringBuilder which is the same as if you did it manually[23:33:41] <cheeser> ~~ Elvanor tias[23:33:41] <javabot> Try it and see. You learn much more by experimentation than by asking without having even tried.[23:33:56] <svm_invictvs> ugh[23:34:00] <svm_invictvs> reflection ><[23:34:06] <svm_invictvs> I wish I didn't have to use reflection for this.[23:34:08] <yobo2> t3mp3st: its because regular Strings aren't mutable; so each + will create a new string that contains the old ones concatenated. StringBuilder will append data in place. that said, you still probably want to make sure thats where your performance bottleneck actually is.[23:34:27] *** Ivellina has quit IRC[23:34:30] <t3mp3st> right -- I think I may be prematurely optimizing :([23:34:43] <t3mp3st> hm, thanks for the advice all[23:37:08] *** TooAngel has quit IRC[23:37:12] *** TooAngel has joined ##java[23:37:47] *** Yustme has quit IRC[23:37:47] <tuxtheslacker> how do I close force an opened port to close?[23:38:16] <Elvanor> Can you even call forward() on a filter and not a servlet?[23:38:27] *** TooAngel has left ##java[23:39:05] <Elvanor> I mean, intercept the request in a filter, but then forward it and not call doChain()[23:39:11] <yobo2> Elvanor: servlet filters dont have a forward[23:39:24] <yobo2> Elvanor: what are you trying to do? doChain() is like forwarding it to the next filter...[23:39:36] <zrunn> Elvanor how come PayPal is posting back to you anyway? Which API is that?[23:39:43] <yobo2> er, FilterChain.doFilter that is[23:39:44] <Elvanor> zrunn: IPN[23:40:02] *** DragonLord- has quit IRC[23:40:05] <Elvanor> yobo2: yes, I am trying to forward it to another servlet to see if I can read again from the stream[23:40:18] <cheeser> the RequestDispatcher does, though, on ServletRequest[23:40:35] *** sphenxes has joined ##java[23:40:35] <Elvanor> cheeser: exactly but it is legal to call it when on a Filter?[23:41:33] *** nvictor has joined ##java[23:41:52] <yobo2> Elvanor: it seems risky; nothing in the servlet specification (afaik) says that forward() defers the actual forwarding until it reaches a servlet[23:41:56] *** HockeyInJune has quit IRC[23:42:05] <yobo2> Elvanor: so if you jump to a servlet while in a filter, it may not produce the expected results[23:42:05] <zrunn> Elvanor, can you use the filter to re-encode the value back into bytes using the incorrect charset and then decode it again using the correct charset?[23:42:27] <Elvanor> zrunn: no[23:42:28] <yobo2> why do you need to do that at the filter level?[23:42:38] <Elvanor> once I read the stream I am basically out of luck[23:42:47] <Elvanor> yobo2: stupid PayPal encoding problem[23:43:06] <Elvanor> I need to know the encoding of a request, but it is only specified in a parameter[23:43:12] <Elvanor> not in the header as it should[23:43:15] *** nvictor has left ##java[23:43:26] <zrunn> does the encoding change each time they send it?[23:43:31] <Elvanor> zrunn: yes[23:43:35] <Elvanor> that's the problem :)[23:43:36] <yobo2> Elvanor: and you are processing the encoded data in a filter?[23:43:39] *** elementz has quit IRC[23:43:54] <Elvanor> yobo2: I am trying to extract the encoding in a filter yes[23:44:11] <Elvanor> This part works, but once I am done there is no longer any parameter for the request[23:44:21] <Elvanor> Eg, if I read the stream myself I break everythin[23:45:00] <yobo2> Elvanor: so by "parameter" do you mean an http get parameter? or data in the actual stream?[23:45:07] <yobo2> because you should be able to access request parameter just fine[23:45:09] <Elvanor> http post parameter in this case[23:45:11] <yobo2> from a filter[23:45:39] <Elvanor> I can access the request parameter just fine, but if I do that, the encoding will already have been appliec[23:45:40] <Elvanor> applied[23:45:41] *** TooAngel has joined ##java[23:45:57] <zrunn> Elvanor, you have to read the stream yourself or the container will decode the value itself[23:46:00] <Elvanor> eg if I do getParameter() I cannot call setCharacterEncoding() later[23:46:04] <yobo2> ah[23:46:07] <yobo2> well[23:46:12] <Elvanor> zrunn: yes I do it myself[23:46:19] <yobo2> can you call getParameter(), read the stream as raw bytes later, and decode it a different way?[23:46:19] <Elvanor> but once I did it I need to rewind it[23:46:24] *** eduardoboss has joined ##java[23:46:24] <cheeser> i still think you should just read in the stream and precess it all right there rather than this stuipd filter bit.[23:46:26] <Elvanor> which is not possbile[23:46:44] <Elvanor> cheeser: You mean, manually parse everything?[23:46:45] <zrunn> Filters can read streams and then Servlets can read them again[23:46:49] *** t3mp3st_ has joined ##java[23:47:04] <cheeser> sure. if you have to.[23:47:06] <Elvanor> zrunn: again ?[23:47:06] *** mosno has joined ##java[23:47:10] <yobo2> Elvanor: no[23:47:33] <Elvanor> Can a filter read a stream, then later a servlet will reread it from beginning >[23:47:53] *** Ilaggoodly has joined ##java[23:47:56] <Ilaggoodly> hi[23:48:02] <Elvanor> yobo2: and no, I cannot call getParameter(0 then read the stream as raw bytes[23:48:07] <Ilaggoodly> does anyone have experience working with jpcap on mac[23:48:08] <Ilaggoodly> ?[23:48:18] <yobo2> Elvanor: getParameter() to get the encoding, then use request.getInputStream() to read the data instead of request.getWriter(), and wrap that with an InputStreamReader, passing the appropriate charset.[23:48:19] <Elvanor> if you call getParameter() the container will have read the input stream already[23:48:38] *** vyoman has quit IRC[23:48:52] <Elvanor> I tried the wrapper route and this is a mess[23:49:02] <Elvanor> not working at all[23:49:17] *** TooAngel has left ##java[23:49:24] <zrunn> Elvanor, I know you can read the stream with a filter and then again with a Servlet because I have seen things that modify the stream[23:49:47] <Elvanor> zrunn: you are sure?[23:50:10] <Elvanor> How would I then?[23:50:11] <cheeser> there's a grizzly class that will parse those params for you.[23:50:23] <cheeser> or you can dep directly on a tomcat/jetty class depending on your platform[23:50:27] <yobo2> Elvanor: it sounds like a filter is not the best approach here; is it too late to change the implementation?[23:50:33] <Elvanor> yobo2: no[23:50:48] <yobo2> so why not just decode right at the servlet level and not use a filter for it?[23:50:49] <Elvanor> I am looking for the best implementation, mainly to learn[23:50:57] <yobo2> it seems like you'll save yourself a bit of a hassle.[23:51:00] <Elvanor> I cannot[23:51:04] <Elvanor> I am using Spring[23:51:09] <yobo2> ah[23:51:10] <zrunn> yobo2: I told him that but he said he wants to use HttpServletRequest.getParameter() like normal *AFTER* he fixes the stream[23:51:13] *** skypce has joined ##java[23:51:51] <yobo2> ive never used spring so i dont have any more advice there; spring won't let you add processing at that level?[23:52:02] <cheeser> oh, yeah. i've already declared this a lost cause once[23:52:16] <zrunn> It just seems weird that PayPal wouldn't decode and re-encode the data properly... I guess they just re-use whatever the customer's web browser was using?[23:52:27] <Elvanor> I am not an expert, but I think Spring does too much for you, so you are stuck[23:52:43] <Elvanor> zrunn: PayPal decodes and reencodes properly[23:52:56] <Elvanor> what they dont do however is send their request encoding in the header !!!![23:53:28] <zrunn> So you're saying the entire stream is encoded differently each time they post?[23:53:35] <Elvanor> yes[23:53:37] <zrunn> that seems kind of stupid[23:53:43] <yobo2> its random encoding each time?[23:53:45] <yobo2> not based on anything?[23:53:49] <Elvanor> In my case, almost[23:54:00] <Elvanor> It is based on your PayPal preferences as a vendor[23:54:18] <Elvanor> I am developing a solution for multiple vendors though so I cannot know what each one preference will be[23:54:21] *** noobraska has joined ##java[23:54:32] <Elvanor> But I receive all the requests at a centralized place[23:54:52] <zrunn> Can't you just tell your customers to use UTF8?[23:55:05] <yobo2> Elvanor: maybe ask on paypaldev.org?[23:55:08] <Elvanor> I could, this would place the burden on them though :)[23:55:24] <Elvanor> so no I dont want. I want to deal with whatever encoding they might have[23:55:30] <yobo2> Elvanor: or if your back-end is making the requests to paypall just always encode as utf-8?[23:55:42] <yobo2> are customers making direct requests to paypal or is it going through your application on the way?[23:55:53] <Elvanor> yobo2: that does not matter[23:55:54] *** romanb has quit IRC[23:56:04] <skypce> how can i use variables in boletas.java from a other file nuevoDialog.java[23:56:08] <Elvanor> customers go to paypal then PayPal POSTs to my server[23:56:32] <Elvanor> with an encoding I may not know in advance[23:56:35] *** jcp has quit IRC[23:56:38] *** DjZemich has quit IRC[23:56:43] <Elvanor> They do send the encoding, just not as they should...[23:57:05] <yobo2> ah[23:57:16] <Elvanor> as I explained, they send it as a HTTP parameter[23:57:20] <Elvanor> not in the header[23:57:30] <Elvanor> hence all my troubles[23:57:41] *** jdolan_ has quit IRC[23:57:58] *** geaaru has quit IRC[23:58:06] <yobo2> what kind of data does paypal post to your server? does it happen to be xml?[23:58:10] <Elvanor> no[23:58:16] <Elvanor> plain http aprameters in a post[23:58:20] <Elvanor> pa*[23:58:35] <yobo2> and those parameters are encoded with an encoding specified as one of the parameters?[23:58:38] <yobo2> thats really weird, lol[23:58:39] <Elvanor> I am trying the forward() method in a filter right now[23:58:45] <Elvanor> let's see how it goes[23:58:50] <Elvanor> yobo2: yes that's weir[23:58:57] <Elvanor> but that is how it is unfortunately.[23:59:08] <Elvanor> Hence all the mumbo jumbo ! :)[23:59:11] <yobo2> the thing is[23:59:32] <yobo2> now i may be wrong here but you would assume that if it was a major issue, it would no longer be an issue. there must be a simpler solution.[23:59:45] <Elvanor> Major issue?[23:59:49] <yobo2> yes[23:59:49] <Elvanor> what do you mean?