NOTICE: This channel is no longer actively logged.
[00:00:25] *** joeo has joined ##java[00:00:37] *** iluvgrlzwglasses has joined ##java[00:00:43] *** jottinger has quit IRC[00:00:48] *** ozzloy is now known as rum[00:02:11] <cheeser> you can't use FileReader on a jarred resource[00:02:17] <cheeser> use an InputStreamReader[00:02:28] <meanburrito920_> ah thanks[00:02:39] *** Xianny has joined ##Java[00:02:58] *** rum is now known as whiterussian[00:03:06] <AMcBain> meanburrito920_: if you use getResourceAsStream, you don't need to worry about loading it up into a StreamReader[00:04:55] <AMcBain> meanburrito920_, I mean, that getResourceAsStream will turn it into a stream *for* you, so that you don't need to get the URL object first.[00:07:12] <AMcBain> meanburrito920_, an InputStream can be sent to a StreamReader via constructor[00:07:47] * AMcBain flips the switch on meanburrito920_'s client to bring it back into the channel.[00:08:08] * cheeser gives AMcBain some Kaopectate[00:08:10] <cheeser> 8^)=[00:08:37] <meanburrito920_> sorry, I'm a bit new to IRC. what did you just do, exactly?[00:09:00] * meanburrito920_ is confused[00:09:32] *** warriorforgod has joined ##java[00:10:11] <AMcBain> meanburrito920_: nothing in particular, just that most people prefer you ask before you PM them.[00:10:19] <AMcBain> (if they don't know you)[00:10:26] <meanburrito920_> ah. sorry[00:10:41] *** Varox has joined ##java[00:11:19] *** blahjake has quit IRC[00:11:23] <vinse> ./pm AMcBain so what r u wearing?[00:11:30] <vinse> argh sorry typo[00:12:31] <surial> ~javadoc UnsupportedEncodingException[00:12:31] <javabot> http://java.sun.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html[00:13:05] *** dvayanu has joined ##java[00:14:09] <surial> ~javadoc URLEncoder[00:14:09] <javabot> http://java.sun.com/javase/6/docs/api/java/net/URLEncoder.html[00:14:23] *** rollins has quit IRC[00:14:33] <meanburrito920_> just curious, how do you make a jar into an executable? for instance, eclipse is an executable when you download it.[00:15:10] <AMcBain> you put a main-class entry in the JAR manifest file that points to the class with your main method in it.[00:15:23] *** GodTodd_ has joined ##java[00:16:15] <meanburrito920_> Mine has that, but when I double click on it, it just opens the jar as an archive[00:16:15] <cybereal> meanburrito920_: that exe in eclipse isn't a standard java thing[00:16:23] <meanburrito920_> ah[00:16:43] <AMcBain> meanburrito920_, what platform?[00:16:44] <cybereal> meanburrito920_: there are some third party tools so you can have an executable if you really need it (for example, I use tanukusoft's java service wrapper so I can have a java app run as a service on windows)[00:16:53] <surial> ~~meanburrito920_ jsmooth[00:16:54] <javabot> meanburrito920_, exe wrappers is A way to package a java jar nicely as a windows EXE file. The window gets a logo of your choice and your app's entry in the process table has a proper name (instead of javaw). jsmooth ( http://jsmooth.sourceforge.net/ ) is open source and good. exe4j is shareware and also acceptable ( http://www.ej-technologies.com/products/exe4j/overview.html ). If you need to recompile java code to native windows code, ask me about[00:17:00] <meanburrito920_> platform is Ubuntu 8.10[00:17:12] <surial> shame about the cutoff.[00:17:15] <AMcBain> ah, they might not have a "jar launcher"[00:17:26] <meanburrito920_> but I expect it to run on windows xp also[00:17:52] <AMcBain> On XP, there is a JAR launcher of sorts, if Java is installed, double clicking it will run it (if you specified Main-Class)[00:17:57] <meanburrito920_> ok[00:18:12] <AMcBain> For linux, you can make a shell file that calls "java -jar file.jar"[00:18:19] <meanburrito920_> if i left-click in ubuntu, it gives me the option to 'open with Java'[00:18:22] <meanburrito920_> ah[00:18:23] *** codev has quit IRC[00:18:25] <AMcBain> ah, there you go.[00:18:26] <meanburrito920_> that works[00:18:31] <surial> ~~meanburrito920_ jsmooth[00:18:32] <javabot> meanburrito920_, exe wrappers is A way to package a java jar nicely as a windows EXE file. The window gets a logo of your choice and your app's entry in the process table has a proper name (instead of javaw). jsmooth ( http://jsmooth.sourceforge.net/ ) is open source and good. exe4j is shareware and also acceptable ( http://is.gd/hRoI ). If you need to recompile java code to native windows code, ask me about ~jet[00:18:33] <surial> fixed.[00:18:33] *** buntfalke has quit IRC[00:19:34] <meanburrito920_> coolio[00:19:51] *** epalm has quit IRC[00:20:01] *** waz has joined ##java[00:20:06] <Obeliks> ~jet[00:20:07] <javabot> Obeliks, jet is Excelsior Jet, a commercial runtime environment and compiler that can generate native executables from Java source. Is it good? Don't know - never needed it. Check http://www.excelsior-usa.com/jet.html for more information. If you just need to package up your java in a nice windows .exe file, ask me about ~exe wrappers[00:20:27] *** amz has joined ##java[00:20:35] <Obeliks> JavaSE6, wow[00:20:38] *** Tniffoc has joined ##java[00:21:35] *** waz has quit IRC[00:21:39] *** zmanning has quit IRC[00:22:09] *** JoshJ has joined ##java[00:22:21] <Tniffoc> Can anybody help me with an IllegalMonitorStateException?[00:22:33] *** le_biloute is now known as \le_grognon[00:22:46] <JoshJ> ~pastebin[00:22:46] <javabot> http://www.papernapkin.org/pastebin Paste the final url after you've pasted your stuff there.[00:22:48] <AMcBain> I'm going to guess you tried to aquire the lock of an object without synchronizing on it first.[00:23:02] <AMcBain> (viia notify, no less)[00:23:03] <cybereal> Tniffoc: you need to read the docs more carefully on the method that threw that exception, it almost certainly tells you to acquire a lock on the object on which you invoked the method before invoking it[00:23:56] <Tniffoc> cybereal: why would it throw the exception on this.wait(x) though?[00:24:04] <cybereal> because of what I just said[00:24:07] <cybereal> read it again if you must[00:24:19] *** \le_grognon is now known as \etienne[00:24:33] <JoshJ> http://gist.github.com/55347[00:24:43] <JoshJ> Got a question about hashtable keys and enumerations[00:25:01] <Tniffoc> cybereal: ok tysm.... I'll look at that[00:25:09] <JoshJ> Basically, I've got two hashtables and I'd like to compare the stuff in one hashtable (which could have several objects to one key) to the stuff in another hashtable (which only has one value to a key)[00:25:33] *** joeo has quit IRC[00:26:07] *** iluvgrlzwglasses has quit IRC[00:26:22] <tieTYT> JoshJ: seems like two unrelated tasks[00:26:39] <tieTYT> JoshJ: compare them in what way?[00:26:41] *** igordcard has quit IRC[00:27:10] <JoshJ> tieTYT, basically, i've got a hashtable with each state as a key; and i'd like to be able to iterate through all the states[00:27:38] <JoshJ> stuff in one hashtable has a value "A" that i'd like to compare (basic subtraction) to the "B" in another hashtable[00:27:42] <JoshJ> for the same state, of course[00:28:12] <surial> Enumerations? Hashtables?[00:28:14] <surial> Holy shit.[00:28:20] <surial> JoshJ: Can I borrow your time machine?[00:28:28] <JoshJ> er[00:28:31] <JoshJ> what should i be doing? >_>[00:28:37] *** Tniffoc has quit IRC[00:28:42] <joed> Blogging?[00:28:44] <tieTYT> hashmap[00:28:46] <cybereal> JoshJ: like 10 years ago java added the collections APIs, use those if you don't want to get sneered at[00:28:49] <cybereal> Map[00:28:53] <cybereal> Iterator[00:28:55] <surial> HashMap, Iteration, foreach loops.[00:29:04] <cybereal> ~~ JoshJ collections[00:29:04] <javabot> JoshJ, The Collections API is available at http://java.sun.com/javase/6/docs/technotes/guides/collections/index.html[00:29:14] <surial> for ( String key : map.keySet() ) { doSomethingWithKey(key); }[00:29:51] <surial> Hashtable and Vector are sort of deprecated. Not marked as such because that would cause backwards compatibility issues (and they wont be going away either), but their design is inferior and their namespaces are corrupted with crud.[00:29:57] *** Varox has quit IRC[00:29:58] <surial> Use HashMap and ArrayList instead.[00:30:05] <surial> ~Vector[00:30:05] <javabot> surial, Vector is 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(*)".[00:30:41] <tieTYT> if you want to make your own synchronized list, shouldn't you extend Vector?[00:30:45] *** pgib has quit IRC[00:30:59] <surial> no.[00:31:13] <surial> What does that have to do with anything?[00:31:33] <tieTYT> because it's synchronized[00:31:35] <surial> extending vector is an -excellent- way to fuck up the dubious synchronization that vector does do, in fact.[00:31:38] *** shadewind has joined ##java[00:31:53] <tieTYT> i see[00:32:05] <tieTYT> so if you want your own... you just gotta synchronize it yourself[00:32:15] <JoshJ> I see[00:32:21] <surial> just extend your list, and run it through Collections.synchronizedList. Or, better yet, don't use that at all, because unless you know what you are doing, thinking that 'I made it synchronized / I use vector, therefore all thread problems are bygones now' is going to bite you in the ass, sooner rather than later.[00:32:35] <JoshJ> so i should rewrite my stuff to use hashmap instead of hashtable now, huh?[00:32:36] <surial> e.g:[00:32:41] *** FireSlash has joined ##java[00:32:55] <surial> if (list.size() < 10) list.add("foobar"); //even if list is synchronized, or especially if it is synchronized, this code is buggy.[00:33:01] <tieTYT> JoshJ: make them use Map[00:33:18] <tieTYT> why especially?[00:33:27] *** bas-i has joined ##java[00:33:32] <surial> JoshJ: Just replace 'Hashtable' with 'HashMap'. Though, you also seem to be using the archaic methods, such as 'keys', so you may need to do a little more work. Every old method has a direct equivalent new method.[00:33:44] <JoshJ> i haven't actually had to use keys() yet[00:33:46] <surial> tieTYT: Because in between the size check and the add operation, another thread could add or remove something from the list.[00:33:47] <tieTYT> key's is archaic?[00:33:47] <JoshJ> was about to, though[00:33:52] <JoshJ> values() is still good[00:33:53] <surial> tieTYT: Yes. keySet() is not.[00:34:03] <tieTYT> i didn't know that[00:34:06] <tieTYT> ~javadoc hashmap[00:34:07] <javabot> null, http://java.sun.com/javase/6/docs/api/java/util/HashMap.html[00:34:18] <joed> ~null++[00:34:19] <javabot> null has a karma level of -17, joed[00:34:46] <surial> tieTYT: 'synchronized' for Vector (and for Collections.synchronizedX) just means: Whenever you start a method on me, I'll lock the object, and unlock it when I'm done. So, when all your operations can be expressed as 1 method call, you're fine. The moment that no longer works, you'll need to do your own synchronizing.[00:34:56] <tieTYT> i don't even see keys() in hashmap[00:34:57] *** Tniffoc has joined ##java[00:35:01] <surial> or another famous one:[00:35:01] <tieTYT> ~javadoc map[00:35:02] <javabot> http://java.sun.com/javase/6/docs/api/java/util/Map.html[00:35:17] <surial> if (!synchronizedMap.containsKey("foo")) synchronizedMap.put("foo", "bar"); //broken![00:35:17] <tieTYT> where did I call that from in the past?[00:35:21] *** skoskav has quit IRC[00:35:28] <surial> tieTYT: Hashtable, evidently.[00:35:31] <tieTYT> oh[00:35:39] <tieTYT> ok then in that case, i guess i have always used keySet[00:35:49] <surial> or this idiom, which truly shows complete misunderstanding of app design:[00:35:53] <Tniffoc> cybereal: how would I fix that problem without using a sychronized statement...?[00:36:00] <surial> if (map.containsKey("foo")) runMethod(map.get("foo"));[00:36:21] <cybereal> Tniffoc: you need to synchronize on this, that's mandatory for reading or changing monitors which is what .wait() and friends do[00:36:26] *** orgy` has quit IRC[00:36:32] <cybereal> Tniffoc: if you are just trying to "sleep" for a period of time, then use Thread.sleep()[00:36:35] <tieTYT> surial: you're saying that's bad regardless of synchronization issues?[00:36:41] <surial> tieTYT: Yes.[00:36:44] *** provolone has joined ##java[00:36:47] <tieTYT> what should you do instead?[00:36:48] <surial> make atomic things atomic.[00:36:53] <surial> Just run map.get("foo") and then do a nullcheck.[00:36:54] <Tniffoc> cybereal: can you notify() a thread from sleep?[00:36:57] <JoshJ> cybereal, quick sanity check on my part: if i have 30 objects that I want to assign to the same key for lookup, i have to have an ArrayList (or similar) of those things instead, right?[00:37:08] <cybereal> Tniffoc: but wait(), wait(*), notify/notifyAll, etc. require the locking on the monitor to call[00:37:10] <surial> you never know when at some later point in time you refactor your list or map so that all of a sudden multiple threads have access.[00:37:11] <cybereal> Tniffoc: no[00:37:25] <tieTYT> that seems like a weird way to think ahead[00:37:27] <cybereal> Tniffoc: you have no choice here, you need to synchronize on the object to access its monitor, it's a simple concept[00:37:37] <cybereal> Tniffoc: when you call .wait() it releases the lock you know[00:37:40] <surial> JoshJ: Yes. Or you can use a specialized map that can load up multiple values per key. java collections API does not have such a map, but trove or javolution might.[00:37:43] <tieTYT> i think the former is easier to refactor too[00:37:44] <surial> ~~JoshJ trove[00:37:44] <javabot> JoshJ, trove is GNU Trove, a set of Collection replacements that manage primitive types - so you don't have to unwrap things. It's at http://trove4j.sourceforge.net/ . Oddly enough, in ONE test - YMMV! - Trove and Javolution had no measurable PERFORMANCE-RELATED differences. Note that Trove may use memory differently.[00:37:45] <cybereal> then reacquires it when it tries to return[00:37:47] <surial> ~~joshj javolution[00:37:48] <javabot> joshj, javolution is a high performance realtime java library which is released under the BSD license. See http://www.javolution.com/[00:37:55] <JoshJ> hrm[00:37:57] <surial> and trove isn't what I meant. I meant the google collections thingie.[00:37:59] <surial> forgot the name.[00:38:01] <provolone> I have been having a bit of trouble posting data using httpcommons 4.0 . http://papernapkin.org/pastebin/view/4239 When I look at the packet captures I do not see any post data being sent at all.[00:38:03] <Tniffoc> cybereal: ok, then how would I have a thread waiting to either be awakened or automatically come back to life after 2 mins. ?[00:38:37] *** Bollinger has quit IRC[00:38:54] <surial> tieTYT: No, splitting atomic operations out is fundamentally broken, period. It's a design problem. The responsibility for keeping a sane state should obviously rest as much as possible with the object that might break under stress. So you should express all operations with atomic intent as 1 method call on the target object.[00:39:31] <cybereal> Tniffoc: first you'd need a commonly accessible monitor, assuming this refers to that commonly accessible monitor, it's pretty simple, you'd synchronize(this) { this.wait(2 * 60 * 1000); } and in some other thread, you might call synchronize(thatWhichWasThisInTheOtherExample) { thatWhichWasThisInTheOtherExample.notifyAll(); }[00:39:34] <surial> Tniffoc: with .wait(1000 * 60 * 2);[00:39:34] <cybereal> Tniffoc: very easy[00:39:41] <surial> ~cybereal++[00:39:42] <javabot> cybereal has a karma level of 153, surial[00:39:59] <tieTYT> i thought we were talking about without synchronization concerns[00:40:01] <surial> though, you're risking a demerit for suggesting to lock on 'this'. Never lock on this.[00:40:03] <surial> create a unique locker object.[00:40:06] <JoshJ> it's been so long since i've used Java last i'm making stupid mistakes left and right :([00:40:19] <surial> tieTYT: That's also a brainfart. Don't make assumptions about your code unless you have to.[00:40:30] *** kane77 has quit IRC[00:40:33] *** bas-i has quit IRC[00:40:41] <surial> tieTYT: And assuming 'synchronization has worked itself out' is not a smart assumption to make. Unless the list or map is known immutable, that's a different story.[00:40:42] <tieTYT> you're making the assumption that someday multiple threads will run this[00:40:43] <cybereal> surial: I'd avoid this whole situation if at all possible before I'd worry about locking on 'this' heh[00:40:50] <surial> tieTYT: No, I'm not making that assumption at all.[00:40:55] *** Exussum has joined ##java[00:41:24] <surial> tieTYT: I'm making no assumption. By leaving code as atomic as possible, it'll run correctly regardless of threading environment. Whereas your way only works when there is a single threaded environment, and when your assumption fails, it breaks in a horrible way.[00:41:41] *** \etienne is now known as \set_me_free[00:41:43] <cybereal> anyway, Tniffoc, the concept is simple. I can only guess that you're unaware that when .wait(*) is called, the lock is released[00:41:44] <surial> to be specific: Once in a blue moon your app crashes in a weird way. A user will report it, and you'll spend 5 days chasing it down.[00:41:54] <cybereal> that threw me at first when this was new to me as well... made me wonder how it could possibly work[00:42:12] *** IppatsuMan has quit IRC[00:42:35] *** _graham_ has quit IRC[00:43:30] *** dfas has joined ##java[00:43:52] <dfas> can anyone tell what keyboard he is using here? http://www.flickr.com/photos/aprilgenie/151039203/[00:44:02] *** Tniffoc has quit IRC[00:44:32] *** floe has quit IRC[00:45:20] <Infinito-> why does it matter, if you don't mind me asking dfas ? :P[00:45:31] <Infinito-> seems like an ordinary keyboard[00:45:40] *** androoid has quit IRC[00:46:00] <Infinito-> pretty similar to mine actually... they sell loads of there in stores everywhere... :)[00:46:12] *** rlubke has quit IRC[00:47:16] *** bas-i has joined ##java[00:47:38] <hiredman> dfas: I would look through the dell website[00:47:58] <surial> /msg javabot javadoc Charset[00:48:17] *** \set_me_free is now known as le_biloute[00:49:29] <Exussum> hey guys, is the correct useage for atan2 argument (x,y) or (y,x) ?[00:49:36] *** bas-i has quit IRC[00:49:59] <pstickne> ~~ Exussum googleit java 6 math[00:49:59] <javabot> Exussum, http://letmegooglethatforyou.com/?q=java 6 math[00:50:20] <pstickne> There is no excuse for asking questions this trivial and easy to look up.[00:50:51] *** heyqule has joined ##java[00:51:08] <Exussum> public static double atan2(double y, double x) Returns the angle theta from the conversion of rectangular coordinates (x, y)[00:51:13] *** FireSlash has quit IRC[00:51:42] <pstickne> Exussum> public static double atan2(double y, double x)[00:51:50] <Exussum> shouldnt both be in the same form ? I seen that face and was confused as to which way it mean[00:51:56] <Exussum> page*[00:52:15] <pstickne> (x, y) is referring to the tuple in R^2[00:52:24] *** pandora-- has joined ##java[00:52:32] <pstickne> the argument list is what you should look at when determining order of arguments to the class[00:52:39] <pstickne> s/class/method/[00:52:48] <Exussum> ahh ok then[00:52:52] *** letfunbegin has quit IRC[00:52:53] *** TheCastor has quit IRC[00:53:03] *** skoskav has joined ##java[00:53:03] <Exussum> Just curious, Why is it (y,x) ? any Reason ?[00:53:12] *** rullie has joined ##java[00:53:36] *** Ivellina has quit IRC[00:54:00] *** Tniffoc has joined ##java[00:54:14] <pstickne> Exussum: I have feeling it has roots in math. The exact order of arguments (x, y or y, x) unfortunately varies by language[00:54:23] *** luyang has quit IRC[00:54:29] <Tniffoc> Ok, how would I Terminate a thread that is doing a .sleep(x) command....[00:54:31] <Tniffoc> ?[00:54:53] *** omaru has quit IRC[00:55:04] <Tniffoc> because Thread.stop() is depreciated[00:55:19] <pstickne> Exussum: e.g. if you were writing it out in math, would it be atan(x/y) or atan(y/x)?[00:55:42] <pstickne> (granted atan isn't the same as atan2)[00:56:11] <surial> cheeser: i have a patch for javabot to add $C and $+ in addition to $1. It does the same thing, except $+ will urlencode the parameters, and $C will camelcase the parameters, then urlencode it.[00:56:15] <surial> cheeser: mail it?[00:56:34] <Tniffoc> Ok, so I have a thread, but it doesn't terminate when I set it's value to null.....[00:56:38] <surial> Tniffoc: Thread.interrupt()[00:56:43] *** casmo has quit IRC[00:56:46] <pstickne> Tniffoc: objects are not variables.[00:56:46] <surial> Tniffoc: Of course it doesn't terminate.[00:57:07] <surial> Tniffoc: You just changed a variable to no longer point at the thread. Objects don't magically die the instant they are no longer accessible.[00:57:12] <Tniffoc> ok... sorry.. Multi-threading is new to me[00:57:15] <surial> and threads, in fact, are never killed by the garbage collector.[00:57:19] <pstickne> Tniffoc: variables can "refer to" objects. setting a variable equal to null makes it "refer to nothing" -- it SAYS NOTHING about what it previously referred to[00:57:48] <Tniffoc> pstickne: I understand that... just didn't quite make the connection[00:57:58] <pstickne> Tniffoc: if the last reference is held, then the object should be released at some point in the future. however, some objects, such as threads are held elsewhere.[00:58:01] *** gregor_k has quit IRC[00:58:08] <pstickne> Tniffoc: :)[00:58:14] <surial> Tniffoc: To interrupt a sleeping thread, use interrupt(). The sleep will be terminated, and instead an InterruptedException is thrown. If the thread you interrupt is not currently doing anything interruptable, then Thread.interrupted() will return true (once) for that thread, if that thread bothers to check. This is why while () loop-based threads should always loon on while (!Thread.interrupted() && running)[00:58:23] *** dtamborelli has joined ##java[00:59:18] *** dtamborelli has quit IRC[00:59:20] *** mele- has joined ##java[00:59:21] <JoshJ> if threads are never killed by the GC then wouldn't apps that spawn/kill threads constantly be guaranteed to memory leak?[00:59:25] <JoshJ> or is there a separate thread-collector?[00:59:38] <JoshJ> er.. killed is a bad choice of words there[00:59:59] <JoshJ> i mean, when a thread is done with, its stuff does get cleaned up somehow, right?[01:00:01] <pstickne> JoshJ: would you rather a thread that hasn't terminated simply "be released"?[01:00:06] <pstickne> JoshJ: after it terminates, sure[01:00:15] <Tniffoc> pstickne: surial: ok, thanks.. now I understand that part... now how do I actually terminate the thread in the catch(InterruptedException e) block?[01:00:41] <surial> Tniffoc: Just return out of the run method.[01:01:04] *** JGarrido has joined ##java[01:01:05] <surial> JoshJ: RUNNING threads are never killed by the GC. threads that never started, or threads that have been stopped, get gced as normal.[01:01:22] <JoshJ> gotcha.[01:01:27] * JoshJ resumes fixing his messed up code[01:01:32] <Tniffoc> surial: oh ya *embarrassed*[01:01:33] <JoshJ> think i'm almost done though[01:01:49] <surial> anyone around that knows how to actually make javabot run without too much hassle?[01:01:52] *** zacs7 has joined ##java[01:02:02] <surial> I've got a patch you can test for me :P[01:02:32] *** tyreel has joined ##java[01:02:35] *** werdan7 has quit IRC[01:02:41] *** tyreel has left ##java[01:03:07] *** bitshuffler has quit IRC[01:05:00] <surial> r0bby: You around?[01:05:21] <surial> ~javafx[01:05:22] <javabot> JavaFX (http://sun.com/javafx) is a scripting language from Sun, designed to use declarative syntax to create GUIs, primarily. You can find a tutorial at http://java.sun.com/javafx/1/tutorials/ui/[01:07:08] *** zacs7 has left ##java[01:07:19] <cheeser> surial: create an issue in the tracker and attach the patch[01:07:35] <cheeser> mvn exec:exec will run the bot once you have a proper javabot.properties set up.[01:07:48] <cheeser> bbl[01:08:14] *** cyth has quit IRC[01:08:43] *** riotz has joined ##java[01:08:54] <mele-> but but maven sucks![01:09:03] <mele-> not sure why folks use it :)[01:09:06] *** Tniffoc has quit IRC[01:09:06] <r0bby> surial: not in the javabot mucking mood[01:09:15] <JoshJ> yay my code works[01:09:15] <surial> :([01:09:23] <JoshJ> thanks for the help surial[01:09:34] <surial> JoshJ: You're welcome[01:09:46] *** JGarrido has quit IRC[01:10:18] <r0bby> surial: just be glad ojacobson set up exec:java[01:10:32] *** gionny has quit IRC[01:10:33] <r0bby> and cheeser made setting up defaults a lot easier than it previously was[01:11:11] *** elementz has joined ##java[01:11:22] <surial> cheeser: Can't. When I go to the project browser, I'm not logged in anymore.[01:11:40] * nDuff keeps thinking Rick van Riel when seeing surial's nick and needing to do a double take.[01:11:51] <surial> Who's that?[01:12:01] *** vesz has quit IRC[01:12:03] <nDuff> a big-name Linux kernel hacker[01:12:29] <surial> firefox does work.[01:13:17] <nDuff> ...I think I've seen him as suriel before, which is close enough to mistake (though he's mostly just riel or unriel)[01:13:45] *** npm has quit IRC[01:15:32] <surial> cheeser: done.http://kenai.com/jira/browse/JAVABOT-16[01:15:55] <surial> dutch guy?[01:16:20] <surial> nah, doesn't look like it.[01:16:36] *** dvayanu has quit IRC[01:16:50] *** epalm has joined ##java[01:19:25] *** amnesiac has quit IRC[01:20:04] *** Exussum has quit IRC[01:21:17] *** deuterium has joined ##java[01:21:49] *** timte has quit IRC[01:23:17] *** Varox has joined ##java[01:24:08] <JoshJ> yay, done for the night. now to crack open my AI book[01:26:07] <JoshJ> actually no i'm not. damn. >_<[01:26:22] *** Varox has quit IRC[01:26:24] *** elementz has quit IRC[01:26:42] *** Decepticon has joined ##java[01:26:55] <Decepticon> anybody know how to take some javascript urls and turn them into direct urls? using greasemonkey or stylish on firefox? i ahve the java links and the direct urls, i dont know how to piece it together though. please help[01:28:19] *** Varox has joined ##java[01:28:42] *** riotz has quit IRC[01:29:54] <JoshJ> okay, NOW i'm done >_<[01:31:55] <cybereal> Decepticon: you realize that javascript is not java right?[01:32:04] <Decepticon> oh[01:32:14] <Decepticon> ... sorry for being a dumbass[01:32:49] <Infinito-> Decepticon, #javascript[01:32:54] <Decepticon> yup thanks[01:33:03] *** Decepticon has left ##java[01:33:38] *** brady_k has joined ##java[01:33:53] <brady_k> 'ello wot wot[01:34:10] *** cybereal has quit IRC[01:34:52] <latebind> what would be a good way of extracting all url links in a text document (non-formatted) ?[01:35:32] <brady_k> anyone have any thoughts/experience on c/c++ -> java conversion?[01:36:38] <JoshJ> latebind, getting everything with "http" in it until the next space? fails on urls with spaces if they haven't been converted to %20 though[01:36:57] <JoshJ> also fails on casual urls like "google.com"[01:37:03] <latebind> yeh, I thought there might be a way[01:37:06] <latebind> with regex[01:37:07] <brady_k> for example, would it be possible theoretically to implement the Linux Kernel as the basis of a java OS? translated of course[01:37:20] <JoshJ> brady_k, you'd have to have some sort of binding for device drivers[01:37:56] <JoshJ> as well as direct memory mapping... though there's probably a way to make that work without being TOO terrible[01:38:16] *** giantrobot has joined ##java[01:38:27] *** giantrobot has quit IRC[01:38:27] <JoshJ> you couldn't do it with the JVM, i don't think; but you could if you compiled it fully[01:38:40] <brady_k> JoshJ: so it's a real option then? difficult though[01:38:45] <JoshJ> well... your question can be read 2 ways i think[01:38:58] <brady_k> JoshJ: let me clarify a little maybe[01:39:16] <JoshJ> if you mean using it as a "virtual machine", ie, you simply present virtual memory to the kernel but it's not necessarily (say) 0x500000 on the physical machine[01:39:19] <JoshJ> then you can do it, sure[01:39:45] <brady_k> oh no[01:39:51] <JoshJ> but if you mean writing a full blown OS with device drivers and physical control to applications then you can't do it with the JVM[01:39:57] <brady_k> i'm thinking of starting a project that would build an OS out of Java (in before "java's too slow for an OS"), and was wondering if i could port the linux kernel to java[01:39:58] <brady_k> i see[01:40:01] <brady_k> why is that?[01:40:05] <svm_invictvs> Hm[01:40:09] <svm_invictvs> We have a beer bong here at work.[01:40:11] <JoshJ> okay, consider a Game Boy Advance[01:40:15] <repnop> you could but it'd be a lot of effort[01:40:17] <brady_k> JoshJ: considering...[01:40:19] <repnop> for what gain...[01:40:21] <JoshJ> just as an example, since it's a piece of hardware i'm familiar with[01:40:28] <JoshJ> (and there IS a GBA linux port!)[01:40:38] <JoshJ> the video buffer starts at memory address 0x6000000[01:40:53] <joed> ~interesting[01:40:54] <javabot> this is all very interesting (not really) but please take it somewhere else.[01:41:09] <JoshJ> if you're writing on top of the stock JVM, there's no way for you to stick binary data directly into that particular spot[01:41:53] * brady_k talking in PM now with JoshJ[01:43:49] <cheeser> surial: got the patch. it looks good. i'm going to write some unit tests against it, though.[01:44:15] <surial> By all means. I did not run the bot but I did hack a println based test of the additions together and that seemed to work out.[01:44:47] *** brady_k has left ##java[01:45:22] <tieTYT> in testng, it seems that @BeforeTest(alwaysRun = true) does not run before every @Test[01:45:27] <tieTYT> that's not very intuitive to me[01:46:19] <surial> ah, but a JVM along with an API that does low-level hardware manipulations, like e.g. blit straight to a raw memory position, that could work. Android is a bit like this - you program in it with java, but instead of class files you get dalvik executables. And a lot of the android stack is written in dalvik. But, low-level process management and OS functions, that's all linux under the head.[01:46:21] <surial> s/head/hood[01:47:49] *** durka42 has joined ##java[01:48:17] *** surial has quit IRC[01:48:33] *** surial has joined ##java[01:48:47] *** surial has quit IRC[01:48:58] *** surial has joined ##java[01:49:15] *** werdan7 has joined ##java[01:49:27] <tieTYT> ah, that's what @BeforeMethod is for[01:49:29] *** cads has joined ##java[01:49:38] <tieTYT> testng is so cool[01:49:46] <tieTYT> you just need to look at it for a second to realize how much better than junit it is[01:50:07] *** brady_k has joined ##java[01:50:26] <JoshJ> bah, brady_k missed surial's comment[01:50:26] *** brady_k has left ##java[01:51:02] <cads> hey, I am playing around with clojure and this brings me in proximity to java libraries... I don't know java very well at all, and was wondering if you guys can recommend a simple guide explaining the classpath[01:51:13] *** brady_k has joined ##java[01:51:36] <Sou|cutter> ~~cads classpath[01:51:36] <javabot> cads, The classpath tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the classpath. Also see http://java.sun.com/javase/6/docs/technotes/tools/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html[01:51:40] <cads> specifically I have two .class files that need to be on the path for this specific clojure program to work, but I don't know what my path is[01:51:41] <surial> cads: Do you mean the various classes that ship with all JVMs, or how the classpath works?[01:51:42] <svm_invictvs> frack[01:51:52] <svm_invictvs> ~ggl java change temporary directory[01:51:53] <javabot> I guess the factoid 'javax.ejb.timerservice' might be appropriate:[01:51:53] <javabot> svm_invictvs, javax.ejb.timerservice is the EJB container's timer service object. A TimerService is obtained through the getTimerService() method of the SessionContext. http://java.sun.com/developer/EJTechTips/txtarchive/2004/Dec21_04_RobertE.txt[01:51:55] <svm_invictvs> hm[01:51:56] <surial> oh, then, yeah, what Soulcutter made javabot tell you.[01:52:03] <svm_invictvs> ~javadoc FILE[01:52:04] <javabot> null, http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/util/file/File.html, http://java.sun.com/javase/6/docs/api/java/io/File.html[01:52:19] <cads> surial, first the latter, then eventually I'd like to explore the classes that are available, as well as other libraries[01:52:22] *** Galik has quit IRC[01:52:29] <surial> ~javadoc String[01:52:29] <javabot> http://java.sun.com/javase/6/docs/api/java/lang/String.html[01:52:42] <svm_invictvs> fuck[01:52:43] <surial> cads: try http://java.sun.com/javase/6/docs/api/[01:52:56] <surial> particularly the packages java.util, java.io, and java.net are interesting.[01:53:30] <surial> The rest, only if yo urecognize it as something you'll need. perhaps java.util.zip or java.util.regex[01:53:30] <svm_invictvs> Is there a way to change the directory where temporary files are created?[01:53:52] *** riotz has joined ##java[01:54:02] <r0bby> svm_invictvs: System.setProperty()?[01:54:03] <svm_invictvs> Through some environment variable?[01:54:18] <r0bby> svm_invictvs: why is the system temp. dir bad?[01:54:34] <ScottG489> When I write something to a file does it preserve its file type or when I read it do I need to read it as a string?[01:54:36] <svm_invictvs> r0bby: Because on all our production boxes there's not enough space in /tmp for what I need[01:55:18] <r0bby> ScottG489: huh? are you reading text files?[01:55:45] *** rullie has quit IRC[01:55:45] *** kapipi has quit IRC[01:55:59] *** brady_k has left ##java[01:55:59] <svm_invictvs> can I pass options to the jvm to change the temporary path?[01:56:00] <ScottG489> no just a normal file. im writing to it with PrintWriter[01:56:05] <ScottG489> r0bby: ^[01:56:08] <r0bby> that's a text file.[01:56:13] <ScottG489> oh[01:56:31] <r0bby> is it plain text/ascii?[01:56:36] <ScottG489> ok well then is there a method where i can convert a string to a double?[01:56:44] <r0bby> jesus h. christ[01:56:52] <r0bby> still having trouble w/ the basics are we?[01:57:01] <r0bby> ~~ ScottG489 javadoc Double.parseDouble(*)[01:57:01] <ScottG489> :([01:57:02] <javabot> ScottG489, http://java.sun.com/javase/6/docs/api/java/lang/Double.html#parseDouble(java.lang.String)[01:57:08] <r0bby> ~~ ScottG489 api[01:57:08] <javabot> ScottG489, api is http://java.sun.com/javase/current/docs/api/index.html[01:57:25] <r0bby> use it. (hint: every primitive data type has a wrapper class)[01:57:40] *** illio has quit IRC[01:57:49] <ScottG489> whats a wrapper class?[01:58:05] <r0bby> a class that encapsulates a double basically.[01:58:14] <r0bby> (collections can only hold Objects[01:58:15] <ScottG489> hm...[01:58:18] *** Copter has quit IRC[01:58:29] <r0bby> thus why the wrapper classes exist.[01:58:47] *** rullie has joined ##java[01:58:49] <ScottG489> what are collections?[01:59:07] <r0bby> ~~ ScottG489 rbi[01:59:08] <javabot> ScottG489, reallybigindex is http://java.sun.com/docs/books/tutorial/reallybigindex.html[01:59:14] <r0bby> you REALLY need to read that.[01:59:29] <r0bby> ~~ ScottG489 collections[01:59:29] <javabot> ScottG489, The Collections API is available at http://java.sun.com/javase/6/docs/technotes/guides/collections/index.html[02:00:48] <r0bby> ScottG489: using google wouldn't hurt either[02:01:42] <r0bby> typical workflow to gethelp 1) api 2) sun java tutorials (see the reallybigindex link)/relevent documentation 3) google 4) IRC[02:02:08] *** dunmer has quit IRC[02:02:14] *** Varox has quit IRC[02:02:47] <svm_invictvs> grumb[02:02:53] <svm_invictvs> I hate how I hav eto write to two log objects[02:03:21] <svm_invictvs> I thought hte whole fucking point of a logging serviuce is that you just blindly stuff all your messages into logs and use some external configuration to filter them and put them places[02:03:29] <svm_invictvs> Rather than having ot have a special nagios logger object[02:03:35] <svm_invictvs> jesus fucking christ on a crutch.[02:04:08] <r0bby> adios[02:04:14] <r0bby> ~hug svm_invictvs[02:04:14] * javabot snuggles up to svm_invictvs and strokes svm_invictvs's hair affectionately.[02:04:18] <svm_invictvs> lol[02:04:25] <svm_invictvs> 4 horus of sleep last night.[02:04:32] <r0bby> pussy[02:04:33] *** osmosis has quit IRC[02:04:34] <cheeser> oh, you slept in then?[02:04:36] <cheeser> 8^)=[02:04:38] <r0bby> I've had less[02:04:39] <svm_invictvs> lol cheeser[02:04:57] <svm_invictvs> cheeser, r0bby jesus yo uguys must be zombies[02:05:00] <r0bby> I enjoy depriving myself of sleep :)[02:05:01] <svm_invictvs> then again, this is night 3 for me[02:05:12] <r0bby> svm_invictvs: no, I just oversleep when i can :)[02:05:13] <svm_invictvs> I'm also on my third beer.[02:05:26] <svm_invictvs> Which is quite a few beers considering I'm still at work[02:05:28] <svm_invictvs> :-0P[02:05:38] <svm_invictvs> Okay I wasn't serious bout tthe beers.[02:06:09] <svm_invictvs> ~javadoc System[02:06:10] <javabot> http://java.sun.com/javase/6/docs/api/java/lang/System.html[02:08:15] *** dogmeat has quit IRC[02:08:42] <svm_invictvs> horray[02:08:57] *** JoshJ has quit IRC[02:11:42] *** hrehf has quit IRC[02:12:40] *** dentoo has quit IRC[02:16:06] *** aTypical has joined ##java[02:16:27] *** waz has joined ##java[02:16:44] *** riotz has quit IRC[02:18:46] *** igordcard has joined ##java[02:19:27] *** DragonLord- has quit IRC[02:20:38] *** tomolds has quit IRC[02:21:00] *** eidolon has joined ##java[02:21:18] <svm_invictvs> lol[02:21:35] <svm_invictvs> I had a typo in my install script and it acidentally pu tmy daemon into /home/popeline[02:22:55] *** eduardopl has joined ##java[02:23:22] *** bashoh has joined ##java[02:23:30] *** ijk has joined ##java[02:25:02] <ijk> if I read some bytes off an InputStream and then pass it on to another method, will its pointer then reset or will the other method read on from where it initially came from?[02:26:41] <durka42> i would not expect the pointer to reset...[02:29:08] *** antwaungomez has joined ##java[02:29:11] *** antwaungomez has left ##java[02:29:30] *** toytoy has joined ##java[02:30:54] *** ofl_ has quit IRC[02:33:46] <surial> ijk: Objects don't know about context.[02:33:57] <surial> ijk: The InputStream therefore doesn't have any clue about who is calling what.[02:34:17] <surial> In other words, the bytes just keep coming. Nothing resets. Use a bufferedinputstream and the mark/reset methods if you need resets.[02:34:52] *** igordcard has quit IRC[02:35:36] *** heyqule has quit IRC[02:36:09] *** t3mp3st has quit IRC[02:36:59] *** nmatrix9 has joined ##java[02:37:18] <ijk> okay, that's the answer I was hoping for. thanks![02:40:31] *** rutski has joined ##java[02:40:42] <rutski> Bench.java: "import foo.*;"[02:40:58] <rutski> Fixed.java: "package foo;\n public class Foo {..."[02:41:19] <rutski> javac: "import foo.*; <--- package foo does not exist"[02:41:20] <rutski> I'm so confused[02:42:07] <FauxFaux> Is fixed in the right folder? Is "." in the classpath?[02:42:09] *** ofl_ has joined ##java[02:42:29] *** Gary has quit IRC[02:42:41] *** Gary has joined ##Java[02:43:15] <rutski> they're in the same folder[02:43:21] <rutski> and I haven't altered the classpath[02:43:40] <FauxFaux> Folder structure has to mirror package structure.[02:43:47] <rutski> ah, hmm[02:43:50] <rutski> even of source files?[02:43:57] *** epalm has quit IRC[02:43:58] <rutski> I'll try that[02:44:09] <surial> rutski: you probably should be using an IDE. Takes care of all this.[02:45:05] *** juanez has quit IRC[02:46:50] *** poseidon has joined ##java[02:46:54] *** poseidon is now known as cs_student[02:47:25] <cs_student> What is the syntax for a for-each loop in java? for( array[] : varName )?[02:47:31] <surial> ~foreach[02:47:31] <javabot> surial, foreach is " for (Foo foo: fooList) { foo.setBar(baz); } " more at http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html[02:49:16] <cads> bleh, I can't figure out the classpath stuff here in debian. I don't have the CLASSPATH environment variable set, but java is able to work. I have 2 .class files that need to be in the classpath for a certain program to work, but I don't know how to do that[02:49:44] <cheeser> ~classpath[02:49:45] <javabot> The classpath tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the classpath. Also see http://java.sun.com/javase/6/docs/technotes/tools/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html[02:50:12] <aTypical> cheeser![02:50:15] <cads> currently I invoke the program by typing java -cp clojure.jar clojure.lang.Script cfa.clj[02:50:52] <cads> but there are the two class files in a directory bin/cljext/swing[02:51:02] <ijk> wrong format[02:54:29] <cads> doing java -cp clojure.jar:bin clojure.lang.Script cfa.clj seems to work[02:55:07] *** javahorn has joined ##java[03:02:13] *** The_Birdman has joined ##java[03:05:10] *** _Maru_ has joined ##java[03:05:48] *** merlin83 has joined ##java[03:06:28] *** armyriad has joined ##java[03:10:13] <kater_> ~prinft[03:10:14] <javabot> kater_, I have no idea what prinft is.[03:10:15] <kater_> ~prinf[03:10:16] <javabot> kater_, I have no idea what prinf is.[03:10:17] <kater_> ~printf[03:10:18] <javabot> I guess the factoid 'sprintf' might be appropriate:[03:10:19] <javabot> kater_, sprintf is http://java.sun.com/developer/technicalArticles/Programming/sprintf/[03:10:29] <kater_> ~System.out.printf[03:10:30] <javabot> kater_, I have no idea what System.out.printf is.[03:10:33] *** ShanghaiScott has left ##java[03:10:36] * kater_ slaps javabot[03:10:42] *** latebind has quit IRC[03:11:41] *** dfrbn has joined ##java[03:12:06] *** joeo has joined ##java[03:14:38] *** ffgeek200 has quit IRC[03:15:11] *** durka42 has quit IRC[03:15:25] *** ffgeek200 has joined ##java[03:16:34] *** cs_student has quit IRC[03:19:26] <nwmcsween> ~System.out.println[03:19:26] <javabot> nwmcsween, I have no idea what System.out.println is.[03:19:31] <nwmcsween> ok[03:19:56] <r0bby> ~~ nwmcsween PrintStream.println(*)[03:19:56] <javabot> nwmcsween, I have no idea what PrintStream.println(*) is.[03:20:04] <joed> ~advice[03:20:05] <javabot> 'Some people, when confronted with a problem, think "I know, I'll use r0bby's advice!" Now they have two problems.'[03:20:11] <r0bby> ~~ nwmcsween InputStream.println(*)[03:20:12] <javabot> nwmcsween, I have no idea what InputStream.println(*) is.[03:20:15] <r0bby> ...[03:20:25] * r0bby fails[03:20:37] <r0bby> joed: I love you[03:20:52] <joed> ~~ r0bby failure[03:20:52] <javabot> r0bby, When your best is not good enough.[03:21:07] <joed> r0bby: Merry Friday or something.[03:21:11] <r0bby> demotivation posters++[03:21:22] <r0bby> fuck friday[03:21:23] <r0bby> :)[03:25:26] *** azathoth99 has quit IRC[03:26:38] *** staykov has quit IRC[03:26:52] *** svm_invictvs has quit IRC[03:29:20] *** npm has joined ##java[03:31:28] *** skypce has joined ##java[03:31:36] <skypce> can you helpme please: http://www.pastie.org/375756 . it return a error "not suitable driver";[03:32:33] <pstickne> skypce: install the appropriate sqlite engine?[03:32:39] <skypce> yes[03:32:57] <skypce> i have an example code , another, and it run fine[03:32:58] <pstickne> My guess would be that is where you should look.[03:33:05] <pstickne> Well, what's the difference?[03:33:20] * r0bby barfs[03:33:23] <r0bby> Matisse code[03:33:32] <pstickne> r0bby: indeed :)[03:33:48] <pstickne> skypce: and along with r0bby -- please subclass matisse-generated code :)[03:34:00] *** joeo has quit IRC[03:34:34] <skypce> ok[03:36:59] *** ankylose has quit IRC[03:37:00] <skypce> http://www.pastie.org/375760[03:37:28] *** x77686d has quit IRC[03:38:43] <skypce> i put every code to the action of button, my example the code is in the main[03:39:23] <skypce> i come from vb.net language, it is new language for me[03:42:41] *** Gary has quit IRC[03:42:53] *** Gary has joined ##Java[03:43:02] <r0bby> VB is lame..[03:43:17] <r0bby> and skypce[03:43:18] <aTypical> Yeah![03:43:24] <nwmcsween> java is lame[03:43:26] <r0bby> ~~ skypce bobby tables[03:43:26] <javabot> skypce, See http://xkcd.com/327/ (or http://en.wikipedia.org/wiki/SQL_injection )[03:43:28] * nwmcsween ducks[03:43:36] <r0bby> that code is prone to that[03:43:50] <r0bby> ~~ skypce prepared statements[03:43:51] <javabot> skypce, prepared statements is http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html[03:44:04] <r0bby> use those when you're dealing with inserting values into queries[03:48:29] <skypce> thank you guys[03:50:01] *** Angel-SL has joined ##java[03:51:40] *** yonibear has quit IRC[03:52:10] *** staykov has joined ##java[03:58:46] *** Woflborg has joined ##java[04:06:40] <cheeser> ojacobson: 4 more to go![04:07:24] <r0bby> cheeser: why did you name the command Config :-x[04:07:43] <cheeser> because it's the Config command[04:07:46] <r0bby> not something like ConfigCommand :)[04:07:55] <r0bby> similar naming convention as Operations[04:07:57] <cheeser> r0bby: and how are all the other Commands named?[04:08:04] <r0bby> oh[04:08:07] <r0bby> nevermind[04:08:45] <r0bby> doh[04:12:00] *** mohax has quit IRC[04:12:16] <cheeser> ojacobson: 3 more! because you've already done -14![04:12:17] <cheeser> 8^)=[04:13:36] <cheeser> 2![04:13:50] <joed> 42!!![04:14:10] *** skypce has quit IRC[04:14:18] <cheeser> actually just 1[04:14:21] <cheeser> i could skip that one, though.[04:14:30] <cheeser> maybe i'll push this out this weekend.[04:14:40] *** rainmann has joined ##java[04:15:32] <r0bby> hrm..[04:17:35] <r0bby> his split core/web front-end did the break of the HTML from the model classes in wicket :X[04:17:43] <r0bby> mvn idea:idea generates two modules ;x[04:18:07] <r0bby> into resources/[04:19:36] <cheeser> are you using 8?[04:19:46] <r0bby> yes.[04:20:00] <cheeser> just use the pom directly. there's no need for idea:idea[04:20:08] <r0bby> ah ok[04:21:04] *** s0ber has left ##java[04:21:25] <r0bby> thanks :)[04:22:31] <r0bby> javabot: cheeser++[04:22:31] <javabot> cheeser has a karma level of 602, r0bby[04:22:44] <r0bby> I've been doing idea:idea[04:22:49] <r0bby> it's one of the cool things bout maven[04:23:30] <r0bby> argh.[04:23:34] <r0bby> errors rock![04:23:50] <r0bby> cccccccccccccccute :)[04:24:15] <cheeser> ok. time for book and bed.[04:24:28] *** deuterium has quit IRC[04:25:08] <r0bby> adios[04:26:00] *** s0ber has joined ##java[04:26:42] <ScottG489> http://pastebin.com/d1ed1a8c[04:27:38] <ScottG489> For some reason when I uncomment the PrintWriter I get a NullPointerException on line 9.[04:28:08] <ScottG489> Just by declaring the PrintWriter. I when it actually outputs commented out at the bottom.[04:28:45] <ScottG489> i put test input into the text file each time the PrintWriter seems to blank it too[04:32:06] *** viperhr has quit IRC[04:34:27] *** kater has joined ##java[04:34:44] <r0bby> ~~ ScottG489 npe[04:34:45] <javabot> ScottG489, NullPointerExceptions are easy to spot and deal with. For some tips on dealing with them, please see http://is.gd/ha7A[04:35:14] <r0bby> ScottG489: 1) Double.parseDouble returns double but that works.[04:35:34] <r0bby> 2) stack trace place.[04:35:46] <r0bby> ScottG489: learn how to read your stack traces[04:36:04] <ScottG489> Where does it show the stack trace?[04:36:39] <r0bby> in your console[04:36:53] <r0bby> which you SHOULD be using.[04:37:25] <ScottG489> Well either an error or my output shows in my console.[04:37:54] <r0bby> it does.[04:38:46] <ScottG489> What Im guessing is happening is that its trying to parseDouble nothing since the PrintWriter blanks the file? I dont see why its blanking the file though[04:39:22] *** Gary has quit IRC[04:39:41] <r0bby> ScottG489: which line is really the offender?[04:39:51] <r0bby> whoa[04:39:59] <r0bby> why are you read/writing to the _SAME_ file?[04:40:02] *** Gary has joined ##Java[04:41:31] <ScottG489> :( whats wrong with that?[04:42:52] <nDuff> ScottG489, for one thing, it won't work the same way across operating systems -- so even if we fixed it for the OS you're running it on right now, that wouldn't necessarily help elsewhere.[04:42:55] <ScottG489> When my program starts up I need it to read whats in the file and based on whats in it, compare it to the current date/time and then possibly write different data to the file[04:43:05] *** factor has joined ##java[04:43:10] <nDuff> ScottG489, finish reading, close the read handle, and *then* open the file for write[04:43:14] <ScottG489> nDuff: Fixed what?[04:43:23] <ScottG489> nDuff: ok let me see how i can do that[04:43:24] <nDuff> ScottG489, or better, do your writing to a temporary file and rename it to the real name afterwards[04:43:24] <factor> in debian anyone know what all packages are needed apt-get wise?[04:43:34] <factor> to get j2sdk?[04:44:08] <ScottG489> nDuff: is that common practice?[04:44:11] <nDuff> ScottG489, ...but have the read handle closed before the rename -- one particularly completely idiotic but very popular OS doesn't like that either.[04:44:35] <nDuff> ScottG489, tempfile+rename? on UNIXlikes, it's the generally accepted way to do atomic file content updates.[04:44:51] <ScottG489> lol atomic file content updates?[04:44:53] <r0bby> factor: sun-java6-jdk[04:44:54] <nDuff> ScottG489, ...with the temporary file name randomly generated -- don't hardcode it or do it yourself, or you'll be vulnerable to race conditions.[04:45:02] <nDuff> ScottG489, ...lol?[04:45:03] <factor> thaks r0bby[04:45:04] <r0bby> ~~ factor ubuntu java[04:45:04] <javabot> factor, See http://javachannel.net/wiki/pmwiki.php/Main/JavaOnUbuntu[04:45:07] * pr3d4t0r drops an atomic bomb in ##java.[04:45:10] <nDuff> ~lol[04:45:10] <javabot> http://idisk.mac.com/zacheryjensen-Public/images/vglol.png[04:45:43] <nDuff> ScottG489, do you mean "lol" as in "the whole idea of atomic file operations is something that surprises me", or "lol" as in "I don't know what atomic means in this context"?[04:45:55] <nDuff> ScottG489, ...please be more explicit.[04:46:11] <r0bby> he doesn't know[04:46:22] <r0bby> I'm 99% certain that's his "lol" reason[04:46:34] <ScottG489> nDuff: i mean both i guess?[04:46:42] <ScottG489> r0bby: You speak my language[04:46:44] <nDuff> r0bby, ...well, he could have the bloody courtesy to communicate clearly.[04:46:52] *** staykov has quit IRC[04:46:55] <r0bby> ScottG489: no I just can tell[04:46:58] <ScottG489> nDuff: Sorry, i laugh a lot[04:47:09] <ayrnieu> you aren't laughing.[04:47:10] <ScottG489> i had to hold back an lol in that sentence :)[04:47:16] <nDuff> ScottG489, an atomic operation, in computer science, is something indivisible -- happening at a single point in time, not capable of being interrupted.[04:47:38] <ScottG489> ayrnieu: my laugh is audable so id say its "out loud"[04:47:43] <nDuff> ScottG489, so an atomic file update is a file update that happens such that at no time is there a file only half-written with the target name[04:48:04] *** sjb_ has joined ##java[04:48:28] <nDuff> ScottG489, ...and as an aside, using "lol" repeatedly will generally get you kicked from #python; it's one of the very few things where they're actually more strict than ##java.[04:48:36] *** convivial has quit IRC[04:49:04] *** ofl_ has quit IRC[04:49:31] <ScottG489> Nah, you guys are mostly cool.[04:49:46] <r0bby> I'm an asshole, but i've been trying to be nice[04:49:57] <ScottG489> I need to read over what you said a few more times though[04:50:00] * joed finds lolling extremely un-cool.[04:50:00] *** seyfarth has joined ##java[04:50:16] <ScottG489> joed: You find being happy un-cool?[04:50:37] <joed> ScottG489: It it means sounding like an idiot, certainly.[04:50:39] * nDuff finds needing to broadcast to a few hundred busy professionals that you're happy uncool.[04:51:28] <r0bby> nDuff: I'm happy </broadcast>[04:51:41] *** kater_ has quit IRC[04:51:45] <nDuff> ...but r0bby is allowed to be uncool; he's a regular.[04:52:36] <r0bby> I'm uncool by default[04:52:39] <ScottG489> Well no offense, but I hope I never turn into a bitter IT guy whos too busy to enjoy the small things in life.[04:55:05] <joed> Non taken, you seem to miss the point that the usage of aolbonics is irritating.[04:55:44] <ayrnieu> one day you too will enjoy the small pleasures of intolerance.[04:56:28] *** mesmer has joined ##java[04:56:46] *** Woflborg has quit IRC[04:57:18] <r0bby> joed: "None"[04:57:29] * r0bby hides behind nDuff[04:57:36] <mesmer> hello java land :)[04:58:39] <ScottG489> Be careful, they dont take kindly to happyness here >:([04:59:53] *** bashoh has quit IRC[05:03:05] <aTypical> Hello, mesmer-ville[05:03:30] *** ffgeek200b has joined ##java[05:04:19] <r0bby> ScottG489: no, we don't take kindly to aolbonics.[05:04:27] <r0bby> as joed pointed out[05:04:41] <r0bby> smileys are not aolbonics.[05:04:57] *** ffgeek200 has quit IRC[05:05:19] <ScottG489> :)[05:06:36] *** gambler has quit IRC[05:07:14] <ayrnieu> is there already a (defn thru [f] (fn [s & args] (apply f s args) s))[05:07:28] <ayrnieu> ? ((thru print) "hello") => "hello"[05:07:35] <r0bby> ayrnieu: what?[05:07:48] <ayrnieu> er, excuse me.[05:07:56] <r0bby> wrong chan?[05:08:11] <ayrnieu> the next one over :-/[05:12:02] *** rachop18 has quit IRC[05:15:49] *** funktor has quit IRC[05:17:07] *** m0 has joined ##java[05:17:39] *** kavon has quit IRC[05:17:53] *** surial has quit IRC[05:18:39] *** funktor has joined ##java[05:18:55] *** Odin79 has quit IRC[05:19:50] <m0> when compiling on my linux server, java.lang.OutOfMemoryError: requested 32756 bytes for ChunkPool::allocate. Out of swap space?[05:20:12] <m0> I have checked my swap and I do have enough, Mem: 1048576k total, 430376k used, 618200k free,[05:20:27] <The_Birdman> try -Xmx?[05:20:50] *** eduardopl has quit IRC[05:21:21] * The_Birdman fires m0 right away :-)[05:21:23] * The_Birdman runs[05:21:27] <m0> It used to compile[05:21:58] <m0> I just terminated the java process to update it, and this happened, my ant script has memoryMaximumSize set to 300mb[05:22:47] <The_Birdman> what is your -Xms parameter?[05:23:10] *** twolf has joined ##java[05:24:12] *** gambler has joined ##java[05:24:52] <m0> I don't know if I am using ant correct, http://rafb.net/p/PVVgZi55.html[05:25:25] <m0> the compile target is crashing the vm[05:26:19] <m0> with this error:[05:26:19] <m0> http://rafb.net/p/qhz3Xj52.html[05:27:26] <The_Birdman> trying defining the memory parameters(xms and xmx) in ANT_OPTS variable[05:29:18] <ScottG489> nDuff: I think I'm going to take your advice and write to a temp file then rename it.[05:29:35] <m0> hmm let me check[05:32:08] <m0> awesome just added the ANT_OPTS and java/lang/ClassNotFoundException: error in opening JAR file /usr/lib/jvm/java-6-sun-1.6.0.07/jre/lib/rt.jar[05:32:08] <m0> heh[05:32:50] <The_Birdman> That is very strange...[05:33:14] *** drichards has quit IRC[05:33:19] <m0> this is right correct? export ANT_OPTS="-Xmx500M"[05:33:29] *** drichards has joined ##java[05:34:19] <m0> let me see if my jdk is the same[05:35:39] <m0> shouldn't matter correct? I am running 1.6.0_11 and the box is running 1.6.0_07[05:36:10] <The_Birdman> not at all, but is the jdk correctly installed (package corruption, etc.)[05:37:54] *** rullie has quit IRC[05:38:04] <m0> Hmm different error now, Error running /usr/lib/jvm/java-6-sun-1.6.0.07/bin/javac compiler[05:38:19] <m0> Something is wrong, will look into it, thanks Birdy[05:41:15] <r0bby> cheeks!!!!![05:41:33] <r0bby> where has mickmack been[05:41:40] <r0bby> haven't seen him in awhile[05:43:05] *** MrSmiley909 has joined ##java[05:45:04] *** Gary has quit IRC[05:46:14] *** alek_b has quit IRC[05:47:49] *** kercyr has quit IRC[05:49:34] *** Gary has joined ##Java[05:50:51] *** fez_ has joined ##java[05:51:11] *** RealKillaz has joined ##java[05:53:07] *** meanburrito920_ has quit IRC[05:54:40] *** MrSmiley909 has quit IRC[05:54:52] *** kab has quit IRC[05:56:45] *** rainmann has quit IRC[05:56:55] *** chameloid has joined ##java[05:57:54] *** fez_ has quit IRC[06:00:00] *** Kwitschibo has quit IRC[06:00:25] *** amz has quit IRC[06:01:34] *** amz has joined ##java[06:03:41] *** blankthemuffin has quit IRC[06:07:26] *** blankthemuffin has joined ##java[06:08:58] *** jcp has joined ##java[06:10:30] *** jcp has quit IRC[06:10:51] *** jcp has joined ##java[06:12:38] *** wyvern has quit IRC[06:14:11] *** amz has quit IRC[06:14:34] <ScottG489> If I have a file named "something" will doing this overwrite that file? "File f = new File("something");"[06:15:08] <ScottG489> actually i found another way[06:17:55] <r0bby> ScottG489: that is something you can easily test[06:19:43] <whaley> ScottG489: no[06:19:54] <whaley> ~~javadoc ScottG489 File[06:19:54] <javabot> The user javadoc is not on ##java[06:20:10] <whaley> ~~ScottG489 javadoc File[06:20:11] <javabot> ScottG489, null, http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/util/file/File.html, http://java.sun.com/javase/6/docs/api/java/io/File.html[06:21:05] <joed> ~jeopardy[06:21:06] <javabot> What is The Penis Mightier[06:21:15] <whaley> ./nick Turd Ferguson[06:21:29] <[pwgr]> hehe[06:22:40] <ScottG489> Yes, I finally got my method working :)[06:22:49] <ScottG489> only took like all week[06:23:13] <ScottG489> But I learned something![06:23:24] <r0bby> ScottG489: remember what i told you about the workflow of getting help 1) *API DOCS* 2) documentation (sun tutorials etc) 3) google 4) *AFTER* you have done all those, you come here.[06:23:29] <r0bby> or on any IRC channel.[06:23:40] <r0bby> doing those shows you tried[06:25:38] <ScottG489> Yea, I gotta stop asking a question and letting it sit for an answer while I look around online.[06:25:57] <ScottG489> I usually do that when its late like now[06:26:27] <ScottG489> I dont think API docs would apply for me now though would they? I'm kinda writing a generic program.[06:26:44] <joed> APi docs always apply.[06:27:57] <ScottG489> Well to be totally honest, I dont really know what API's are. Im pretty sure they are like an outline for how to write a program for another program?[06:31:14] <The_Birdman> :-), no offense but it's funny ScottG489[06:31:29] <whaley> ScottG489: an api is an interface for libraries that have preexisting functionality you take advantage of[06:31:35] *** bindaas has joined ##java[06:31:45] <whaley> ScottG489: google around a bit and do some reading[06:32:03] *** cybereal has joined ##java[06:32:09] * joed reads playboy for the witty editorials.[06:33:17] <cybereal> I read it for something that rhymes with one of those words[06:33:20] <ScottG489> I'm pretty much right. I'm sure I'm missing a lot of the specifics to really understand but that basically sums it up.[06:34:08] <joed> People go to jail for being 'pretty much right' It is usually called tax fraud.[06:37:08] *** CodeWar has joined ##java[06:37:11] *** jariep1_ has quit IRC[06:40:56] *** elverig has joined ##Java[06:41:15] *** _stack has quit IRC[06:41:16] *** waz has quit IRC[06:44:44] *** Junior has joined ##java[06:45:06] <Junior> yello ;)[06:45:42] <CodeWar> OT: any favs among the different DI frameworks... I ve tried Guice the thing that appears weak about Guice being its binders ( or modules if you will ) are not easy to compose. Module A comprises Module B and Module C this is not easy to express[06:46:16] *** wng_z3r0 has joined ##java[06:47:14] *** elverig has quit IRC[06:47:56] *** ryuho has quit IRC[06:50:00] *** CodeWar has quit IRC[06:54:18] *** GhettoJava has quit IRC[06:55:14] *** GhettoJava has joined ##java[06:57:15] *** RealKillaz has quit IRC[07:04:21] *** aTypical has quit IRC[07:07:55] *** theatrus has joined ##java[07:11:25] *** javahorn has quit IRC[07:16:08] *** chameloid has quit IRC[07:18:01] *** phyburn has joined ##java[07:20:31] *** GhettoJava has quit IRC[07:28:12] *** whaley has quit IRC[07:36:55] *** durka42 has joined ##java[07:37:30] <durka42> what are tiles WRT BufferedImage?[07:38:50] *** tactics has quit IRC[07:40:54] *** lorbrito has joined ##java[07:41:32] *** tactics has joined ##java[07:41:45] *** twolf has quit IRC[07:45:46] *** twolf has joined ##java[07:47:34] *** Tenac has quit IRC[07:48:06] *** Gary has quit IRC[07:49:14] *** The_Birdman has quit IRC[07:49:27] *** blankthemuffin has quit IRC[07:50:01] *** Gary has joined ##Java[07:54:05] *** ridoo has joined ##java[07:55:24] *** Tenac has joined ##java[07:55:32] *** mesmer has quit IRC[08:00:05] *** M[]ssad has joined ##java[08:01:05] *** Zharf has joined ##java[08:02:33] *** ryuho has joined ##java[08:05:25] <lorbrito> hi[08:08:25] *** lorbrito has quit IRC[08:09:05] *** whiterussian is now known as ozzloy[08:13:27] *** ridoo has quit IRC[08:13:40] *** iluvgrlzwglasses has joined ##java[08:15:44] *** ridoo has joined ##java[08:16:53] *** tissue has quit IRC[08:18:43] *** hoens has joined ##java[08:19:09] <hoens> hey i want to make a gui that has "lights" as in a traffic light. Does anyone havea ny examples of this?[08:20:01] *** t3mp3st has joined ##java[08:20:42] <dangertools> ~~ hoens javadoc Graphics2D[08:20:42] <javabot> hoens, http://java.sun.com/javase/6/docs/api/java/awt/Graphics2D.html[08:21:16] <hoens> i guess my question is, what colors would it be when it's "off" and what colors would the lights be when they're "on"[08:22:50] <t3mp3st> is there a convenient way to determine when we're at the last iteration when one uses the Java "for(Type i : collection)" loop construct?[08:23:15] <hoens> t3mp3st id on't think so... why would it matter?[08:23:50] *** xim_ has quit IRC[08:24:11] <t3mp3st> hoens: I have a StringWriter, and I'm building a SQL query. I connect each subquery generated over the course of iteration using " AND "; for the last one, I don't want to write an " AND " to the stream, since I cannot rewind the StringWriter[08:24:23] <dangertools> t3mp3st: that thing is called foreach loop and no, no way. use a normal for loop[08:25:00] <pstickne> or use iterators directly[08:25:19] <pstickne> it's kind of the advantage of both, without such a concise syntax[08:25:31] <dangertools> pstickne: that's part of "normal for loop"[08:25:34] <t3mp3st> pstickne: i think I'll do that... it seems to be the easiest[08:25:39] <hoens> t3mp3st i agree with pstickne[08:25:48] <hoens> it's probably easiest to special case the first one, where you don't put and after it[08:25:56] <hoens> and then put and before all of the rest of the queries[08:26:07] <hoens> er[08:26:09] <hoens> parts of the query[08:26:25] <t3mp3st> ah, right[08:26:34] <t3mp3st> okay, cool; thanks, all, for the advice![08:29:49] *** lorbrito has joined ##java[08:32:49] *** lorbrito has quit IRC[08:36:59] *** wng_z3r0 has quit IRC[08:39:27] <pstickne> Any recommendations for a binary message-creation tool? I would like to be able to specify a binary format and have the appropriate Java /and/ Python code generates to produce and consume said binary messages[08:40:15] <pstickne> There is that one google project, looking for other options[08:41:29] <ojacobson> pstickne: in theory, ASN.1[08:41:34] <ojacobson> in practice, not ASN.1[08:41:42] <pstickne> :([08:41:59] <ojacobson> That was its raison d'etre, but most of the toolchains for it are $[08:42:11] <ojacobson> due to nobody really using it[08:42:57] <cybereal> http://en.wikipedia.org/wiki/Fast_Infoset[08:43:06] <cybereal> probably no python impl though[08:43:12] <pstickne> :-/[08:43:15] *** mele- has quit IRC[08:43:35] <cybereal> but hey you could write one[08:43:36] <ojacobson> fwiw there's no moral difference between string parsing and binary parsing[08:43:47] <ojacobson> you can probably fool antlr into generating a binary parser with some care.[08:44:02] <cybereal> the difference comes when you're dealing with lots of bigger numbers[08:44:05] <cybereal> that's about it[08:44:12] <ojacobson> nod[08:44:32] <ojacobson> tokenizing blobs is a little more challenging, too[08:44:43] *** FMJaguar has joined ##java[08:44:45] <pstickne> cybereal: I am using one now, but it's kind of kludgy and tied to a particular niche[08:45:26] <cybereal> pstickne: what are you doing that needs a tree structure in binary?[08:45:37] <pstickne> tree? ^^[08:45:51] <cybereal> well I saw ASN.1[08:46:02] <pstickne> cybereal: just messages between a python back-end and a java (scala) front-end.[08:46:23] <ojacobson> cybereal: pretty much every format is a tree in some notional sense or another[08:46:28] <ojacobson> and anyways that was me :)[08:46:53] <cybereal> pstickne: oh, what kind of messages?[08:47:23] <pstickne> cybereal: there are many messages and I want minimal overhead (vs. say, easy-viewing) so I'm looking for (and currently using) a system that generates python/java classes to "handle" a pre-defined format[08:47:41] <pstickne> cybereal: a whole bunch of different types. right now I have to whack on variable-length encoding portions.[08:48:13] <pstickne> cybereal: lots and lots of numbers[08:48:24] <cybereal> I see[08:51:02] <pstickne> I am currently using http://www.tinyos.net/tinyos-1.x/doc/nesc/mig.html and I am looking at http://code.google.com/p/protobuf/ -- something along these lines[08:51:09] <cybereal> pstickne: just use protocol buffers dood[08:52:00] <pstickne> no other realistic contenders in the area?[08:52:19] <cybereal> Your own custom format would be the most likely to beat it I think[08:52:32] <cybereal> but you want an existing solution and protobuffers offers code generation even[08:53:13] <pstickne> I really don't want to re-invent the wheel here .. sometimes it's fun, but...[08:53:16] <cybereal> not to mention its entire purpose in life is to solve YOUR problem[08:53:32] <pstickne> cybereal: right, right, but competition is good :)[08:53:36] <cybereal> that's true[08:54:06] <pstickne> I guess I'll google a tad more and read more about the protobuffer setup.[08:54:34] <pstickne> This problem is /so easy/ just moving from Scala-Scala ^^[08:55:12] <pstickne> (Or would be even with Java... just matched ByteBuffer operations)[08:55:43] *** armyriad has quit IRC[08:55:46] <cybereal> it's easy to pack C types in and out of bytes in python[08:56:03] <cybereal> but that would qualify as a custom implementation[08:57:23] *** Sikul has joined ##java[08:58:02] *** casmo has joined ##java[08:58:22] <cybereal> huh the base 128 varints could beat a plain C type based impl, actually, depending on your data structure/needs[08:58:44] <cybereal> protocol buffers is really interesting[08:58:52] <pstickne> cybereal: the pita is having to keep the different parts synched :([08:59:02] <pstickne> cybereal: yeah, I'm reading that now[08:59:25] <cybereal> it's also pretty great that you could go in text mode[08:59:33] <pstickne> cybereal: if it's just a Java (Scala) impl., the encode/decode are closely grouped in one spot...[08:59:38] <cybereal> you could set your shit up so that it would work either way and switch on text mode for debugging[09:01:44] *** Roritharr has joined ##java[09:02:01] <Roritharr> hi guys, someone here with knowledge of threaded coding?[09:02:10] <Roritharr> http://rafb.net/p/5jdtvH60.html[09:03:07] <dangertools> and the problem is?[09:03:25] <pstickne> (threads?)[09:03:40] <cybereal> unless you're buffering a video-like non-interactive animation, using threads for rendering is pretty pointless[09:03:53] <Roritharr> well, the joins should, as i thought, make the program wait for all threads to be finished before proceeding[09:04:09] <pstickne> (is this drawing in AWT/Swing/something else with a shared context?)[09:04:32] <cybereal> Roritharr: use something like a cyclicbarrier, not this stupid join crap[09:04:36] <cybereal> ~javadoc CyclicBarrier[09:04:36] <javabot> http://java.sun.com/javase/6/docs/api/java/util/concurrent/CyclicBarrier.html[09:04:50] <Roritharr> now, its just displaying some ascii stuff[09:05:02] <Roritharr> just trying to learn some multicore coding[09:05:24] <cybereal> manual thread management is a recipe for failure then[09:05:29] <cybereal> ~~ Roritharr jcip[09:05:29] <javabot> Roritharr, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java. http://jcip.net/[09:05:30] <cybereal> get that[09:05:33] <cybereal> read it...[09:05:51] <Roritharr> thanks[09:06:26] <ojacobson> ad-hoc threading is a great way to make broken apps, yeah[09:07:12] *** [pwgr] has quit IRC[09:07:26] *** _Matthias has joined ##java[09:08:07] *** seyfarth has quit IRC[09:09:03] <Roritharr> its just the one task in this whole code that needs a lot of computation power that, i thought, could be split pretty easily into 4 threads because it is just an big 2d array of data which has to be processed[09:09:52] <cybereal> you approach this by dividing that array into tasks, queueing them against an executor service and letting it deal with the thread count/management/etc.[09:10:15] <cybereal> then you can adjust the threadpoolexecutor settings or whatever and see what does things faster[09:10:24] <cybereal> it's not always a 1:1 thread:core mapping that is fastest[09:10:28] <hiredman> very empiracl[09:10:39] <cybereal> and how you divide the computation can affect things too[09:12:14] *** phyburn has quit IRC[09:14:49] *** alek_b has joined ##java[09:15:30] *** perry753 has joined ##java[09:15:39] *** alek_b has quit IRC[09:15:52] *** aceofspades19 has quit IRC[09:16:12] *** alek_b has joined ##java[09:20:01] *** Roritharr has quit IRC[09:22:42] *** warriorforgod has quit IRC[09:23:22] *** CodeWar has joined ##java[09:24:32] <CodeWar> I have an interface IAllocator and 3 possible implementations. Using regular DI I can have my class get IAllocator injected in and all is fine. If IAllocator requires constants that can also be done. the trouble arises when ..[09:25:16] <CodeWar> IAllocator requires as input an object that is not available until runtime... i m not sure how to use DI for this case[09:26:31] <cybereal> er isn't that the ENTIRE point of DI?[09:27:30] <CodeWar> huh?[09:28:18] <CodeWar> guess i could use a builder but this doesnt feel right ... too hacky .. cybereal can you elaborate if you have a better solution[09:28:59] <cybereal> no, I have to go snuggle McWife, sorry[09:29:04] *** Copter has joined ##java[09:29:24] *** [pwgr] has joined ##java[09:38:01] *** aceofspades19 has joined ##java[09:38:36] *** iluvgrlzwglasses has quit IRC[09:42:36] <Tenac> Is there some simple code to recursively load all the files' names inside a directory?[09:43:05] *** usicow has joined ##java[09:43:10] *** Kwitschibo has joined ##java[09:43:22] <[pwgr]> look at the javadoc api for java.io.File[09:43:24] *** Gary_ has joined ##Java[09:43:29] *** iluvgrlzwglasses has joined ##java[09:43:32] <[pwgr]> apply a little compsci[09:43:35] <[pwgr]> presto[09:44:06] *** Gary has quit IRC[09:44:13] <usicow> Is there an efficient way to combine multiple binary files into 1 file? I've written an app that downloads a file in multiple sections, and saves them each on the HDD, now I want to combine them all.[09:45:25] *** Gary_ is now known as Gary[09:45:41] *** ridoo has quit IRC[09:46:07] *** CodeWar has quit IRC[09:46:15] <usicow> Currently I'm just making a FileInputStream and a FileOutputStream, and reading one into the other.. but its really slow..[09:47:51] <usicow> in comparison cat * > newfile is super fast...[09:48:46] <ayrnieu> strace your program and the cat version to get an idea of the reason.[09:49:28] *** kercyr has joined ##java[09:49:37] *** jcp has quit IRC[09:49:42] *** pandora-- has quit IRC[09:51:20] *** phyburn has joined ##java[09:52:29] <ojacobson> usicow: if you're reading one byte from the source and writing it to the destination, it's going to be slow[09:52:31] <pstickne> cybereal: I've also found http://incubator.apache.org/thrift/[09:52:51] <ojacobson> commons-io provides some classes for blasting stuff from one stream to another that do the buffering relatively well[09:52:52] <pstickne> cybereal: python supports XDR (kinda), but I can't find any Java support so that's out...[09:52:55] <Logi> usicow: are you reading individual bytes rather than reasonably sized buffers of a few kb?[09:52:56] <pstickne> (and /free/ Java support)[09:53:12] <cybereal> oh yeah thrift, I remember reading about that from facebook[09:53:40] *** rutski has quit IRC[09:54:21] *** nwmcsween has quit IRC[09:54:42] *** M[]ssad has quit IRC[09:54:58] <pstickne> cybereal: it only supports signed values though :([09:55:01] *** iluvgrlzwglasses has quit IRC[09:55:27] <pstickne> (but the Java part of protobuffers makes it look like the sign has to be handled special anyway...)[09:55:39] <usicow> ojacobson: yeah I am doing it one byte at a time.. I'll check out the api of apache commons io package.. thanks[09:55:54] *** ridoo has joined ##java[09:55:59] <pstickne> one byte at a time usually is mega-fail :)[09:56:30] <usicow> hehe[09:56:37] <ojacobson> usicow: one byte at a time means one syscall for every byte read or written[09:56:42] <Logi> usicow: there is also a read(byte[]) and write(byte[],int,int) what you can use in your loop[09:56:51] <ojacobson> usicow: syscalls are a lot more expensive than calls within the process[09:56:53] <Logi> or go with the commons, that may have something[09:57:13] *** Bollinger has joined ##java[09:57:21] <pstickne> the problem with the "commons" is that everything relies on everything (primarily the nasty logging ^^)[09:57:29] <ojacobson> usicow: any sensible stream copy (and this includes the one from commons-io) will use what Logi suggested to reduce the number of calls, probably via a Buffered*Stream[09:57:43] <ojacobson> pstickne: commons-io is mercifully low on dependencies[09:57:50] <ojacobson> it and commons-lang are the only two I use regularly :)[09:57:56] <pstickne> it's still a shame that with all this fancy OO and technical gunk, simple things like logging is a PITA to integrate[09:58:04] <pstickne> ojacobson: *whew* :)[09:58:22] <ojacobson> I think they were both written before jakarta got taken over by wankers :)[10:00:55] *** The_Pot has joined ##java[10:02:04] *** kane77 has joined ##java[10:02:27] <The_Pot> umm guys, I need to learn JAVA from scratch, the only previous programming experience I have is of PASCAL,C and C++, I am looking for a good ebook/site which can teach me from the very basics ..any advice?[10:02:38] *** genesiss has joined ##java[10:02:40] <ojacobson> ~firstcup[10:02:41] <javabot> ojacobson, firstcup is a beginner's tutorial for getting started with Java available at http://java.sun.com/tutorial/getStarted/cupojava[10:02:50] <cybereal> The_Pot: yes, focus on your pascal experience it'll actually transfer better imo :)[10:03:49] <The_Pot> okay..ty[10:04:05] *** ridoo has quit IRC[10:04:21] <The_Pot> btw, how is Java For Dummies 4th Ed by Barry Burd ?[10:04:33] <The_Pot> thanks ojacobson , looking at it[10:04:48] *** mgenov has joined ##java[10:04:49] *** ridoo has joined ##java[10:05:02] <cybereal> The_Pot: pass[10:05:30] <cybereal> I wouldn't touch any of the "for dummies" books, their entire existence is based around over-simplification[10:06:44] *** kane77 has quit IRC[10:07:17] <The_Pot> umm, okay cybereal, but i need teaching material which is fairly simplified because its been long since I have done any proper programming, and I don't have a real teacher[10:07:29] <cybereal> ~tij[10:07:29] <javabot> cybereal, tij is Thinking in Java by Bruce Eckel, see http://www.mindview.net/Books/TIJ/ for the 3rd edition (free download, published in 2002) or see http://www.mindview.net/Books/TIJ4 for the current edition which covers Java 5 features.[10:07:30] <The_Pot> so I have to depend on a book and teach myself[10:07:35] *** ridoo has quit IRC[10:07:43] <cybereal> also the tutorials you were linked to earlier are rather simple and steady[10:08:45] <The_Pot> okay cybereal ..checking them out[10:14:58] *** The_Pot has quit IRC[10:16:09] *** NiSoOo is now known as Nissim[10:16:35] *** Nissim is now known as NiSoOo[10:16:41] *** NiSoOo is now known as NiSo[10:16:46] *** pragma_ has joined ##java[10:17:03] *** NiSo is now known as NiSoOo[10:18:56] <pstickne> cybereal: haha, I'm half tempted to switch to using thrift to also hand the IO layer[10:24:42] *** npm has quit IRC[10:26:09] *** kane77 has joined ##java[10:29:20] * Stephmw looks in[10:30:37] *** archangelpetro has joined ##java[10:33:21] *** usicow has quit IRC[10:34:03] *** NiSoOo has quit IRC[10:35:08] *** NiSoOo has joined ##java[10:42:08] <pstickne> geeze. but the lack of unsigned numbers is a bummer :([10:44:35] *** Gary has quit IRC[10:47:04] *** bas-i has joined ##java[10:48:45] *** sjb_ has quit IRC[10:49:21] *** kapipi has joined ##java[10:49:29] *** Gary has joined ##Java[10:49:58] *** kane77 has quit IRC[10:52:07] *** mengu has joined ##java[10:53:15] <pstickne> gah, also the lack of cyclic structs sucks :([10:56:11] *** kapipi has quit IRC[10:56:18] *** juanez has joined ##java[10:56:33] *** t3mp3st_ has joined ##java[10:58:50] *** t3mp3st has quit IRC[11:00:28] <Stephmw> pstickne: writing low-level network code?[11:01:24] <pstickne> Stephmw: nah, looking at already made solutions for packing data, Thrift and Protocol Buffers are the current contenders.[11:01:45] <pstickne> Stephmw: actually going to replace my mix of MIG(code generator)+homebrew[11:02:26] <pstickne> Stephmw: but, unfortunately, Thrift does not support unsigned values and even Protocol Buffers only represents them bit-wise in Java[11:03:01] <pstickne> (e.g. unit32 is parsed as int which still makes it a pita to deal with)[11:03:22] <Stephmw> ah[11:03:46] <pstickne> Stephmw: and all-around comparisons of both kind of suck. Thrift offers the network-engine code as well, so I'm actually kind of leaning towards it...[11:04:25] <pstickne> But I like the PB format better in general :([11:05:12] *** Yustme has joined ##java[11:05:43] <Stephmw> about structs, didn't javalution have something like that?[11:05:45] * Stephmw looks[11:05:59] *** rulereric has joined ##java[11:06:07] <Stephmw> pstickne: http://javolution.org/api/javolution/io/Struct.html[11:06:44] <pstickne> Stephmw: I have another requirements :([11:06:53] <pstickne> Stephmw: has to work with Python as well ^^[11:07:00] <Stephmw> haha[11:07:16] <Stephmw> jython or java->jni->python?[11:07:34] *** dfrbn has quit IRC[11:07:43] <pstickne> Nooo![11:07:47] <pstickne> ^^[11:11:08] *** merlin83 has quit IRC[11:12:54] *** kercyr has quit IRC[11:13:00] *** sphenxes has quit IRC[11:19:39] *** TheCastor has joined ##java[11:25:56] *** javahorn has joined ##java[11:26:00] *** kane77 has joined ##java[11:29:28] *** The_Birdman has joined ##java[11:31:43] *** tieTYT3 has joined ##java[11:31:46] <tieTYT3> hello[11:31:47] <tieTYT3> anyone here?[11:32:26] <[pwgr]> HELLOW[11:32:46] <tieTYT3> i've got this test case that involves threading. I'm pretty sure that the code it tests works, but once in a while the test fails. Could someone look at this and tell me how to be sure this works correctly?[11:32:47] <tieTYT3> http://pastebin.com/m52351756[11:33:54] *** The_Birdman has quit IRC[11:34:03] <tieTYT3> it's ugly as sin, let me explain what it's testing: you put a InboundCommand on the inboundCommandQueue, it executes it and increments inboundCount. It then returns an object that gets executed on the outboundCommandQueue. When that executes, it increments outputCount.[11:34:34] <tieTYT3> so i want to test that every time you add an inboundCommand, it and it's outboundCommand executes[11:35:40] *** juanez has quit IRC[11:36:22] *** acuster has joined ##java[11:37:50] <pstickne> cybereal: there is also ETCH (similar to PB/Thrift, accepted by Apache)[11:40:39] *** bindaas has quit IRC[11:41:18] *** The_Pot has joined ##java[11:42:00] *** Woflborg has joined ##java[11:42:34] <Ragnor> tieTYT3: why do you wait a fixed time rather than until the "events" occur? 50 milliseconds seems much too short: what if your computer stalls for whatever reason (swapping for example)? Or things like garbage collection occur concurrently?[11:43:15] <tieTYT3> Ragnor: yeah that's what it's doing which is why it fails sometimes[11:43:20] <tieTYT3> how do I wait til the events occur?[11:43:26] <tieTYT3> you mean using wait() and notify()?[11:44:01] <Ragnor> I guess so. And probably some general timeout (10 seconds or so) to force the test to fail in case no event occurs.[11:44:28] <tieTYT3> that works[11:44:32] <tieTYT3> now i gotta research how to use wait and notify[11:44:35] <tieTYT3> thanks[11:45:58] *** Varox has joined ##java[11:46:19] *** sphenxes has joined ##java[11:53:51] <tieTYT3> in intellij, i don't get an error for this line: assertEquals(98, d1.getHp());[11:53:54] <tieTYT3> until i compile[11:54:07] <tieTYT3> and it still doesn't show it as an error. Says the reference is ambiguous, which i understand[11:54:15] *** cybereal has quit IRC[11:58:25] *** vesz has joined ##java[12:03:18] *** staykov has joined ##java[12:04:39] *** toytoy has quit IRC[12:13:23] *** M[]ssad has joined ##java[12:15:26] *** MigoMipo has joined ##java[12:15:44] *** romanb has joined ##java[12:15:44] *** bas-i has quit IRC[12:22:16] *** pirho has joined ##java[12:23:56] *** bas-i has joined ##java[12:24:09] *** Ivellina has joined ##java[12:26:26] *** rawbk has quit IRC[12:29:21] *** DeadEd_ is now known as DeadEd[12:42:05] *** staykov has quit IRC[12:44:17] *** magentar has joined ##java[12:46:56] *** phyburn has quit IRC[12:48:02] *** blankthemuffin has joined ##java[12:48:09] *** ayrnieu has quit IRC[12:51:23] *** Sikul has quit IRC[12:55:23] *** Ivellina has quit IRC[12:55:29] *** cher has joined ##java[12:59:40] *** pstickne has quit IRC[13:05:40] *** DragonLord- has joined ##java[13:07:45] *** longbeach has joined ##java[13:11:42] *** bhz- has joined ##java[13:11:53] *** ridoo has joined ##java[13:13:43] *** mengu has quit IRC[13:14:03] *** yaan has quit IRC[13:15:01] *** _Matthias has quit IRC[13:15:15] *** ridoo has quit IRC[13:18:24] *** magmarules has joined ##java[13:18:38] *** javahorn has quit IRC[13:18:40] <magmarules> hello there, is there a channel i can ask help about swt ?[13:19:53] *** sjb_ has joined ##java[13:19:55] <dangertools> #eclipse[13:20:07] <magmarules> dangertools: they dont seem to be alive[13:20:18] <magmarules> 135 dead members in the channel =/[13:20:19] <dangertools> be patient or try your luck here[13:20:26] <magmarules> ok =)[13:20:37] *** ridoo has joined ##java[13:22:04] *** Junior has quit IRC[13:24:02] <magmarules> has anyone used eclipse 3.5 M4 ? i cant seem to get the preferences window to open[13:24:29] *** ridoo has quit IRC[13:25:04] *** M[]ssad has quit IRC[13:25:30] *** ridoo has joined ##java[13:26:09] <NiSoOo> CLR = Common Language... ? (forgot the R)[13:27:51] *** bas-i has quit IRC[13:28:18] *** Goundy has joined ##java[13:28:18] *** latebind has joined ##java[13:28:48] *** jottinger has joined ##java[13:30:01] *** red1 has joined ##java[13:31:23] <jottinger> morning[13:31:31] *** romanb has quit IRC[13:33:15] <dangertools> magmarules: so that's an eclipse question, not a swt question[13:33:19] <dangertools> NiSoOo: runtime[13:33:27] <magmarules> =)[13:33:29] <NiSoOo> thanks[13:39:35] *** Varox has quit IRC[13:42:04] *** ridoo has quit IRC[13:44:21] *** The_Pot has quit IRC[13:45:14] *** The_Pot has joined ##java[13:45:20] *** whaley has joined ##java[13:46:37] *** Goundy has quit IRC[13:47:33] *** LostMonarch has joined ##java[13:47:56] <ernimril> jottinger: hello[13:47:58] *** RLa has joined ##java[13:48:33] <RLa> anyone here written custon TokenStream for antlr-generated parser?[13:50:01] *** buntfalke has joined ##java[13:50:54] <jottinger> hey ernimril - the XML article is in the queue. might be a month, but it's in the queue.[13:51:02] <ernimril> jottinger: cool[13:51:17] *** Goundy has joined ##java[13:51:20] <ernimril> jottinger: I have been very busy so I have had like 5 minutes of irc time the last few days...[13:51:44] <jottinger> ernimril: I've had less - been traveling[13:51:57] <ernimril> jottinger: ok[13:52:33] *** RenatoSilva has joined ##java[13:57:17] *** magentar has quit IRC[14:01:51] *** whaley has quit IRC[14:09:26] *** RenatoSilva has left ##java[14:12:09] <ijk> I'm gradually building a string using StringBuilder. in each iteration however I need to check the last two characters of that string. if I then need to convert it into a string in order to check endsWith, then I loose the overhead won by using StringBuilder. what would be a cleaner solution?[14:12:56] <ernimril> ijk: StringBuilder allows you to get the two last characters without problems[14:13:55] *** bitshuffler has joined ##java[14:14:02] <ijk> I see now.. :)[14:16:58] *** arpu has quit IRC[14:17:39] <jottinger> use stringbuffer![14:18:05] * jottinger grins[14:19:59] <latebind> ~hello world[14:20:00] <javabot> latebind, hello world is the comprehensive list of Hello World snippets, http://roesler-ac.de/wolfram/hello.htm[14:21:54] *** genesiss has quit IRC[14:22:05] *** genesiss has joined ##java[14:22:22] <latebind> lol, this is why i dont do visual basic[14:22:26] <latebind> http://helloworldsite.he.funpic.de/hello.htm#VisualBasic[14:22:42] *** MigoMipo has quit IRC[14:24:14] <Logi> latebind: tbf, vb.net isn't that horrible[14:24:32] *** Daniel_G has quit IRC[14:24:48] *** Daniel_G has joined ##java[14:25:04] <latebind> yeh, I know, but its pretty lame for a hello world[14:25:47] <latebind> thats like 20 lines of code[14:27:10] *** magmarules has quit IRC[14:28:39] *** ridoo has joined ##java[14:28:53] *** ridoo has quit IRC[14:29:18] *** factor has left ##java[14:30:54] *** hyppias has joined ##java[14:31:00] *** NiSoOo has quit IRC[14:36:25] *** cads has quit IRC[14:37:35] *** Varox has joined ##java[14:38:24] *** eidolon has quit IRC[14:39:10] *** javahorn has joined ##java[14:46:30] <ries> Good Morning All, I am trying to create a named query likes this: SELECT t FROM TblDomains t WHERE :domainName LIKE t.domain_name ORDER BY t.domain_name=:domainName DESC LIMIT 1. But I am getting this error : Is that possible, this isnce I get an error much like this : line 1, column 51: unexpected token [t]. Internal Exception: line 1:51: unexpected token: t[14:46:46] *** pirho has quit IRC[14:50:57] <latebind> ries : shouldnt it be SELECT t.xxx, t.yyy FROM ...[14:51:18] <cheeser> you can't parameterize query structures only, you know, parameters.[14:51:48] <cheeser> and it looks like you have that first LIKE backwards[14:52:03] <cheeser> the whole query looks off.[14:52:34] <ries> The LIKE backwards is correct for this query, how odd it may seem[14:52:35] <cheeser> try select t from TblDomains t where t.domain_name like :domainName desc limit 1[14:52:40] <ries> But I think I made a naming mistake....[14:52:54] <ries> domain_name should have been domainName[14:52:56] <cheeser> you're trying to pass in the name of the column?[14:53:10] <cheeser> i don't think JPA/hibernate supports that.[14:53:18] <ries> Yes... Much like this in JDBC : SELECT * FROM public.tbl_domains WHERE 'nl.vantwisk.www' ILIKE domain_name ORDER BY domain_name='nl.vantwisk.www' DESC LIMIT 1[14:53:43] <cheeser> that's not valid sql either[14:54:00] <cheeser> ORDER BY foo='bob' ?[14:54:07] <cheeser> i've never ever seen that.[14:54:30] <ries> Yes it's valid SQL... at least for PostgreSQL[14:56:13] * _W_ looks over at the silence in #sql - no wonder if the SQL questions all go to ##java[14:56:13] *** dvayanu has joined ##java[14:56:43] *** Varox has quit IRC[14:57:11] <ries> _W_: this is more about JPA and creating a names query rather then SQL in question[14:57:29] *** Varox has joined ##java[14:57:58] <jottinger> EJBQL != SQL[14:58:06] <jottinger> You can't create a named query like that[14:58:16] <ries> jottinger: Hmmmm[14:58:18] <cheeser> which is what i've been saying.[14:58:19] <ries> good to know!!![14:58:49] <ries> cheeser: understood.... for me SQL is what a RDBM understand (SQL-92, SQL 1999 etc etc)[14:58:55] <cheeser> k. time to catch a train[14:59:00] <jottinger> ries: that's fine. EJBQL isn't SQL.[14:59:01] <cheeser> ries: it's what SQL is to everyone...[14:59:03] <ries> cheeser: thanks for the input![14:59:07] <cheeser> gotta run, though.[14:59:18] *** OldMonkey has joined ##java[14:59:48] <ries> jottinger: if I want to run such a SQL, would that still be possible?? I don't like to be limited by EJBQL[15:00:52] <jottinger> You can use a native query.[15:01:08] <OldMonkey> Hi. I am trying to join 2 images using imageio.. as suggested in the 3rd post here http://forums.java.net/jive/thread.jspa?threadID=21268 .. But i can't really figure out how to.. I have one BufferedImage for the final image.. and i have two Image objects which have my source images.. how do i go about merging those ? ( the imagereader part, specifically )[15:01:32] *** pirho has joined ##java[15:02:10] <ries> jottinger: Just found that :) let me try....[15:03:41] *** whaley has joined ##java[15:04:01] *** skoskav has quit IRC[15:04:05] <OldMonkey> should i be using getsubimage on teh final BufferedImage ? or the two source images i have?[15:05:44] *** red1 has quit IRC[15:07:41] *** magentar has joined ##java[15:09:16] *** vix85 has joined ##java[15:09:37] *** ayrnieu has joined ##java[15:12:04] <latebind> OldMonkey : have you tried JAI?[15:14:40] <juc0> yea jai's well good[15:14:51] *** juc0 has quit IRC[15:15:28] <ries> jottinger: what would be the reason why namedquery doesn't pass and replace the SQL directly to the RDBM?? if it's OT, let me know :)[15:16:19] *** orgy` has joined ##java[15:17:25] <jottinger> ries: because SQL doesn't do jack shit for object orientation. EJBQL can (and does) walk the object tree to work out the actual valid SQL[15:18:06] <jottinger> so you can query set relationships with EJBQL that you can do via SQL, but SQL has this long and tortuous statement for it[15:19:07] <ries> jottinger: Ahhh yes... understood![15:19:17] <ries> it just looks like SQL... need to remember that[15:21:09] *** igordcard has joined ##java[15:21:43] <jottinger> yep[15:21:53] <jottinger> chosen to look like SQL so people have SOME familiarity[15:21:56] <jottinger> but it's not SQL[15:22:23] *** ruwen has joined ##java[15:22:27] <ruwen> hi[15:23:03] <ruwen> i am looking for a java source diff tool, which ignore stuff like comments/formatting/white spaces. any ideas?[15:24:37] <OldMonkey> latebind: nope[15:26:42] *** magentar has quit IRC[15:26:46] *** magentar has joined ##java[15:28:13] <ries> jottinger: thanks for the info, my nativeQuery works now aswell....[15:28:25] *** OldMonkey has left ##java[15:29:42] *** midbit has joined ##java[15:32:14] *** convivial has joined ##java[15:39:12] *** RLa has quit IRC[15:40:20] *** skypce has joined ##java[15:41:13] <skypce> hi, how can i set a jFormmatedTextField1 to show the now date[15:42:11] *** totix801 has joined ##java[15:42:42] <skypce> i try JFormattedTextField efFecha = new JformattedTextField(new Date()); but dont work[15:43:09] <totix801> how can I make a 2d array to 1d?[15:45:33] *** flb has joined ##java[15:45:38] *** magentar has quit IRC[15:45:59] *** igordcard has quit IRC[15:47:05] *** Junior has joined ##java[15:47:18] <Junior> .[15:47:34] <ernimril> totix801: that question does not make sense[15:47:46] <ernimril> totix801: what kind of transform do you want to do?[15:48:03] *** SilentAssassin has joined ##java[15:48:53] *** vix85 has quit IRC[15:50:21] *** jkriesten has quit IRC[15:50:46] <totix801> For example I got a int[5][5] and I want it as an int[25][15:50:52] *** gajop has joined ##java[15:51:04] <ernimril> totix801: manual copy is the only thing you can do[15:51:18] *** midbit has quit IRC[15:51:31] <totix801> Is there really no more comfortable way to do that?[15:51:50] <gajop> lol, since when can java harm your computer, or at least google thinks that (try googling for java and going for the first link)[15:52:25] <ernimril> totix801: you find it uncomfortable to write two lines of code? (one for-loop and one System.arrayCopy)?[15:52:36] *** unigue_ has joined ##java[15:52:38] <neshaug> totix801: make a one dimensional array large enough to hold all the two dimensional array values and the loop trough the two dimensional array and put the values found in the one dimensional one..[15:53:01] <neshaug> or do as ernimril :)[15:53:37] *** bhz- has quit IRC[15:53:44] <totix801> I just thought there might be another way[15:54:06] <ernimril> totix801: what other way would that be?[15:54:14] <neshaug> totix801: there is no "logical" way of making a two dimensional array to one, so why would there be?[15:54:39] <ernimril> totix801: java does not have 2-dimensonal arrays, it only have 1d-arrays (but the contents of an array may be other arrays)[15:59:53] *** jkriesten has joined ##java[16:00:11] *** sjb_ has quit IRC[16:01:31] <dangertools> gajop: search for anything else - looks like every site may harm your computer[16:01:42] *** ruwen has quit IRC[16:02:00] <gajop> dangertools: hah yeah, i see, well it's true![16:02:39] *** bindaas has joined ##java[16:03:01] *** rollins has joined ##java[16:03:32] <The_Pot> yay! google is b0rked .. its chaos on the internet :p[16:04:20] <skypce> how can i show a date with a jFormmatedTextField?[16:05:06] <whaley> ohnoes, skynet is taking over[16:08:56] <ernimril> ~~skypce javadoc JFormattedTextField[16:08:56] <javabot> skypce, http://java.sun.com/javase/6/docs/api/javax/swing/JFormattedTextField.html[16:09:03] <skypce> thanks[16:09:08] <skypce> what appen with google[16:09:09] <ernimril> skypce: what is the first example in the javadoc?[16:09:14] *** unigue_ has quit IRC[16:09:27] <skypce> i cannot navegate[16:09:31] <_W_> ~igb[16:09:32] <javabot> Is google broken?[16:09:32] <_W_> :D[16:10:06] <selckin> it is![16:10:19] <skypce> i deactivate the java and javascript support of mozilla, the problem dont fix[16:10:23] <skypce> mm[16:10:29] <skypce> thank ernimril[16:12:55] *** ScottG489 has quit IRC[16:13:56] <skypce> http://www.google.cl/interstitial?url= removing this is how i am navigating , do you have this problem or is my pc infected?[16:14:23] *** _graham_ has joined ##java[16:14:58] *** Angel-SL has quit IRC[16:15:08] <ayrnieu> skypce - everyone has noticed it.[16:15:26] <ayrnieu> that your computer is infected, I mean. You look at a lot of weird things.[16:15:50] <nekrozion> the whole google is fucked[16:15:59] <skypce> jojojojo[16:16:24] <skypce> la manza cagada[16:16:26] *** Inhuman has joined ##java[16:16:35] <nekrozion> what she said[16:16:43] <ayrnieu> in bed. to your mother.[16:16:51] *** gps23 has joined ##java[16:17:11] <gps23> hi[16:17:21] <gps23> where can i do applet related discussion?[16:17:34] <ernimril> ~applets[16:17:35] <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[16:17:49] <ernimril> gps23: you can also try to run ##java-applets[16:17:59] <gps23> ernimril, thanks[16:18:17] *** pa has joined ##java[16:19:00] <gps23> ernimril, there is no ##java-applets channel[16:19:36] *** jottinger has quit IRC[16:20:26] *** ScottG489 has joined ##java[16:21:35] *** Ivellina has joined ##java[16:21:41] <gps23> i am sorry but i wanted to ask abt servlets, going to learn them but i don't know how to configure web server for them, please point me to right direction. i am confused b/w apache and apache tomcat[16:22:00] <ernimril> ~servlets[16:22:00] <javabot> servlets are a mechanism for programmatically building HTTP handlers in Java. See http://java.sun.com/products/servlet/ for more info, including API specs and other documentation.[16:22:20] <ernimril> gps23: the tomcat examples can probably be useful as well[16:22:56] <ayrnieu> try #tomcat[16:23:23] <gps23> ernimril, thanks, i am sure i will get something from the links[16:24:15] *** skoskav has joined ##java[16:25:51] <SilentAssassin> is there in java something that fills an array with for example 0 ,[16:26:05] <whaley> SilentAssassin: yes[16:26:25] <whaley> ~~ SilentAssassin javadoc Arrays[16:26:25] <javabot> SilentAssassin, http://java.sun.com/javase/6/docs/api/java/util/Arrays.html[16:26:26] <SilentAssassin> and what it is? except Array.fill or i read something like that[16:27:04] <ernimril> SilentAssassin: if you do not know Arrays and Collections I strongly suggest that you go and read up on _all_ the methods in them, they will help you a lot[16:27:09] *** ankylose has joined ##java[16:27:12] <whaley> ^[16:27:19] <SilentAssassin> no i know about them but my jdk doesnt support this fill method[16:27:39] *** focus has joined ##java[16:27:50] <whaley> SilentAssassin: uhm... what jdk are you using?[16:28:15] <ernimril> SilentAssassin: Arrays has an "@since 1.2"[16:28:18] <SilentAssassin> wait it says since 1.2[16:28:24] <SilentAssassin> wtf i thought i downloaded the newest[16:28:29] <whaley> heh.[16:28:43] *** focus has left ##java[16:28:52] <ernimril> SilentAssassin: "java -version"? "javac -j-version"?[16:29:04] <SilentAssassin> i have jdk 1.6[16:29:17] *** GhettoJava has joined ##java[16:29:25] <ernimril> SilentAssassin: ops, that is "javac -J-version"[16:29:38] *** alek_b has quit IRC[16:29:58] <SilentAssassin> omg i apolagize , i was writing Array.fill not Arrays.fill[16:30:33] *** The_Pot has quit IRC[16:31:10] <JavaGeek> speling--[16:31:36] <ernimril> SilentAssassin: would you happen to be using an ide that auto fixes your imports or what?[16:31:48] *** vdv has joined ##java[16:31:51] <SilentAssassin> well i just imported java.utils.*[16:32:04] <vdv> hi all[16:32:07] <ernimril> SilentAssassin: Array is either java.lang.reflect or java.sql[16:32:19] *** Dr_Link has quit IRC[16:32:24] <ernimril> ~~SilentAssassin star import[16:32:24] <javabot> SilentAssassin, star imports is http://en.wikibooks.org/wiki/Java_Programming/StarImports[16:32:32] *** alek_b has joined ##java[16:32:49] *** alek_b has quit IRC[16:33:11] <SilentAssassin> well i accept every good suggestion[16:33:21] *** alek_b has joined ##java[16:34:23] *** ScottG489 has quit IRC[16:34:23] *** woogley has joined ##java[16:34:40] *** ScottG489 has joined ##java[16:34:47] *** Varox has quit IRC[16:35:33] *** Lhet has joined ##java[16:35:44] *** delskorch has joined ##java[16:35:58] *** fixnum has joined ##java[16:37:04] *** srounet has joined ##java[16:37:12] <srounet> hello[16:37:48] <srounet> I'm starting with JavaFX and trying to create a menuBar.[16:38:39] <srounet> Browsing the api i can't find any links related to this element. Is there a way to create a menuBar in javafx as it was with Swing ( MenuBar... )[16:38:41] *** hyppias has quit IRC[16:38:44] *** vix85 has joined ##java[16:39:29] *** vrv has joined ##java[16:41:04] <JavaGeek> srounet: sorry, no javafx for me yet[16:42:17] *** vrv has quit IRC[16:42:45] *** acuster has quit IRC[16:42:50] *** gps23 has quit IRC[16:44:03] <skypce> what's is the import for date() classes?[16:46:33] <JavaGeek> skypce: java.util.Date?[16:46:45] <skypce> thanks JavaGeek[16:46:56] *** dnmo has quit IRC[16:47:19] *** whaley has quit IRC[16:48:49] <fixnum> Hello, I have a few JButtons in my JToolBar. Is it possible to know which one is under the mouse when I move my mouse over the JToolBar?[16:49:14] *** gdoko has joined ##java[16:49:18] <ernimril> fixnum: yes[16:50:42] <fixnum> ernimril, ok. I'll look into more[16:50:50] <fixnum> it*[16:51:13] <ernimril> fixnum: either mouse motion listeners or focus listeners will allow you to do it[16:51:39] *** Devedse has joined ##java[16:53:42] <Devedse> hey everyone, im looking for a really simple java text based game with a server and a client. The only thing i want is that it can send and receive commands to the server like this: sender.sendCommand("go up") or sender.sendMessage("hey all"), someone know if some kind of this has already been made?[16:54:29] <ayrnieu> Devedse - mud clients, mud servers.[16:54:44] <Devedse> il look that up :)[16:54:44] <ernimril> Devedse: multi player notepad? also known as irc? yes there are very many such things, or mud if you want that instead[16:55:11] <Devedse> i want some kind of game with rooms/players/ item bags etc[16:55:32] <Devedse> so if thereÅ› 2 player in 1 room and you say something it will send to only the players in that room[16:55:53] *** dmlloyd has quit IRC[16:56:39] *** jottinger has joined ##java[16:58:16] *** userek has joined ##java[16:58:30] <userek> ~htmlparser[16:58:30] <javabot> userek, htmlparser is http://htmlparser.sf.net - it parses HTML.[16:59:38] *** joeo has joined ##java[16:59:39] *** jottinger has quit IRC[16:59:54] *** KnK0 has joined ##java[17:04:19] *** ankylose has quit IRC[17:05:11] *** gdoko has quit IRC[17:06:13] *** SilentAssassin has quit IRC[17:06:51] *** neoecs has quit IRC[17:07:24] <Devedse> hmm i cant really find anything simple yet, all the things i find have skils, 1000 rooms, 100 of commands :), im looking for a thing of like 10 classes with rooms and commands but no stuff added yet[17:09:08] *** Razec has joined ##java[17:09:57] <_W_> Devedse, consider - why would someone release something like that?[17:09:57] <ayrnieu> look at the Java entry to this contest: http://www.andreasen.org/16k.shtml[17:10:16] <_W_> ayrnieu, why?[17:10:18] <Devedse> k :)[17:10:36] <_W_> oh I see[17:10:36] <ayrnieu> Devedse: look at the Java entry to this contest: http://www.andreasen.org/16k.shtml[17:10:41] <_W_> that was an answer to Devedse[17:11:01] * _W_ is sceptical to people who just tells you to open an URL[17:11:02] <Devedse> ye im looking to it :)[17:12:03] <_W_> java 1.2.2[17:12:04] * _W_ shudders[17:12:59] *** aTypical has joined ##java[17:14:08] <srounet> Is there a way to have a menuBar in javaFX ???[17:18:21] *** epalm has joined ##java[17:18:41] *** squi has joined ##java[17:19:01] *** ankylose has joined ##java[17:25:27] *** Devedse has quit IRC[17:26:36] *** vdv has quit IRC[17:27:33] *** ScottG489 has quit IRC[17:27:34] *** provolone has quit IRC[17:28:05] *** ScottG489 has joined ##java[17:39:32] *** srounet has quit IRC[17:39:52] *** javahorn has quit IRC[17:40:51] *** javahorn has joined ##java[17:45:19] *** ScottG489 has quit IRC[17:45:29] *** ScottG489 has joined ##java[17:46:52] *** pirho has quit IRC[17:48:29] *** Razec has quit IRC[17:51:38] *** teralaser has joined ##java[17:51:47] *** romanb has joined ##java[17:54:48] <ayrnieu> ~google javafx menubar[17:54:48] <javabot> http://www.google.com/search?q=javafx+menubar[17:56:30] *** vdv has joined ##java[17:57:56] *** b0fh_ua has joined ##java[17:58:21] *** lem has joined ##java[18:00:10] *** makii has joined ##java[18:00:50] <b0fh_ua> Hello! I have the application module, which responds to RMI calls for getting it's state. As I found, looks like sometimes some kind of a deadlick occurs. We do not really have much time now to resolve and fix the cause of this error, and if we could find out the deadlock presence - it would be OK to restart the application, as a quick and dirty fix. The question is - how can we limit the call to RMI method to several minutes, so if the call[18:01:29] *** rdancer has joined ##java[18:01:45] <ayrnieu> b0fh_ua, you get cut off at "so if the call"[18:01:52] <Logi> but I think we got the gist[18:02:39] *** hoens has quit IRC[18:10:10] *** Dr_Link has joined ##java[18:15:23] *** eJot has joined ##java[18:18:18] *** joeo has quit IRC[18:19:21] *** t3mp3st_ has quit IRC[18:21:00] *** vdv has left ##java[18:22:55] *** FireSlash has joined ##java[18:23:01] *** bindaas has quit IRC[18:26:46] *** LordMetroid has joined ##Java[18:27:05] <Obeliks> use a custom Security manager[18:27:16] *** momomo has joined ##java[18:27:22] *** cher has quit IRC[18:27:44] <Obeliks> b0fh_ua, use a custom Security manager[18:27:54] <Obeliks> that could work[18:31:58] *** lenni_-_ has joined ##java[18:32:43] *** romanb has quit IRC[18:33:11] *** FireSlash has quit IRC[18:34:05] *** tyreel has joined ##java[18:34:13] *** tyreel has left ##java[18:35:37] *** GhettoJava has quit IRC[18:37:16] *** GhettoJava has joined ##java[18:39:29] *** lenbust has joined ##java[18:44:15] <lenbust> what is an efficient and/or simple way of processing each line of input from stdin on line-per-line basis?[18:44:16] *** igordcard has joined ##java[18:45:24] *** lenni_-_ has quit IRC[18:45:34] *** lenni_-_ has joined ##java[18:48:11] *** Ghost-r has joined ##java[18:50:39] *** mele- has joined ##java[18:50:42] *** amz has joined ##java[18:51:51] *** Deiselton has joined ##java[18:52:00] *** torarne has joined ##java[18:52:01] <Ghost-r> does new netbeans 6.5 come with c/c++ default, unlike the 5.5 version were we had to install c/c++ plugin ?[18:52:27] <nekrozion> ~~java[18:52:27] <javabot> The syntax is: tell nick about factoid - you missed out the 'about', nekrozion[18:52:29] <torarne> Q: Is ther a way in Java to read the permissions of a file? I.e. if its 644 or 755?[18:52:48] <nekrozion> anyway, how is this java?[18:53:23] *** ayrnieu has quit IRC[18:53:23] *** genesiss has quit IRC[18:53:23] *** tieTYT3 has quit IRC[18:53:23] *** Gary has quit IRC[18:53:24] *** ffgeek200b has quit IRC[18:53:24] *** GodTodd_ has quit IRC[18:53:24] *** Xianny has quit IRC[18:53:24] *** indeterminatus has quit IRC[18:53:24] *** mitch0 has quit IRC[18:53:24] *** ycy has quit IRC[18:53:24] *** im_maciek has quit IRC[18:53:24] *** jo4 has quit IRC[18:53:24] *** hotspants has quit IRC[18:53:25] *** Tempoe has quit IRC[18:53:25] *** alankila has quit IRC[18:53:53] *** ayrnieu has joined ##java[18:55:13] *** ycy has joined ##java[18:55:18] *** Gary has joined ##Java[18:57:29] *** Varox has joined ##java[18:57:32] *** riotz has joined ##java[18:57:54] <AMcBain> Ghost-r, I would suggest asking the Netbeans channel.[18:58:06] <Logi> ~~ javahorn pm[18:58:06] <javabot> javahorn, Use /msg to talk to Drone and javabot, but ask other users first. See: http://javachannel.net/wiki/pmwiki.php/FAQ/Pm[18:58:18] *** Xianny has joined ##Java[18:58:59] <Ghost-r> AMcBain did, channel seems to be dead... for long[18:59:09] *** genesiss has joined ##java[19:00:08] *** vix85 has quit IRC[19:00:13] <AMcBain> Every channel has times and days when they are more active. You just have to wait. NetBeans is a tool which allows you to write Java, and not necessarily "on topic" here ... Why not try their website to see, or download it and find out.[19:00:32] *** arpu has joined ##java[19:02:03] <cheeser> it's as on topic as any other java ide[19:02:05] *** durka42 has quit IRC[19:02:17] <cheeser> which is to say, mostly though it's specific channel is preferred.[19:02:23] <cheeser> *its*[19:02:47] <AMcBain> I quoted it, I didn't say it was strictly verboten.[19:03:38] * cheeser nods.[19:03:44] *** arpu has quit IRC[19:04:25] <ojacobson> cheeser: that's it, isn't it?[19:04:35] <cheeser> i was just thinking about that...[19:04:45] <cheeser> ojacobson: run the bot and try the javadoc command[19:04:52] <cheeser> i'm not sure if I want to leave the output like or not.[19:05:04] <cheeser> was trying to decide about adding some context for each link[19:05:36] <ojacobson> Can you identify the class/method for each link?[19:05:40] *** makii has quit IRC[19:05:54] <ojacobson> I'd hate to have to click through four or five variants to find the link I wanted[19:05:56] *** Ghost-r has quit IRC[19:06:09] <cheeser> that's what I was wondering actually. e.g., Class.method(param, param) http://is.db/*$#(F[19:06:13] <cheeser> right[19:06:22] <cheeser> so i'm going to do that, i think then call it good.[19:06:40] <Logi> javahorn: really, you don't pm anyone unless you get permission in the channel first[19:07:06] <Logi> javahorn: if you address a message to a specific nick in the channel, that person will generally be notified.[19:07:20] <Logi> JavaGeek: isn't that right?[19:07:30] <Deiselton> im trying to take a string and split it into and array of chars then parse the array of chars into integers... so far i simply said String current = currentTXT.text; char currentAR[] = current.toChar(); now im trying to figure out how to parse all chars in the array to into without a for or while loop... anyone know if there is a built in way to do this?...[19:07:30] *** sunn has joined ##java[19:07:41] <JavaGeek> Logi: wha?[19:07:51] <Logi> javahorn: then you can "take the conversation to pm" if it veers off-topic for the channel, or if it become verbose[19:07:59] <Logi> JavaGeek: sorry, I was illustrating[19:08:13] <JavaGeek> /kick Logi[19:08:21] <JavaGeek> I can illustrate too[19:08:42] * Logi mumbles something about illustrative effing foreigners[19:08:55] *** antwaungomez has joined ##java[19:09:02] <ayrnieu> really, you don't address a specific nick anyone unless you get permission in the channel first[19:09:22] *** antwaungomez has left ##java[19:09:30] *** [[thufir]] has joined ##java[19:09:41] * Deiselton wonders if anyone would mind veering off the channels do's and dont's and maybe focus on java :)[19:09:46] <Logi> ayrnieu: there is a difference, of course, between mentioning a nick like I'm doing with yours now, and sending a private message like javahorn did to me now[19:10:05] *** latebind has quit IRC[19:10:13] *** dob1 has joined ##java[19:10:48] <ojacobson> Deiselton: you want to do something to every element of a collection.[19:10:52] <ojacobson> Deiselton: you don't want to use a loop.[19:11:00] <ojacobson> Deiselton: Am I the only one who sees a contradiction here?[19:11:33] <AMcBain> nope[19:11:37] *** midbit has joined ##java[19:11:40] <dangertools> SIMD![19:11:40] <midbit> hi[19:11:59] <Deiselton> ojacodson: i didnt say i could do it... i said i want to do it... in other words is the a class like integer.Parseint() for arrays instead of using it for every element[19:12:03] * midbit still has problems with ImageIO[19:13:18] <Deiselton> i want to know becaue im trying to find more efficient ways to do things.. i can writ ethe lopp to do it in 2 minutes but if there is a better way i prefer to learn[19:13:42] <ojacobson> Deiselton: you don't need to convert chars to ints at all.[19:14:00] *** M[]ssad has joined ##java[19:14:05] <ojacobson> There's an implicit widening conversion from char to int, so the first time you do arithmetic on ' ' it turns into the int 20 (' ' is U+0020)[19:15:02] <cheeser> isn't ' ' 32 in decimal?[19:15:11] <Deiselton> ojacobson... i have to use math in my program... basically i have a string of int like a social security number... the ints together mean nothing... but apart they meant suff.... such as 1234567 1 is the current area location 234 is the X location in that area abd 567 is the Y coordinate[19:15:21] <_W_> yes, it's 32, 20 hex[19:15:27] <Deiselton> i need to split them all up so i took the input as a stiring and separated it[19:15:59] <ojacobson> cheeser: hurf. thanks. (_w_, you too)[19:16:07] <midbit> I am trying to join 2 images using imageio... something as suggested in http://forums.java.net/jive/thread.jspa?threadID=21268 ( 3rd post ) without using graphics, but i am uncertain how to go about it.. I call subimage for the final bufferedimage? Can someone please point it out to me?[19:16:51] <Deiselton> but no i need to make them ingeters so i can manipulate them with math[19:17:07] <ojacobson> They're already integers. Just not ints.[19:17:48] <ojacobson> '0' is U+0030 (0x30, 48 decimal).[19:17:56] *** shadewind has quit IRC[19:18:00] <ojacobson> '1' is U+0031 (0x31, 49 decimal).[19:18:23] <ojacobson> It's pretty trivial arithmetic to convert '0[19:18:28] <ojacobson> to convert '0' to 0[19:21:36] *** cmccormick_ has joined ##java[19:22:36] <Deiselton> ok so ur saying that if in my previous example i want to group elemnt 2, 3, and 4 together into the int 234 i could say integer Xlocation = ((char currentArray[1] * 100) + (char currentArray[2] * 10)+ (char currentArray[3] )); ?[19:22:41] <ayrnieu> '0'+0x7fffffff+0x7fffffd1[19:22:45] <ojacobson> "ur" is a place in sumeria.[19:22:49] <ojacobson> "you're".[19:23:34] <ojacobson> that's close, though[19:23:40] <Deiselton> oooh[19:23:44] <Deiselton> ok ill fiddle with it then[19:23:48] <Deiselton> thanks for the help[19:24:32] *** lenni_-_ has quit IRC[19:24:39] <ojacobson> int toDecimal (char c) { if (c < '0' || c > '9') throw new IllegalArgumentException (); return c - '0'; } might help, if you can figure out where you need to apply it.[19:25:38] *** pstickne has joined ##java[19:25:46] *** im_maciek has joined ##java[19:25:54] *** lem has quit IRC[19:26:43] <Deiselton> appreciate it[19:26:50] *** monstrfolk has quit IRC[19:27:05] *** jiggster has quit IRC[19:27:23] <cheeser> ojacobson: hrm. that javadoc parsing has gotten much slower suddenly[19:27:34] <cheeser> it used to take only 5 minutes to do the JDK[19:27:52] <ojacobson> I didn't touch it. :)[19:27:55] *** magentar has joined ##java[19:27:59] <cheeser> i don't think i did either...[19:28:35] *** TooAngel has joined ##java[19:29:21] * cheeser takes a nap[19:29:22] <cheeser> 8^)=[19:30:01] <ScottG489> Could be using RandomAccessFile to write to a file affect me using it in another class? I used it the exact same way but in another class that I made it gives a FileNotFound error. It doesn't give me the error until I try a readLine() from the file.[19:30:27] *** dv_ has joined ##java[19:30:57] * cheeser tries upping the thread pool size[19:32:52] <cheeser> oh, i know why...[19:33:02] <ojacobson> Redundant work?[19:33:08] <cheeser> because it looks like it's using hsqldb instead of pgsql[19:33:09] <cheeser> 8^)=[19:33:14] *** popcornPanic has joined ##java[19:33:34] *** ijk is now known as letfunbegin[19:36:22] *** dnmo has joined ##java[19:37:05] *** shadewind has joined ##java[19:38:30] *** jiggster has joined ##java[19:39:00] *** alek_b has quit IRC[19:40:00] *** Junior has quit IRC[19:46:47] *** omaru has joined ##java[19:47:09] *** _stack has joined ##java[19:47:39] *** vix85 has joined ##java[19:53:37] *** Junior has joined ##java[19:56:08] *** t3mp3st has joined ##java[19:57:32] *** M[]ssad has quit IRC[19:57:32] *** M[]ssad_ has joined ##java[19:57:39] *** JLearn has joined ##java[19:59:53] *** b0fh_ua has quit IRC[20:00:09] *** chandru_in has joined ##java[20:01:18] <chandru_in> hi all. Is there anyway to delete a user selected collection of entities in JPA? Right now I use a helper method which builds a dynamic query using the class and collection passed. Is there a cleaner solution in JPA to this?[20:01:28] *** ScottG489 has quit IRC[20:02:10] *** ScottG489 has joined ##java[20:03:01] *** staykov has joined ##java[20:03:40] *** shadewind has quit IRC[20:03:40] <ScottG489> Could be using RandomAccessFile to write to a file affect me using it in another class? I used it the exact same way but in another class that I made it gives a FileNotFound error. It doesn't give me the error until I try a readLine() from the file.[20:04:48] <popcornPanic> i am trying to return true or false if a string starts with a character or whitespace..anyone know how?[20:04:54] *** TheDataStream has joined ##java[20:04:57] *** midbit has quit IRC[20:05:10] <chandru_in> Generally what do JPA users here do for such requirements. This seems to be a fairly common requirement?[20:08:44] <cheeser> ~~ popcornPanic javadoc String[20:08:45] <javabot> popcornPanic, http://java.sun.com/javase/6/docs/api/java/lang/String.html[20:09:12] *** M[]ssad_ is now known as M[]ssad[20:10:45] *** arthur_kalm has joined ##java[20:11:56] *** agentx0r has joined ##java[20:12:17] <popcornPanic> i have looked all though the string docs[20:12:40] <popcornPanic> i just need to know whether or not charAt(0) contains anything or not[20:12:55] <arthur_kalm> hello everyone, I have a kind of complicated generics question[20:13:00] <cheeser> so how do you think you should go about that?[20:13:14] <arthur_kalm> I have the following interface: public interface BindingController<V extends Viewer<M>, M>[20:13:19] <popcornPanic> i have no idea..this is only my second class with java[20:13:22] *** shadewind has joined ##java[20:13:36] <popcornPanic> by class i mean learning class[20:13:40] <agentx0r> i have a class that implements runnable and run() calls a member function to count the words in a file. in my main method, i spawn a new thread for each file (from the cmd line). the issue im having is that these threads can finish at different times, and the output isn't always in the right order...[20:13:47] <arthur_kalm> and I have an Editor interface that extends Viewer: public interface Editor<T> extends Viewer<T>[20:13:53] <cheeser> popcornPanic: forget java for a second. logically speaking, how would you know if there was something in position 0 ?[20:13:58] <agentx0r> it doesnt seem using syncronized will help since they are all different objects anyhow[20:14:12] <arthur_kalm> when I try to create this field variable: private BindingController<Editor<List<EmailAddress>>, EmailAddress> emailAddressController;[20:14:30] <arthur_kalm> I get the following error: Bound mismatch: The type Editor<List<EmailAddress>> is not a valid substitute for the bounded parameter <V[20:14:30] <arthur_kalm> extends Viewer<M>> of the type BindingController<V,M>[20:14:36] <arthur_kalm> any ideas?[20:14:37] <popcornPanic> cheeser: if it was not whitespace.[20:15:03] *** momomo has left ##java[20:15:41] <cheeser> well, whitespace is "something"[20:15:58] *** x77686d has joined ##java[20:15:59] <cheeser> so i guess first, you need to define what it means to have something in that position[20:16:03] *** alek_b has joined ##java[20:16:32] *** chandru_in has left ##java[20:16:38] *** TooAngel has left ##java[20:16:54] <agentx0r> by the output not being "in order" i mean that it could print the filename of one file, but the count for another, etc[20:17:11] <ojacobson> arthur_kalm: you would need either Editor<EmailAddress> or BindingController<Editor<List<EmailAddress>>, List<EmailAddress>>[20:17:20] <ojacobson> arthur_kalm: figuring out why left as an exercise.[20:17:28] <arthur_kalm> ojacobson: haha[20:17:30] <arthur_kalm> of course![20:17:47] <arthur_kalm> ojacobson: that's very silly of me[20:17:49] <arthur_kalm> sorry[20:17:49] <ojacobson> Also, that whole thing is grotesque.[20:17:58] <arthur_kalm> ojacobson: haha I know[20:18:13] <arthur_kalm> I'm thinking of of making some interface between it[20:18:20] <arthur_kalm> since that is really hard to read[20:18:57] *** ofl_ has joined ##java[20:20:57] <popcornPanic> cheeser: i understand i have to do that. i just don't how to turn that into java[20:21:07] *** seyfarth has joined ##java[20:22:06] *** aksn has joined ##java[20:22:21] *** monkeycid has joined ##java[20:22:45] <popcornPanic> cheeser: nvm. i got it! thanks for the help[20:23:54] *** wonderwal has joined ##java[20:27:11] *** ScottG489 has quit IRC[20:29:55] <cheeser> sure[20:29:59] *** wyvern has joined ##java[20:30:14] <cheeser> (sorry. i got distracted writing a backup db script 8^)= )[20:31:21] *** agentx0r has quit IRC[20:34:15] *** ScottG489 has joined ##java[20:37:55] *** fixnum has quit IRC[20:38:55] *** buntfalke has quit IRC[20:39:14] *** Inhuman has quit IRC[20:43:22] *** eisenach has joined ##java[20:44:04] *** TheDataStream has quit IRC[20:45:57] *** wyvern has quit IRC[20:47:05] <cheeser> r0bby: http://antwerkz.com/db-export/javabot/ for your amusement[20:47:44] <ojacobson> ~monkey[20:47:45] <javabot> ojacobson, monkey is you.[20:47:49] <ojacobson> hrm.[20:48:07] *** tom17bombadil has joined ##java[20:48:54] *** LostMonarch has quit IRC[20:50:06] *** t3mp3st_ has joined ##java[20:50:22] *** latebind has joined ##java[20:51:05] <M[]ssad> ~test[20:51:05] <javabot> We couldn't care less about how well you do in your tests. If you fail, it means that we'll have fewer morons in the industry to deal with.[20:51:42] *** javahorn has quit IRC[20:51:49] <nekrozion> ~lol[20:51:49] <javabot> OMGWTF!!!BBQ!!!1111!! - Yeah, you sound like a retard.[20:52:05] <r0bby> okies cheeser :)[20:52:14] *** t3mp3st has quit IRC[20:54:35] <pr3d4t0r> Hrm... that factoid is wrong.[20:55:15] <pr3d4t0r> javabot: no, test is <reply>We couldn't care less about how well you do in your Java certification tests. If you fail, it means that we'll have fewer morons in the industry to deal with.[20:55:15] <javabot> Okay, pr3d4t0r.[20:55:19] <pr3d4t0r> javabot: Merci.[20:55:19] <javabot> pr3d4t0r: De rien.[20:55:43] * AMcBain wishes 100*infinity he had Java to use on his webhost.[20:56:12] *** Varox has quit IRC[20:58:28] * AMcBain decides that while he was at it, he should wish that certain other languages weren't so stupid, so his blood pressure could return to normal.[20:59:07] <ayrnieu> COBOL.ASP.NET is a the language of Web 2.0, AMc. Get used to it.[20:59:30] <AMcBain> If it's better than PHP, I'll take it :([20:59:43] <AMcBain> (and no, I don't like ASP that much either)[20:59:49] *** jkriesten has quit IRC[21:00:08] *** bindaas has joined ##java[21:00:16] <aceofspades19> no, MUMPS.ASP.NET is the best[21:00:28] *** jkriesten has joined ##java[21:00:43] <AMcBain> right now I'm dealing with it pulling a function out of its ass that works, but isn't defined anywhere (and thus gives a definition issue when I define it myself)[21:01:08] <r0bby> AMcBain: do you have a shell?[21:01:17] *** popcornPanic has left ##java[21:01:24] <AMcBain> r0bby: you think I have a host that lets me do that? HAH![21:01:25] <r0bby> wait you need a jvm[21:01:26] <r0bby> lol[21:02:27] <AMcBain> Plus, in some regards, even Java would be a "step down" as the other person in our group doesn't know Java.[21:02:39] <aceofspades19> can you imagine PHP for the JVM?[21:03:10] <ojacobson> ~~ aceofspades19 quercus[21:03:11] <javabot> aceofspades19, quercus is a java implementation of php5. See http://quercus.caucho.com/ . Or don't, if you value your sanity.[21:03:20] <ojacobson> aceofspades19: you should know better by now[21:03:25] *** fgmmgf has joined ##java[21:04:07] <aceofspades19> oh god[21:04:09] <AMcBain> well, it appears I have a function that happens to be the same as one already defined by the language ... one of the multitudes I was supposed to know it had :( (its docs are pretty much impossible traverse correctly/nicely)[21:04:28] <AMcBain> ~javadoc++[21:04:28] <javabot> javadoc has a karma level of 3, AMcBain[21:04:35] *** latebind has quit IRC[21:04:54] <aceofspades19> ojacobson, why would someone make that?[21:05:02] *** tactics has quit IRC[21:05:27] <JLearn> aceofspades19: ...to get the *best* of both worlds, or so they say. :-)[21:05:33] <AMcBain> aceofspades19, gobs of time, and the fact that they may have already had a Java handler available.[21:05:42] <AMcBain> s/handler/container[21:05:44] <AMcBain> /[21:06:16] *** _graham_ has quit IRC[21:06:18] <ayrnieu> aceof, reimplementing php5 is part of the summoning-rite for a shoggoth[21:06:34] <aceofspades19> do I want to know whata shoggoth is?[21:08:00] <ojacobson> aceofspades19: Lovecraft[21:09:06] <nekrozion> ia ia![21:10:43] *** repnop has quit IRC[21:13:13] *** nmatrix9 has joined ##java[21:13:32] <r0bby> this is actually cute[21:15:00] *** EgyptianCleo has joined ##java[21:17:03] *** repnop has joined ##java[21:21:54] *** GhettoJava has quit IRC[21:22:52] *** GhettoJava has joined ##java[21:22:54] *** omaru has quit IRC[21:24:51] *** b0fh_ua has joined ##java[21:25:32] <b0fh_ua> ojacobson: hello! can you please remind me with the database version management tool? Liquidata or soemthing like this?[21:25:41] <ojacobson> ~liquibase[21:25:42] <javabot> ojacobson, liquibase is a database-agnostic tool for managing database metadata by providing revision control via XML files. See http://www.liquibase.org/[21:25:48] <b0fh_ua> cool[21:25:53] <b0fh_ua> thanks[21:26:30] *** UK-sHaDoW has joined ##java[21:26:40] *** UK-sHaDoW has left ##java[21:27:35] *** wonderwal has quit IRC[21:28:32] *** UK-sHaDoW has joined ##java[21:28:43] *** ScottG489 has quit IRC[21:29:15] *** UK-sHaDoW has left ##java[21:30:02] *** UK-sHaDoW has joined ##java[21:30:27] *** UK-sHaDoW has left ##java[21:31:07] *** eisenach has quit IRC[21:31:35] *** jkriesten has quit IRC[21:32:04] *** UK-sHaDoW has joined ##java[21:32:07] *** WillieJ has joined ##java[21:32:13] <WillieJ> Anyone knows a good java bot to start with?[21:32:17] <WillieJ> Java IRC bot*[21:33:00] *** surial has joined ##java[21:33:08] <aTypical> WillieJ, what's wrong with the one they use jere?[21:33:12] <aTypical> here[21:33:18] <WillieJ> I mean I want to make myself one >.,[21:33:27] <ojacobson> ~pircbot[21:33:27] <javabot> ojacobson, pircbot is a framework for creating Java IRC bots quickly. It was created by Jibbler, and can be found at http://www.jibble.org/pircbot.php[21:33:41] <ojacobson> ~source[21:33:42] <javabot> you can find my source at my project site http://kenai.com/projects/javabot[21:33:48] <WillieJ> :O[21:33:51] <AMcBain> ~jerklib[21:33:51] <javabot> AMcBain, jerklib is an event-driven RFC-1459 compliant IRC library which uses NIO. It can be found at http://jerklib.sourceforge.net -- see #jerklib for more info as well.[21:34:05] <WillieJ> ~help[21:34:05] <javabot> I guess the factoid 'help factoid retrieve' might be appropriate:[21:34:06] <javabot> To see (retrieve) a factoid, type ~key, e.g., ~cygwin.[21:34:08] <WillieJ> :P[21:34:17] <AMcBain> Use PMs if you want to "play" with the bot.[21:34:34] <WillieJ> Can I download the javabot source and use it myself?[21:34:39] <ojacobson> ~source[21:34:40] <javabot> you can find my source at my project site http://kenai.com/projects/javabot[21:34:50] *** The_Birdman has joined ##java[21:35:22] <AMcBain> WillieJ: given Javabot's complexity, you might be better off starting with your own bot and learning how things work, etc.[21:35:42] <WillieJ> k[21:35:48] <WillieJ> Well I have experience with java tho.[21:36:19] <WillieJ> But I think I start my own.[21:36:24] <WillieJ> With a clean PIRCBot.[21:36:30] <WillieJ> ~api[21:36:30] <javabot> WillieJ, api is http://java.sun.com/javase/current/docs/api/index.html[21:36:34] <WillieJ> ~api string[21:36:35] <javabot> I guess the factoid 'java compiler api' might be appropriate:[21:36:36] <javabot> WillieJ, compiler api is http://java.sun.com/javase/6/docs/technotes/guides/javac/index.html and http://tinyurl.com/46nrgp[21:36:47] <WillieJ> Anyone knows how javabot searches to the api?[21:36:49] <WillieJ> With a socket?[21:36:52] <WillieJ> Oh wait[21:36:56] <WillieJ> I look it up msyself[21:36:56] <WillieJ> =p[21:36:58] *** jkriesten has joined ##java[21:36:58] <AMcBain> WillieJ: that's not a PircBot feature.[21:37:20] <AMcBain> Javabot is a bot built in the PircBot framework. PircBot only helps you get on IRC plus a few other things.[21:37:29] <WillieJ> I know[21:37:32] <WillieJ> It uses socekts?[21:37:35] <WillieJ> Sockets*[21:37:53] <AMcBain> no other way (realistically)[21:38:07] <ojacobson> WillieJ: have a look at JavadocOperation in the javabot source[21:38:18] *** adi112358 has joined ##java[21:38:25] <ojacobson> It uses Hibernate, mainly, which means JDBC, which means (usually) sockets[21:38:31] <ojacobson> but not to the sun website.[21:38:36] <WillieJ> To a parser?[21:38:38] * AMcBain should get around to finishing his ScriptBot's Javadoc plugin.[21:38:50] *** staykov has quit IRC[21:38:52] *** eggy_ has joined ##java[21:39:11] *** adi112358 has quit IRC[21:39:21] <WillieJ> I am at the javadoc operation[21:39:23] <WillieJ> Lets give it a look[21:39:24] <WillieJ> :}[21:39:29] *** adi112358 has joined ##java[21:39:30] <cheeser> AMcBain: no other way? really?[21:39:36] <cheeser> gosh. i'm screwed![21:39:44] <eggy_> What could I provide for the generic thingy for a Class type? Should that be like, the metaclass or something? Like Class<Something>. but I don't know what I could use for Something[21:39:57] <AMcBain> well, I meant, that you wouldn't connect to IRC by scraping a page that outputs stuff from a channel, etc.[21:39:58] <ojacobson> ~~ eggy_ make sense[21:39:58] <javabot> eggy_, make: *** No rule to make target `sense'. Stop.[21:40:10] <WillieJ> Damn[21:40:12] <eggy_> heh[21:40:16] <WillieJ> The URL itself isnt in the javadoc file[21:40:24] <ojacobson> eggy_: it might help to consider that String.class is a Class<String>[21:40:56] <eggy_> ojacobson: ah ok. So "any class", would be Class<Object> ?[21:41:13] <WillieJ> TO bored to look through all classes =X[21:41:24] <ojacobson> Try it and see: does Class<Object> clazz = String.class; compile?[21:41:59] <eggy_> Hmm doesn't work[21:42:19] *** SilentAssassin has joined ##java[21:42:26] <ojacobson> If you want a reference that can point to any class, you probably want a Class<?> reference[21:42:30] <eggy_> ojacobson: so what do I need in case of "any class"?[21:42:40] <eggy_> ojacobson: ah ok, thanks[21:43:06] *** bas-i has joined ##java[21:43:15] <eggy_> Weird that 'List<Class<?>>' is invalid though[21:43:26] <eggy_> ooh, it isn't, never mind[21:43:36] <eggy_> The rhs was probably not compatible[21:43:59] <SilentAssassin> okey this is kinda stupid i have int nPaths=GridCreator.maxRoutes; , GridCreator.maxRoutes=3 (when i click the watch in debugger) and right after i do nPaths=GridCreator.maxRoutes ; i get that nPaths=1[21:44:04] <SilentAssassin> i dont get it[21:44:14] *** zmanning has joined ##java[21:45:52] <ojacobson> ~show us[21:45:52] <javabot> Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options.[21:45:54] <r0bby> teehee[21:45:59] <ojacobson> preferably a compilable example[21:46:57] *** b0fh_ua has quit IRC[21:47:39] <SilentAssassin> hmm i think i know what is the problem... the debugger was running with new build while the actual app was running with old[21:49:28] *** staykov has joined ##java[21:49:35] *** CSSipi has quit IRC[21:51:28] *** rollins has quit IRC[21:52:34] *** _stack has quit IRC[21:53:46] *** bitshuffler has quit IRC[22:00:48] *** M[]ssad has quit IRC[22:01:56] *** phenom_ has joined ##java[22:03:48] <phenom_> got a question: I have a webapplication deployed that does some application monitoring (it manages a bunch of applications and deployments and their status by using the weblogic API). Now I want to add some functionality whereby if an application returns a status of "failure" or "unknown" it sends an email. I have the email API done, but I'm wondering how this can be done ... the monitoring is not on-demand, but continuousl running in the background[22:03:52] <phenom_> how would I go about doing this ?[22:07:04] *** ScottG489 has joined ##java[22:07:16] <surial> phenom_: Uh.. if you're continuously monitoring, then, isn't it easy?[22:07:30] <surial> When an app goes failure/unknown... you send an email, and you maintain a list of emails sent out so you don't send a gazillion of them.[22:09:03] <phenom_> surial: but this is a web application, meaning when you navigate to the "applications" page, it uses the API to get the deployment status and pushes status into the database ... it's on-demand ... if no one goes to that page then the status isn't updated. I need a working daemon to always run to check status, process, sleep and redo[22:09:21] *** WillieJ has quit IRC[22:09:26] <surial> so its the opposite of continuous monitoring, then.[22:09:38] <surial> oh, you *WANT* continuous monitoring.[22:09:42] <phenom_> yes[22:09:43] <surial> Your question was strangely worded.[22:10:02] <surial> Yes, for some reason most web frameworks do not have an internal facility for registering services.[22:10:13] <surial> Your easiest bet is probably to just fire up a thread on your servlet's init.[22:10:22] <surial> which checks every X minutes.[22:10:58] <phenom_> hmmm, how would that work with struts[22:13:53] <nDuff> phenom_, have you considered integrating into a preexisting system monitoring framework?[22:13:58] <phenom_> surial: Ah, I think the PluginIn interface in struts should do[22:14:07] *** amz has quit IRC[22:14:27] <phenom_> nDuff, like ? i need to monitor more than just weblogic apps tho[22:15:56] *** joeo has joined ##java[22:16:16] <nDuff> phenom_, Nagios and Big Brother are two, but there's a huge range of software in that space, ranging up to ultra-expensive enterprise tools like OpenView and Tivoli.[22:16:58] <nDuff> phenom_, something you roll your own is likely not going to be as complete or refined as using a stable, mature 3rd-party tool.[22:17:52] *** fgmmgf has quit IRC[22:18:41] <AMcBain> nDuff: that about summarizes a *lot* of things :)[22:19:23] <nDuff> phenom_, ...with regard to using Nagios to monitor data retrieved by JMX, see http://www.agilejava.com/blog/?p=149[22:19:44] *** UK-sHaDoW has quit IRC[22:20:01] *** UK-sHaDoW has joined ##java[22:21:59] *** M25_ has joined ##java[22:22:00] *** JLearn has quit IRC[22:22:10] <phenom_> nDuff, can Nagios monitor any type of application?[22:22:33] <phenom_> coldfusion, daemons, databases, weblogic deployments ?[22:22:41] <nDuff> phenom_, it accepts passive checks in textual form, so if you write a monitor that outputs the right text format, Nagios will work with it.[22:22:59] <nDuff> phenom_, ...that said, there are a great many things it already comes with plugins / checks for out-of-the-box.[22:23:00] <M25_> alight, I'm using HTMLEditorKit to dynamically add tags (on command) to a HTMLDocument in a JEditorPane... how do I remove those tags, on a separate command?[22:23:50] <nDuff> phenom_, see http://www.nagios.org/ for more info; it's a somewhat offtopic discussion in ##java.[22:25:45] *** SilentAssassin has quit IRC[22:25:58] <The_Birdman> M25_: How do you add them in the first place?[22:26:30] <M25_> by making a HTMLEditorKit.InsertHTMLTextAction and running actionPerformed() on it[22:27:16] <M25_> I've tried everything to be able to remove those tags, I can't even use a regex because I can't get the cursor/selection position in the underlying HTML, only the unformatted text[22:29:11] *** Canastro has joined ##java[22:30:00] *** Junior has quit IRC[22:31:23] <M25_> out of curiosity, when's peak traffic times for this room?[22:31:24] *** tom17bombadil has quit IRC[22:31:44] *** tom17bombadil has joined ##java[22:32:30] <ernimril> M25_: "room"? this is irc, irc has channels, if you want rooms go to webchats or other silly places. There are typically a lot of people idling, ask an interesting question and you will find out that there are people around[22:33:00] <M25_> I know, sorry, wrong term.[22:34:04] <cheeser> ojacobson: i just can't figure why the slow down...[22:34:06] <cheeser> sucks[22:34:24] <cheeser> at 5s/class that's gonna take forever[22:34:39] <ernimril> cheeser: what is slowed down?[22:34:45] *** Canastro has left ##java[22:34:51] <ojacobson> cheeser: profiler?[22:34:51] <AMcBain> I don't think anyone has recorded "peak" times here, but it would be interesting to know ... though there are at least several people here during the "night hours" (US-time), and many more during the day.[22:34:55] <cheeser> ernimril: the javadoc parsing in the new code[22:35:11] <cheeser> ojacobson: well, i have debug in there and i see stuff scream by and then it pauses...[22:35:15] <ernimril> cheeser: ok, I have never looked at it..[22:35:17] <M25_> 5 seconds per class for just javadoc?[22:35:18] <cheeser> i wonder if i'm hammering GC ...[22:35:26] <cheeser> M25_: well, i'm parsing html[22:35:47] <ernimril> cheeser: you never run the bot with a profiler? (I know that I run my pet projects with profilers attached all the time)[22:35:50] <cheeser> i should try with a local copy of the html and see[22:35:55] <cheeser> ernimril: i have not[22:36:03] <cheeser> i should fire up netbeans and try that.[22:36:11] *** ScottG489 has quit IRC[22:36:28] *** bindaas has quit IRC[22:36:37] <ernimril> cheeser: I normally only do memory profiling and that means for me unmeasurable slowdown[22:37:25] <cheeser> well, if i'm battering the heap it probably wouldn't hurt to clean that up...[22:37:35] <M25_> better way to phrase my question: anyone know how to remove HTML tags (in order to do stuff like un-bullet selected text) in a JEditorPane?[22:37:45] *** level1 has joined ##java[22:38:41] <level1> Hi, I'm trynig to use ServerSockets. When I accept(), I get an error saying that the port is already in use. I've tried about 5 or 6 ports[22:38:51] <level1> is there a way to know which ports are available?[22:39:32] <ernimril> level1: nmap or netstat can tell you what ports are in use[22:39:59] <AMcBain> level1: usually higher port numbers are available, you can try there first. I usually test with 8000+ numbers.[22:40:23] <AMcBain> If you have a webservers (by contrast) usually have a default port of 80.[22:40:34] <AMcBain> s/if you have a//[22:40:43] <ernimril> level1: on unix and linux systems you can not open ports < 1024 without root priviligies[22:40:46] <nDuff> level1, on Linux, netstat --listen --tcp will tell you which ports are already in use. That said, anything below 1024 is reserved, and can't be opened by unprivileged apps[22:41:01] * nDuff curses ernimril's faster typing speed. :)[22:41:16] <level1> thanks[22:41:21] <AMcBain> ah, well, the overwealth of help is probably appreciated :)[22:41:36] <ernimril> just a lot of echoes[22:41:52] *** popcornPanic has joined ##java[22:41:52] <tazle> M25_: http://spreadsheets.google.com/pub?key=pe0F68RRZDAeVtlPTFh3XHg&oid=1&output=image[22:42:15] <level1> I happen to be on windows right now. according to netstat, port 80 isn't in use but that didn't work. It would be nice if I could get access to that port[22:42:51] <level1> anways, port 12222 seems to work for now... I'll worry about little things later[22:42:56] <AMcBain> level1: why? if you're doing your own testing/project it might be better to use a different one, as lots of bad programs might try to find a webserver there first.[22:42:57] <ernimril> level1: personal firewalls may also interfere (but I do not use any such things so not sure, but most windows users seems to run such things)[22:43:00] <AMcBain> (webserver or program)[22:43:04] *** elementz has joined ##java[22:43:04] <M25_> tazle: thanks[22:44:17] <level1> ernimril, I want to use a firewall, but it seems to interfere with ever peice of game-related software I've ever tried (warhammer, vent, blizzard downloader...) If I wanted to have an OS that didn't play games I'd just use linux[22:44:51] <AMcBain> level1: you can always tell Firewalls that certain programs are to be "trusted" ...[22:44:58] <AMcBain> better than not having one[22:45:36] <popcornPanic> i have a file with a bunch of names. i want to create an arraylist for each name. in the file there is about four lines of whitespace separating each name. is that going to cause the actual name of the arraylists to be longer too?[22:45:41] <level1> AMcBain, the firewalls trust programs and still block them[22:45:52] <AMcBain> level1: not Comodo :)[22:46:18] <M25_> level1: you can allow exceptions, also just use a hardware one, works for me and you can tell exactly which ports to open/close. they're like 20 bucks, and most routers include them enyway[22:46:29] <level1> popcornPanic, of course. Whitespace is still a valid String[22:46:41] <tazle> M25_: maybe this is better: http://spreadsheets.google.com/pub?key=pe0F68RRZDAeVtlPTFh3XHg&oid=2&output=image[22:46:46] <AMcBain> popcornPanic: if you read in the file directly to the ArrayList, sure, otherwise you can add in checks to prevent those from appearing in your list.[22:46:47] <level1> M25_, my router's firewall is even more obstructive[22:47:27] *** monestri has quit IRC[22:47:27] <M25_> tazle: I get the idea, some channels tend to be nocturnal, others diurnal, wanted to know which this one was[22:47:37] <M25_> level1: have you configured it?[22:47:42] *** eidolon has joined ##java[22:47:47] *** monestri has joined ##java[22:48:00] *** monestri has quit IRC[22:48:11] *** monestri has joined ##java[22:48:16] <popcornPanic> AMcBain: i tried using trim() but it still leaves whitespace below and above the strings. is there another whitespace removal method i can use?[22:48:31] <M25_> string.split("\n")[22:48:35] *** monestri has quit IRC[22:48:39] <M25_> then discard the empty ones[22:48:45] *** monestri has joined ##java[22:48:58] <tazle> M25_: the peak in knowledgeable answers is usually during european afternoon/evening, and the peak in silly questions in amrican afternoon/evening :P[22:48:58] <AMcBain> popcornPanic: I'm assuming you are reading in this file by line? just add an if statement to your loop and don't keep ones that have a value of trim(line).equals("")[22:49:15] <AMcBain> line.trim().equals("") *[22:49:17] <AMcBain> (oops :P)[22:49:31] <M25_> tazle: ha[22:49:38] * AMcBain was thinking of JS, doesn't have a trim function :-/[22:50:18] *** magentar has quit IRC[22:51:37] *** ernimril has quit IRC[22:52:45] <popcornPanic> AMcBain: yes that worked. Thankyou![22:52:52] <AMcBain> np.[22:53:00] *** popcornPanic has quit IRC[22:53:51] *** ScottG489 has joined ##java[22:54:02] *** seyfarth has quit IRC[22:54:45] *** _graham_ has joined ##java[22:56:22] *** Inhuman has joined ##java[23:01:47] <skypce> how can i set a ResultSet variable to empty?[23:02:04] *** Fusion89k has joined ##java[23:02:59] <woogley> skypce: you mean without setting it to null?[23:03:00] *** Fusion89k has left ##java[23:03:20] <woogley> i guess you could call last(), then hasRow() would return false[23:03:45] <woogley> er, next()[23:03:55] <skypce> thanks woogley[23:04:33] <woogley> np, and actually the method you probably want is afterLast()[23:06:59] <skypce> it is becouse when i press more than one time the view button in my table follow add data without end. i think that best option is reset the var to 0 or empty for it[23:07:56] *** T-Hawk has joined ##java[23:09:34] <T-Hawk> hey ppl, i have a problem with validating an XML file using JDOM, SAXBuilder and Xerces... The code i'm using for reading the XML is here: http://pastie.org/376231 and i know the XML file is valid, but i still get the exception: Error on line 3 of document file:/etc/simpleserver/config.xml: cvc-elt.1: Cannot find the declaration of element 'simpleserver'.[23:09:36] <T-Hawk> any ideas?[23:10:47] <tazle> T-Hawk: and where's the XML?[23:12:00] <T-Hawk> tazle, here: http://pastie.org/376233 but i know it validates against the schema[23:12:43] *** riotz has quit IRC[23:13:36] *** pstickne has quit IRC[23:13:44] *** davo has joined ##java[23:14:14] *** eidolon has left ##java[23:15:15] *** eggy_ has left ##java[23:16:07] <T-Hawk> any ideas?[23:16:17] *** KnK0 has quit IRC[23:17:44] *** meanburrito920_ has joined ##java[23:19:58] <ojacobson> Have you considered using xsi:schemaLocation instead of telling the parser where to find the schema?[23:20:24] <M25_> ok, if I have 2 arrays of different length but of the same type, and I want to put their items in another array that's the sum of their sizes, with array1's items first, then array2's items, what's the most efficient way to do this?[23:20:26] <T-Hawk> ojacobson, i tried that too, same error :([23:20:31] *** IppatsuMan has joined ##java[23:20:45] <T-Hawk> and according to xmllint the xml validates against the schema[23:24:16] *** cmccormick has quit IRC[23:24:33] <ojacobson> T-Hawk: your value for external-schemaLocation looks wrong now that i've read the xerces docs[23:25:06] <T-Hawk> ojacobson, oh? it's the URL for the schema file?[23:25:13] <ojacobson> T-Hawk: no, it's not.[23:25:19] <ojacobson> http://xerces.apache.org/xerces2-j/properties.html[23:25:49] <ojacobson> It has the same syntax as {http://www.w3.org/2001/XMLSchema-instance}schemaLocation attributes do[23:25:58] *** jcp has joined ##java[23:26:06] *** ernimril has joined ##java[23:26:08] <ojacobson> eg. "namespace-uri document-uri" pairs[23:27:01] <T-Hawk> ojacobson, well if i try with "http://simpleserver.t-hawk.com SimpleServer.xsd" it still doesn't do any difference[23:27:16] <ojacobson> Have you asked the Xerces people if they have any idea? It's their parser you're using...[23:27:30] *** elementz has quit IRC[23:27:56] *** joeo has quit IRC[23:28:30] <tazle> T-Hawk: SimpleServer.xsd is rather relative URI - do you have any idea what xerces would resolve it against?[23:28:42] <tazle> T-Hawk: and did you try with an absolute URI?[23:29:32] <tazle> T-Hawk: (an absolute URI seemed to work, as did xsi:schemaLocation with absolute URI in the XML)[23:29:35] <T-Hawk> ojacobson, no i haven't[23:30:03] <T-Hawk> tazle, i already tried with "http://simpleserver.t-hawk.com/SimpleServer.xsd" as the schemaLocation both in the XML and in the parser[23:30:25] <T-Hawk> can't see how i get it more absolute than that when it's supposed to validate against an online resource[23:30:54] <tazle> T-Hawk: and is that a valied schemaLocation value according to the definition ojacobson gave?[23:32:15] *** noobraska has joined ##java[23:33:46] <T-Hawk> tazle, THANK YOU... you too ojacobson[23:34:02] <T-Hawk> seems it's http://simpleserver.t-hawk.com http://simpleserver.t-hawk.com/SimpleServer.xsd, since it's in "namespace URI" format[23:34:16] <T-Hawk> now i get nullPointerExceptions instead, but that i can fix :P[23:35:07] * ojacobson tips hat.[23:37:14] *** cads has joined ##java[23:37:27] <ScottG489> T-Hawk: I cant wait until I can fix nullPointerExceptions![23:38:27] <T-Hawk> ScottG489, it's not like i meant in general[23:38:58] <ScottG489> Oh :)[23:39:35] <M25_> nullpointer exceptions usually just mean "you forgot an initializer"[23:39:47] <M25_> s/initializer/constructor/[23:40:39] *** CrypticSquared has joined ##java[23:40:54] *** Wicked has quit IRC[23:43:20] *** bas-i has quit IRC[23:43:37] <T-Hawk> WTF[23:44:01] <T-Hawk> in this code: Element root = cMod.getRootElement();[23:44:02] <T-Hawk> Element config = root.getChild("config");, why on earth would config == null?[23:44:41] *** gdoko has joined ##java[23:44:51] *** durka42 has joined ##java[23:45:24] <M25_> there's no child object that corresponds to config?[23:45:42] <M25_> check the Element.getChild() source, see where a null can get in?[23:45:44] <T-Hawk> well there is, the XML is http://pastie.org/376233[23:46:30] *** blankthemuffin has quit IRC[23:47:06] *** Copter has quit IRC[23:47:27] <M25_> T-Hawk: which Element are you using? there's quite a few[23:47:50] <T-Hawk> in org.jdom[23:48:19] *** Wicked has joined ##java[23:49:17] <M25_> sorry, can't help you there, I was thinking about javax.swing.text's one[23:49:46] *** repnop has quit IRC[23:50:15] <cheeser> T-Hawk: clearly you don't have what you think you do.[23:51:01] <T-Hawk> cheeser, clearly, strange thing is, if i run through the children of the root element with an iterator there's excactly one... <config>[23:51:13] *** riotz has joined ##java[23:51:14] *** x77686d has quit IRC[23:51:21] *** x77686d has joined ##java[23:52:39] <ojacobson> T-Hawk: does getChild take a local name or a full name?[23:52:46] <ojacobson> The full name of the <config> element is not "config"... :)[23:53:12] <T-Hawk> hmm, it would take the ns too?[23:53:21] *** spacepup has joined ##java[23:53:34] <M25_> ok, if I have 2 arrays of different length but of the same type, and I want to concatenate them both into a 3rd, empty array, what's the most efficient way to do this?[23:53:40] <T-Hawk> so basically element.getChild(child1.getName()); whe child1 is a child of element won't return the same child[23:53:54] *** blankthemuffin has joined ##java[23:54:01] <ojacobson> T-Hawk: you'd have to read the docs[23:54:09] <T-Hawk> fair enough[23:54:13] <ojacobson> If it says that getChild accepts a local name, then "config" is what you want[23:55:21] *** Xianny has quit IRC[23:55:27] <ojacobson> (From the XML Namespaces rec, the name of a namespaced element is {ns-url}local-name[23:55:38] <ojacobson> you are in a maze of twisty little standards, all different[23:55:53] *** torarne has quit IRC[23:55:57] <ojacobson> Also, have you considered not hand-rolling your parser? There are lots of xml-to-object binding tools around that handle this correctly.[23:57:19] <T-Hawk> ojacobson, that's why i was using JDOM really, and it seems to get the right one if i pass root.getNamespace() to the getChild method[23:58:34] *** svendbent has joined ##java[23:59:11] *** hrehf has joined ##java