Switch to DuckDuckGo Search
   March 10, 2011  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | >


NOTICE: This channel is no longer actively logged.

Toggle Join/Part | bottom
[00:00:05] <Polah> So that frees up memory as things are no longer needed?
[00:00:27] <freeone3000> Sortakinda.
[00:00:29] <freeone3000> ~garbage collection
[00:00:29] <javabot> freeone3000, garbage collection is http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html and http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-lnxw07JavaUrbanLegends
[00:00:58] <Planck_> If you don't know why you need incgc, you don't.
[00:01:42] *** Tashtego has quit IRC
[00:01:48] <freeone3000> It seems like that's been supplanted by the modern model, anyhow.
[00:02:39] <pgib> Hmm. I'm going to find the Jersey mailing-list and ask those dudes
[00:05:18] <lf94> jai-jre/jdk.bins are broken and wont install
[00:05:28] <gener1c> is there a way to use switch with string?
[00:05:40] <_W_> gener1c, use Java 7 :p
[00:05:50] <_W_> otherwise, no
[00:05:59] <_W_> (you can use a Map of course)
[00:06:09] <gener1c> lol
[00:06:17] <gener1c> whats that?
[00:06:23] <_W_> ~javadoc Map
[00:06:23] <javabot> _W_: http://is.gd/iNT0X [JDK: java.util.Map]
[00:06:29] <_W_> ~collections
[00:06:29] <javabot> The Collections API is available at http://java.sun.com/javase/6/docs/technotes/guides/collections/index.html
[00:06:43] <gener1c> oh like a hash
[00:06:59] <_W_> yes, except a map doesn't have to be a hash table
[00:07:08] *** Behold has quit IRC
[00:07:09] <_W_> it could, for instance, be a tree instead
[00:07:22] <gener1c> yeah i am making a tree right now lol
[00:07:27] <lf94> Hey, how do I manually install a jar file?
[00:07:35] <cheeser> ~~ lf94 classpath
[00:07:36] <javabot> lf94, The classpath tells Java or the compiler in which jar files and folders to look for classes and resources. Use the -cp/-classpath run-time options to specify the classpath (does NOT work with -jar!). Also see http://is.gd/j4gM [sun.com] for more info. If you're on windows see: http://is.gd/9qq26 [sun.com].
[00:07:38] <lf94> (Arch Linux)
[00:07:44] <gener1c> archlinux is sexy
[00:07:45] *** ramenmeal has joined ##java
[00:07:46] <_W_> Map just specifies the interface, what methods to provide for mapping one thing to another
[00:08:08] <lf94> How do I see where the classpath is defaultly pointed to
[00:08:19] <cheeser> echo $CLASSPATH
[00:08:24] <gener1c> i just need to read a word from scanner and match it with a method
[00:08:26] <cheeser> learn linux. try ##linux
[00:08:26] <gener1c> :P
[00:08:35] *** ramenmeal has quit IRC
[00:08:37] <lf94> cheeser, nothing came up.
[00:08:46] <lf94> Because I have tried that already 5 minutes ago
[00:09:02] *** eyesUnclouded has quit IRC
[00:09:28] <cheeser> then you don't have one defined obviously
[00:09:55] <cheeser> ~food
[00:09:55] <javabot> 10 poke cheeser, 0x5a1ad
[00:09:56] <Planck_> So by default, it's just the current directory (".")
[00:09:57] *** supercosmonaut has joined ##java
[00:10:06] <gpeterso> I'm trying to use java.awt.font.LineBreakMeasurer. I set the font on my Graphics2D, then make a new LineBreakMeasurer(styledText, g2d.getFontRenderContext()), but it doesn't take the font from my g2d and I don't see where I can set it. Help?!
[00:10:17] <lf94> cheeser well importing standard java classes works
[00:10:21] <lf94> so it probably is working
[00:10:29] <lf94> and is defined somewhere
[00:10:46] <cheeser> of course the JRE classes are visible
[00:10:55] <lf94> Where are they located
[00:10:58] *** coldpizza72i has quit IRC
[00:11:01] <cheeser> *your* stuff needs to be on the classpath.
[00:11:01] *** gkmngrgn has quit IRC
[00:11:10] <cheeser> they're located with the JVM bits of course
[00:11:13] *** cythrawll has joined ##java
[00:11:24] <lf94> JAI is apart of Java, Im trying to manually install this sucker :\
[00:11:32] <cheeser> no, it's not.
[00:11:33] <lf94> What
[00:11:37] <lf94> <_>
[00:11:39] <lf94> ok
[00:11:45] <cheeser> i'm off to eat.
[00:11:49] <lf94> Ok thanks
[00:13:03] *** Migi32 has quit IRC
[00:13:49] <gener1c> ok .. how do i turn a string to an int?
[00:13:57] <freeone3000> gpeterso: It's from the AttributedCharacterIterator.
[00:14:06] <gener1c> say i have "111"
[00:14:10] *** cool123 has joined ##java
[00:14:14] <gener1c> in ruby i could use .to_i
[00:14:33] <freeone3000> ~javadoc Integer.parseInt(*)
[00:14:33] <javabot> freeone3000: null [JDK: java.lang.Integer.parseInt(String)]; http://is.gd/04xBBn [JDK: java.lang.Integer.parseInt(String,int)]
[00:14:44] <gener1c> 10x
[00:14:47] *** jdolan has quit IRC
[00:14:51] *** ninja_sense has quit IRC
[00:15:10] *** Luc1fel has joined ##java
[00:15:23] <Planck_> Heh, a "null" result from javabot?
[00:15:26] <gener1c> freeone3000: you are awesome
[00:16:37] <pgib> ojacobson, I did agree with you on XSD -> Java being better than the other way around. But.. I don't think I have a week to spend learning XSD and trying to figure out how to model my data with it ;)
[00:17:09] <gpeterso> freeone3000: There's no setFont, nor is there one on AttributedString. Am I supposed to set an attribute? If so, which one? Is it called "Font" or "font" or ???. I didn't see anything in the API docs.
[00:17:53] <freeone3000> gpeterso: Generally one uses TextLayout for this sort of thing. The parameters are nicer.
[00:18:00] *** IamTrying has joined ##java
[00:18:49] <IamTrying> Dear Java OPs, is there any way to see few weeks back my logs in this channel? I had one very important web link, and i dont find it, but i remember i discussed with someone.. :-(
[00:19:04] <freeone3000> ~logs
[00:19:04] <javabot> channel logs can be found at http://www.antwerkz.com/javabot-grails (Select the channel from the list on the left-hand side.)
[00:19:07] <svm_invictvs> IamTrying: The logs are online, dude
[00:19:21] <IamTrying> many thanks !! freeone3000 , svm_invictvs
[00:19:24] *** vipaca has quit IRC
[00:19:36] *** drindt has quit IRC
[00:19:54] <tjsnell> ~next
[00:19:54] <javabot> Another satisfied customer. Next!
[00:20:20] <freeone3000> gpeterso: To answer your actual questions: Yes, TextAttribute.FONT, and there isn't, in that order.
[00:20:30] <IamTrying> freeone3000, it says Service Temporarily Unavailable
[00:20:40] <freeone3000> Gee, maybe the service is temporarily unavailable.
[00:20:47] <tjsnell> IamTrying: it's not a rails app
[00:20:52] <tjsnell> sometimes it's down
[00:21:35] <gpeterso> freeone3000: I've got one of them too, but I get it from my LineBreakMeasurer: TextLayout layout = measurer.nextLayout(width); I'm following this: http://download.oracle.com/javase/6/docs/api/java/awt/font/LineBreakMeasurer.html
[00:21:35] <svm_invictvs> What does rails have to do with i?
[00:21:36] <svm_invictvs> **it
[00:22:04] *** whaley has quit IRC
[00:22:25] *** aksn has quit IRC
[00:22:25] <gpeterso> freeone3000: I see there is other (simpler) sample code in TextLayout. I'll try that and be back in a few.
[00:22:54] *** BeholdMyGlory has joined ##java
[00:23:13] *** svm_invictvs is now known as slerp_lerp
[00:23:16] *** terranova has quit IRC
[00:23:31] *** Cymage has quit IRC
[00:23:45] *** terranova has joined ##java
[00:24:37] *** slerp_lerp is now known as svm_invictvs
[00:25:44] *** FrozenKnight has quit IRC
[00:26:34] *** barq has quit IRC
[00:27:43] <gpeterso> freeone3000: you f-ing ROCK! That worked. Thank you!
[00:28:18] *** EvilPenguin has quit IRC
[00:30:53] *** rgr has quit IRC
[00:32:36] *** cyphorious has quit IRC
[00:32:47] *** Nikelandjelo has quit IRC
[00:33:06] *** adamisme has quit IRC
[00:33:16] *** daark has quit IRC
[00:35:27] *** pinebaron has joined ##java
[00:36:09] *** IamTrying has quit IRC
[00:36:48] *** pipeep has quit IRC
[00:37:44] *** jesmon has quit IRC
[00:38:53] *** terranova has quit IRC
[00:39:04] *** Cymage has joined ##java
[00:40:28] *** Phil has quit IRC
[00:40:33] <gpeterso> freeone3000: I need the text to break lines, so I ended up sticking with LineBreakMeasurer and setting the attribute. I have it working now with multiple lines, thanks to you.
[00:40:37] *** pipeep has joined ##java
[00:40:57] *** Versuchen has quit IRC
[00:41:03] *** caverdude has joined ##java
[00:41:15] *** Phil has joined ##java
[00:41:50] *** cime has quit IRC
[00:42:16] *** pinebaron has left ##java
[00:43:26] *** Luc1fel has quit IRC
[00:44:29] *** sebersole has quit IRC
[00:50:22] *** L-----D has joined ##java
[00:56:42] *** Ramen has quit IRC
[00:57:30] *** fisted_ has joined ##java
[00:57:55] *** btfx has joined ##java
[00:59:03] *** tewecske has quit IRC
[00:59:22] *** fisted has quit IRC
[01:00:51] <btfx> Hey guys, I did java in high school but decided to revisit it just for a taste. Can someone explain to me what's wrong with a line like: ``someHashMapObjectWithArrayListsAsValues.get(someKey).add(someString);``
[01:01:15] <btfx> I'm getting a "cannot find symbol" on the ".add"
[01:02:02] *** gtrak has quit IRC
[01:02:14] <btfx> Perhaps I'm assuming something untrue about the syntax, but shouldn't ``someHashMapObjectWithArrayListsAsValues.get(someKey)`` be an ArrayList Object with a ".add" method?
[01:02:46] <freeone3000> Depends. What's the declared type of that reference?
[01:03:03] *** klaas has joined ##java
[01:03:23] *** sebersole has joined ##java
[01:03:23] *** rohan233 has joined ##java
[01:04:09] *** Chetic has joined ##java
[01:04:22] <freeone3000> To put it more simply: At some point in your code, you have "X someHashMapObjectWithArrayListsAsValues;". What's X?
[01:04:41] *** Omen_20 has joined ##java
[01:05:37] <btfx> That line was : ``HashMap someHashMapObjectWithArrayListsAsValues = new HashMap();``
[01:05:38] <Omen_20> I'm looking at job listings online. I graduate in May. Everyone wants 5+ years of experience. Where exactly are you expected to get the first 4? Internships look really rare.
[01:05:51] <freeone3000> btfx: Nope. Generics.
[01:06:21] <freeone3000> btfx: Uh. Or rather, you need to use generics there. Probably something like HashMap<KeyTypeGoesHere, ArrayList<ArrayListValueTypeGoesHere>>. For the full tutorial:
[01:06:26] <freeone3000> ~~ btfx generics
[01:06:26] <javabot> btfx, For a tutorial on generics, please see http://javachannel.net/wiki/pmwiki.php/Main/Generics
[01:06:41] <btfx> Omen_20: Want to know how I _honestly_ got my internship that I'm in now?
[01:06:53] *** robbyoconnor has joined ##java
[01:07:05] <Omen_20> sure
[01:07:12] <btfx> My mom.
[01:07:39] *** jbender has left ##java
[01:08:05] <btfx> No joke - she would sometimes mention me and my major/ability to her clients, and one of them worked at RedHat, so... =)
[01:08:22] <freeone3000> Omen_20: Your school can help with career placement. Failing that, there's a lot of ways you can demonstrate your skills - contributing to an open source project, open-sourcing one of the projects you've been working on, and so on. If it's publically hosted and they can see you don't suck, it goes a long way towards proving technical competency.
[01:08:30] *** gratz|home has quit IRC
[01:08:35] <btfx> My point is, networking isn't BS (as opposed to LinkedIn which very well might be) or ask around.
[01:08:53] *** caverdude has quit IRC
[01:08:56] *** White_Cat has quit IRC
[01:08:58] *** Polah has left ##java
[01:09:15] <Omen_20> lol. I live in a small college town. Theres really nothing here so I have to move, and I'm not finding anything online that's even close to reality. The recession must have layed off a lot of experienced people.
[01:09:55] <btfx> Omen_20: If you can appear to be a good programmer, places will want you.
[01:10:00] *** cbeust has quit IRC
[01:10:23] <btfx> Being a good programmer helps, but does not translate to appearing as one.
[01:10:29] <Omen_20> I plan on doing more projects this summer, and I'm building my own site to show the stuff off. I just wish I could be making money even in a really low position that still relates to programming.
[01:11:33] <btfx> Omen_20: Invest the $10/year for a domain, you instantly look cooler than 85% of the people who are doing the same thing.
[01:11:48] *** pipeep has quit IRC
[01:11:54] <btfx> And when you're making at least four times that much each hour, you'll be glad you did.
[01:12:51] <Omen_20> Yeah I'm about to get the domain set up. I'm making a SquareSpace site.
[01:13:33] <Omen_20> 40/hr ? I'd be glad to make anything over 15.
[01:13:43] <Chetic> I have a JTable linked to a TableModel containing Dates. How do I change the format the Dates are displayed in?
[01:14:40] *** White_Cat has joined ##java
[01:14:55] *** t0rc has joined ##java
[01:15:11] *** jdolan has joined ##java
[01:15:55] *** Fuco has quit IRC
[01:15:56] <btfx> Omen_20: From what I've gathered in this recession companies (especially software) have cut the people who do half the work for half the pay first, so even though unemployment rises, salaries do too.
[01:15:57] <Omen_20> So for someone coming out of college, what would be a safe bet for a starting salary?
[01:16:35] <btfx> Omen_20: I'm an intern and have no degree and I'm making close to $20, effectively $15 post-taxes.
[01:16:57] <btfx> People around me make... well I can't say for sure, but I can tell you it's more than twice as much as I do.
[01:17:19] *** c_axis has joined ##java
[01:17:28] *** Johannes13 has quit IRC
[01:17:31] <l_r> what is the way to add a jar to an existing war?
[01:18:11] *** rgr has joined ##java
[01:20:19] <btfx> Omen_20: If someone's not working hard enough to make you want to give them 75K, they're not really worth keeping.
[01:20:30] *** cholland has quit IRC
[01:20:47] *** Guyman has quit IRC
[01:20:48] <Omen_20> hopefully i can replace someone lazy :P
[01:21:27] <btfx> Omen_20: Last piece of advice before I have to go: resume spamming doesn't work, pestering HR people up to but not including the point of annoyance does.
[01:21:33] *** CppIsWeird has joined ##java
[01:22:15] *** ramenmeal has joined ##java
[01:22:24] <Omen_20> btfx: thanks
[01:22:28] <btfx> =)
[01:25:16] *** DerHorst has quit IRC
[01:25:26] *** A1ex1 has joined ##java
[01:25:41] *** A1ex1 has quit IRC
[01:25:56] <l_r> do you have any idea?
[01:27:41] *** gverig has joined ##java
[01:27:44] *** gverig has left ##java
[01:28:22] <cheeser> ~~ l_r ~tool docs
[01:28:22] <javabot> l_r, The user tool is not on ##java
[01:28:32] * cheeser sighs
[01:28:46] <cheeser> ~tool docs
[01:28:46] <javabot> cheeser, tooldocs is http://download.oracle.com/javase/6/docs/technotes/tools/index.html
[01:28:49] *** pgib has quit IRC
[01:28:49] <cheeser> there!
[01:28:51] <cheeser> read that.
[01:28:52] <l_r> thx
[01:28:58] <cheeser> a war i just a jar is just a zip
[01:29:21] <btfx> This is a bit more confusing now, .... wait... nevermind! Solved my own question!
[01:29:23] <l_r> cheeser, both war and jar are zips?
[01:30:24] *** lolsuper_ has joined ##java
[01:30:42] <cheeser> yes
[01:32:10] *** jpk has quit IRC
[01:33:01] *** arborist has quit IRC
[01:33:35] *** camcorder has joined ##java
[01:33:35] <btfx> Hey guys! Thanks a lot for that help! I was just porting this Python script : http://ideone.com/xIfKP to java : http://ideone.com/TIdaU - They work identically now. I was curious if I could do something of that scale without a "real" editor and compiler (in a small number of debugs) and thanks to you guys I did! Woot!
[01:33:36] <camcorder> hi
[01:33:40] *** cbeust has joined ##java
[01:34:04] <camcorder> I got a class inside another class. How can I access to that class nested in my class
[01:34:16] <cheeser> ~nested classes
[01:34:16] <javabot> nested classes are classes that are members of other classes. They come in two flavors - "static nested classes" and "inner classes". The latter requires a reference to the outer class to work. See http://is.gd/kaM0 [sun.com] for more info.
[01:34:33] *** ramenmeal has quit IRC
[01:34:43] <camcorder> I mean I got something like this: class Foo { public class Bar { int a; } }; And what I want to do is something like this Foo.Bar test = new Foo.Bar();
[01:34:48] *** ramenmeal has joined ##java
[01:35:17] *** ramenmeal has quit IRC
[01:36:00] <camcorder> cheeser, thanks
[01:36:05] *** zatan has quit IRC
[01:37:39] *** pipeep has joined ##java
[01:39:28] <TR2N> Java seems to be pervasive these days -> http://imgur.com/4kQAz
[01:40:33] *** magn3ts has quit IRC
[01:41:26] *** cool123 has quit IRC
[01:42:00] *** cool123 has joined ##java
[01:42:28] <Chetic> I have a JTable linked to a DefaultTableModel which contains Dates. How do I change the format the Dates are displayed in?
[01:43:00] *** freeone3000 has quit IRC
[01:44:09] *** shaunren has quit IRC
[01:44:49] *** eyesUnclouded has joined ##java
[01:47:11] <cocoloa> exit
[01:47:13] *** cocoloa has quit IRC
[01:48:10] *** glcrazy has quit IRC
[01:50:36] *** Fisiu has quit IRC
[01:54:35] *** wolfman2000 has joined ##java
[01:58:18] *** MikeJansen has left ##java
[01:58:24] *** TR2N has quit IRC
[01:58:29] *** DJClean has quit IRC
[02:00:48] *** lighta has joined ##java
[02:00:52] *** mapreduce has quit IRC
[02:04:49] *** taitale has quit IRC
[02:06:05] <lighta> hi guys, I'm working on a project about google map, trying to read exemple but I've got lot of import pointing to an internet adresse (e.g import com.google.gdata.client.analytics.AnalyticsService;) how can I solve that ?, using eclipse 3.5.2
[02:08:07] <gpeterso> How does Java find fonts installed on your system? Or maybe I mean to ask, where does it look? Specifically on RHEL4 and Ubuntu 10.10. I have text rendering working for most Unicode characters on my Ubuntu desktop, but I just get empty boxes for non-Latin characters on the RHEL4 server (with X-Windows removed)
[02:13:01] *** Sliker has quit IRC
[02:16:22] *** rohan233 has quit IRC
[02:17:01] *** VJTachyon has quit IRC
[02:17:49] *** jesmon has joined ##java
[02:19:13] *** bolt has quit IRC
[02:21:18] *** bolt has joined ##java
[02:21:44] *** guidj0s has joined ##java
[02:22:09] *** HardDisk_WP has quit IRC
[02:30:06] *** sebersole has quit IRC
[02:30:47] *** neuro_sys has joined ##java
[02:31:58] <VooDooNOFX> Can someone tell me how to get a SWT button to constrain to the image i'm trying to place in it on OSX? My code works fine on Windows and linux, but on OSX the rouded button is showing behind the image, and the image is only clickable on the areas it overlaps the button behind it.
[02:32:04] <VooDooNOFX> here's an example screenshot on OSX: http://img19.imageshack.us/i/screenshot20110309at522.png/
[02:32:57] <VooDooNOFX> and the code that made it: http://pastebin.com/kE1KFJ00
[02:35:54] *** HardDisk_WP has joined ##java
[02:38:17] *** okiwan has quit IRC
[02:39:00] *** kriko has quit IRC
[02:39:14] *** lighta has quit IRC
[02:39:35] *** xiliax has quit IRC
[02:39:39] *** rgr has quit IRC
[02:40:56] *** Fanook has joined ##java
[02:45:20] *** echelog has joined ##java
[02:45:48] *** phantomcircuit has joined ##java
[02:48:35] *** dack_x has joined ##java
[02:50:37] *** Matuku has quit IRC
[02:52:18] *** L-----D has quit IRC
[02:54:06] *** dlam has quit IRC
[02:55:04] *** wliao has joined ##java
[02:56:46] *** cool123 has quit IRC
[02:56:52] *** ngochai has quit IRC
[02:59:09] *** homie has quit IRC
[03:00:04] *** coldpizza72i has joined ##java
[03:00:16] <coldpizza72i> how can i convert a double into a Double
[03:00:29] *** linusoleander has joined ##java
[03:00:37] <Fanook> ~~ coldpizza72i javadoc Double
[03:00:38] <javabot> coldpizza72i: http://is.gd/KMDsk7 [JDK: java.lang.Double]
[03:00:50] <linusoleander> How do I use a string in a case statement?
[03:00:53] *** dack_x has left ##java
[03:00:58] <Fanook> wait for Java 7
[03:00:58] <gpeterso> coldpizza72i: Which version of java? In 1.6 (or probably 1.5) it's just double x = 3.5; Double y = x;
[03:01:46] <linusoleander> Okey
[03:02:10] <gpeterso> coldpizza72i: For the opposite, you may need to check for null. Double y = 3.5; double x = (y == null ? 0 : y);
[03:02:58] <gpeterso> coldpizza72i: Java "autoboxes" or automatically converts. If you know your Double is not null, then just throw it around without worrying.
[03:03:15] *** nous1024 has joined ##java
[03:03:27] *** matsebc has joined ##java
[03:03:57] *** km has quit IRC
[03:05:58] *** L-----D has joined ##java
[03:06:44] *** jdolan has quit IRC
[03:07:41] *** gartt has joined ##java
[03:11:08] *** kandinski has joined ##java
[03:12:08] <kandinski> what's the standard tool for a translator to localise the strings in java properties files? This is using Ubuntu.
[03:13:52] *** chomping has joined ##java
[03:14:23] *** SeanBE has joined ##java
[03:14:56] <guidj0s> write up some Perl.
[03:15:59] <SeanBE> Asking a user to keep inputting doubles until he inputs a blank. How can I do this? I tried NaN and Infinity from java api
[03:16:29] <Fanook> read a line, if it's empty stop. if it's not, try parsing it
[03:16:49] *** dack_x has joined ##java
[03:20:05] *** l_r has quit IRC
[03:24:15] <SeanBE> thanks!
[03:24:21] *** SeanBE has left ##java
[03:31:14] <Omen_20> Can an int not be NULL ?
[03:31:33] <ojacobson> null is a value of every reference type
[03:31:36] <ojacobson> int is not a reference type
[03:32:23] <Omen_20> ok so Integer.getInteger() can return null under some conditions. If I'm assigning an int to this function, what happens on null?
[03:32:26] *** gilead has quit IRC
[03:33:12] *** Wicked has quit IRC
[03:33:13] *** namidark has quit IRC
[03:33:25] <jesmon> Omen_20: NullPointerException
[03:33:48] <Omen_20> ok, so ill need to catch that exception. Thanks.
[03:34:00] <jesmon> ~~ Omen_20 autoboxing
[03:34:00] <javabot> Omen_20, autoboxing is http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html
[03:34:09] *** yates has joined ##java
[03:34:29] *** surial has joined ##java
[03:34:38] *** zemanel has joined ##java
[03:34:52] <yates> i have a couple of questions on jni dlls under Windows
[03:35:30] <jesmon> Omen_20: a better approach would be to assign the value to an Integer instead of int and then check for null, rather than catching a NPE
[03:35:31] <yates> does the jni "interface" dll actually get embedded into the .jar file?
[03:35:48] <ojacobson> yates: no, it must be somewhere the native loader can reach it
[03:35:52] <ojacobson> (ie. not inside a JAR)
[03:36:09] <yates> ojacobson: what do you mean by the "native loader" - the VM?
[03:36:14] <ojacobson> No, the OS
[03:36:20] <Omen_20> jesmon: will do. Trying to use the != operator for null is how I realized it couldnt be done with int.
[03:36:23] <ojacobson> JNI native libraries are still native libraries
[03:36:32] <ojacobson> they're loaded by the same loader that handles every other shared object
[03:36:37] <ojacobson> (.dll, .so, whatever)
[03:37:07] <yates> okl
[03:37:08] <yates> ok
[03:37:18] <jesmon> Omen_20: careful with the != operator and reference types, including autoboxed primitives
[03:37:50] <ojacobson> web start has some glue for loading native libraries out of JARs (which handles it by copying the native stubs to the OS) but on non-jws apps you're on your own - getting stuff onto java.library.path is a deployment problem, not a development one
[03:37:55] *** aLeSD has quit IRC
[03:38:02] *** gpeterso has quit IRC
[03:39:04] <yates> maybe that's my problem then - i'm getting UnsatisfiedLinkError exceptions when i try to execute a JNI member function
[03:39:08] *** zemanel has joined ##java
[03:40:02] *** zemanel has joined ##java
[03:40:05] <Omen_20> jesmon: yeah you're saying checking equality for something like a String I should use .equals method?
[03:41:15] <yates> also, are there any "tricks" for building jni dlls using cygwin?
[03:41:42] <yates> i've read a few tutorials and have the basics, like -mno-cygwin option
[03:41:51] *** rjohnson19 has quit IRC
[03:42:00] <jesmon> Omen_20: if one of the autoboxed types is a primitive, the != operator (or it's relatives) will unbox the other and the operator will give the correct result. If they're both reference types, they will not be unboxed, and you want .equals()
[03:42:07] <yates> and of course the -share option during link phase
[03:42:26] <jesmon> Omen_20: eg, new Long(1) == new Long(1) evaluates to false
[03:43:31] <Omen_20> in that circumstance it's checking memory addresses correct?
[03:44:23] *** cbeust has quit IRC
[03:44:34] <jesmon> Omen_20: more or less, yeah. "referential equality"
[03:44:37] <ojacobson> references, yes
[03:44:53] *** coldpizza72i has quit IRC
[03:44:59] *** cbeust has joined ##java
[03:45:11] <ojacobson> the only ways new references come into being are (1) new (2) certain kinds of constant expression (3) reflection and (4) java serialization
[03:45:18] <yates> ojacobson: would you agree that the UnsatisfiedLinkError could very well come from not having the dll in the loader path?
[03:45:29] <ojacobson> yes, hence my remark about java.library.path
[03:45:53] <yates> right, thanks
[03:45:59] <yates> ta ta.
[03:46:01] *** yates has quit IRC
[03:49:40] *** cdg has quit IRC
[03:53:18] *** rfw has joined ##java
[03:53:34] *** karstensrage has joined ##java
[03:53:53] *** yxz97 has joined ##java
[03:54:03] *** linusoleander has quit IRC
[03:54:04] *** linusoleander_ has joined ##java
[03:54:05] <yxz97> has anyone here experience with Flex?
[03:54:07] *** linusoleander_ is now known as linusoleander
[03:54:16] <ojacobson> ~anyone
[03:54:16] <javabot> Chances are someone has, so why not just ask your question and save some time? If someone knows and wants/has time to help, perhaps he/she will.
[03:56:34] *** GeorgeBrabazon has joined ##java
[03:58:51] *** tigger0jk has joined ##java
[03:59:20] *** matsebc has quit IRC
[04:00:47] *** L-----D has quit IRC
[04:02:21] *** Yusdan has joined ##java
[04:02:28] <cbeust> Actually on #java, chances that someone knows flex are pretty low
[04:02:42] *** Sliker has joined ##java
[04:02:56] <yxz97> I have a already hirarchical data in a XML .. I need use the aggregation features of a advancedDataGrid but in order to use SummaryField a GroupingCollection2 is required and this last needs a flat dataProvider..
[04:03:04] <yxz97> My data is already Hirarchical...
[04:03:13] <yxz97> I'm in troubles..
[04:04:11] <ojacobson> How is this Java-related, exactly?
[04:04:26] <ojacobson> cbeust: but not zero - I have worked with flex, for example. :)
[04:04:37] <yxz97> Well I ask first, has anyone experience with Flex?
[04:04:49] <ojacobson> Yes, but... why are you asking ##java?
[04:05:02] <yxz97> that was my first question… maybe nowadays. many java developers do as well flex coding..
[04:05:06] <ojacobson> XML has a channel, flex (or flash, or AS3+) presumably has a channel...
[04:05:19] <ojacobson> Do you want to ask us about your needlepoint, too?
[04:05:31] <cbeust> ojacobson: yeah I realize that, I just don't want to encourage too much off topic just because the #java peeps happen to be more responsive than most channels
[04:05:33] <VooDooNOFX> the flex channels on freenode are very quiet
[04:05:45] *** fuzzygroove has joined ##java
[04:05:52] <cbeust> It's like losing your keys in the park but looking for them in your room because there's more light.
[04:06:05] *** linusoleander has quit IRC
[04:06:06] <yxz97> you are right I'm at flex channel already..
[04:06:25] <yxz97> Please do not let me think of you I didn't asked first there...
[04:06:54] <yxz97> poetry?
[04:07:03] <ojacobson> A well-known metaphor.
[04:07:06] <cbeust> Analogy.
[04:07:12] <ojacobson> No, no. I just want to know why you asked *here*, where all of the things in your question are off-topic.
[04:07:13] <yxz97> I said there are java developers which do Flex as well..
[04:07:21] *** fuzzygroove has left ##java
[04:07:55] <Planck_> There are java developers who have tiolets as well, but you don't asking plumbing questions here.
[04:07:58] <yxz97> God… where is your understading lossing..
[04:08:12] <yxz97> Thats ridiculos.
[04:08:22] <ojacobson> Maybe I should ask here about my cat
[04:08:27] <ojacobson> I mean, lots of programmers have cats
[04:08:44] <yxz97> this shit channel room is for people who called themselves programmers of Java..
[04:08:50] *** tokam has joined ##java
[04:08:55] <tokam> http://www.med-kolleg.de/medizin-lexikon/W.htm
[04:08:56] <tokam> can you
[04:08:59] <Planck_> Sometimes I think lots of programmers *are* cats. or at least, let the cats write their code.
[04:09:00] <yxz97> they take such pride of it… and you talk about toilets?
[04:09:01] <tokam> open this page with java?
[04:09:04] <yxz97> wtf man..
[04:09:07] <tokam> with DefaultHttpClient
[04:09:15] <Fanook> tokam: did you try?
[04:09:23] <tokam> yes I get a 403 forbidden
[04:09:30] <ojacobson> tokam: Very likely. There's ultimately very little to distinguish a web browser from any other program, at the HTTP level.
[04:09:53] <yxz97> Planck_: you are a such retard dude :)
[04:09:58] <ojacobson> Identify the differences in your requests between browser and program and eliminate them, one at a time, until you figure out what the distinguishing feature is
[04:10:11] <tokam> ojacobson: I use httpget is it correct?
[04:10:15] <yxz97> I'm pleased to be kicked by that :)
[04:10:19] <yxz97> idiot
[04:10:21] <ojacobson> ~~ tokam RFC 2616
[04:10:21] <javabot> tokam, ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt or http://www.faqs.org/rfcs/rfc2616.html - depending on your preference.
[04:10:25] <tokam> HttpGet get = new HttpGet(url);
[04:10:25] <tokam> try {
[04:10:25] <tokam> HttpResponse response = browser.execute(get);
[04:10:34] <ojacobson> ~ topicsmite tokam
[04:10:34] <javabot> And the wrath of /TOPIC descended with terrible fury upon tokam. And all the people marvelled, saying, Behold, we too should read the /TOPIC, lest we be stricken. And all the people read the /TOPIC, and went away edified.
[04:10:58] <yxz97> yeah please sucks this
[04:11:14] <yxz97> asswhole
[04:11:16] <tokam> ojacobson: 3 lines always has been accepted in the irc
[04:11:18] <yxz97> :)
[04:11:39] <yxz97> My first question say too much for Planck_
[04:11:42] <yxz97> hahaha
[04:11:56] <yxz97> like was too complicated for you..
[04:11:56] <tokam> any idea why I can not access the page?
[04:12:07] *** ojacobson sets mode: +b *!*Adium@201.194.46.*
[04:12:07] *** yxz97 was kicked by ojacobson (It's time for a time-out for you. You're being actively disruptive.)
[04:12:17] *** ojacobson sets mode: -b *!*Adium@201.194.46.*
[04:12:37] *** Sliker has quit IRC
[04:13:05] *** tissue has joined ##java
[04:13:18] <ojacobson> tokam: what are the differences between the two requests?
[04:13:30] <ojacobson> You may want to look at the with wireshark or ngrep
[04:13:40] <ojacobson> *at them
[04:14:05] <tokam> ok i'll do so. a difference might be the browser version
[04:14:23] <tokam> maybe they are clever enough to block java
[04:15:07] <ojacobson> that kind of magical thinking won't get you far
[04:15:15] <ojacobson> all a network peer sees is bytes
[04:15:23] *** krang has joined ##java
[04:15:30] <ojacobson> anything higher-level (like "what language the client was written in") is only a matter of convention
[04:17:07] <krang> hey all, if I have a list containing objetcs of type 'Place', which contains a Point, I can choose an arbitrary Point and generate the distances from it to each Place. What is the cleanest way to store this, then order the list by it? it clearly can't live in the place object, as it isn't inherently part of it.
[04:18:08] <ojacobson> krang: you can implement a Comparator that compares two things based on their relationship to a third thing pretty easily
[04:18:53] <tokam> ojacobson: you can read it out, because it is in the php headers
[04:18:54] <krang> ojacobson: yes, but I need to store information about each of those things when a calulation is performed, *then* order by it. I can't store them in the Plcae objects
[04:18:56] <tokam> http headers
[05:46:21] *** echelog has joined ##java
[05:46:41] <Skyec> argh, stupid conversions between AWT and SWT ... giving me headaches :(
[05:46:44] <GeorgeBrabazon> ojacobson: also depends on whether whatever project is being done is an application that utilizes a database, or if the database is being used primarly as a means of persistence for java
[05:47:08] <ojacobson> Eh. Getting bitten badly by "update" ddl modes in hibernate will fix that.
[05:47:10] <GeorgeBrabazon> if its the former, then DB VCS and all the stuff you're advocating make way more sense
[05:47:13] <GFXDude> surial, http://slexy.org/view/s21iPudpRD
[05:47:20] <GFXDude> Now it breaks on the first one..
[05:47:32] <ojacobson> No, you need migration infrastructure even if you're just using it as a transactional object store (though, way to waste a bunch of expressive power)
[05:47:38] <surial> GFXDude: Learn to debug.
[05:47:49] <Skyec> Does anybody know how to convert from a BufferedImage with a ComponentColorModel to an SWT Image? I'm stuck
[05:48:04] <surial> GFXDude: I'm guessing this "Shit, my code doesn't work the way I wanted it to. Oh well. Unless someone on ##java knows, I'm fucked" - approach is not quite a scalable as you might imagine.
[05:48:19] <GFXDude> No, my
[05:48:51] * surial wonders what the difference between System.out.format and System.out.printf could possibly be.
[05:48:54] <surial> ~javadoc PrintStream
[05:48:54] <javabot> surial: http://is.gd/Jc5WLR [JDK: java.io.PrintStream]
[05:48:55] <GFXDude> No, my "I really can't figure this out so I'll get a second pair of eyes to look at it" approach is conceivable
[05:49:33] <surial> GFXDude: No, you need to learn how to debug. This problem fundamentally doesn't qualify as hard to debug. Just step through it. It'll be obvious in an instant. Hell, old fashioned crap 'debug by println statement' can do a fine job here, even.
[05:49:51] <GeorgeBrabazon> ojacobson: i meant more the using ORM/xml more java side approaches to interacting with the dataase vs SPs/Views,
[05:49:52] <surial> No difference.
[05:50:24] <GeorgeBrabazon> but you're right on the migration point
[05:50:42] <surial> GFXDude: I have no idea what .getCols() would return for example. If its value fluctuates...
[05:51:05] <surial> GFXDude: Remember, 0 % 4 is also 0.
[05:51:09] <GFXDude> yeah
[05:51:20] <GFXDude> i just saw that, fixed it, and was brought back to the initial output
[05:51:23] <surial> hence why your output starts with a newline.
[05:51:24] <GFXDude> of where the second half is messed up
[05:52:05] <GFXDude> getCols and getRows return the # of cols and rows, respectively
[05:52:16] <surial> So you expect us to debug this without even knowing what .getCOls() and getRows() returns? This 'ask ##java' plan really isn't going to work. I'm supposed to take you at your word those fluctuate?
[05:52:22] <surial> s/fluctuate/do not fluctuate
[05:53:08] <GFXDude> No, for this example they don't fluctuate
[05:53:13] <GFXDude> they're pulling from the same file
[05:53:15] <GFXDude> eatch time
[05:53:17] <GFXDude> each*
[05:53:17] <GFXDude> ffs
[05:53:33] <surial> Ah, I see your problem.
[05:53:49] <surial> You can't debug, because you don't realize that you should test your assumptions when you can't figure out why some code isn't working.
[05:53:55] *** blahspam has quit IRC
[05:54:11] <surial> You can fix this by realizing that you should test your assumptions when stumped. So, go test that assertion. Your code's behaviour is trivial to explain if .getCols() fluctuates.
[05:54:44] <GeorgeBrabazon> unit tests are a good way to test your assumptions on that sort of thing.
[05:54:54] <GeorgeBrabazon> failing that, pop open eclipse in debugger mode
[05:55:26] <GFXDude> surial, i see what you're saying now by fluctuating. They've got to since it's not hitting %4
[05:55:36] <GFXDude> All I need is criticism and I figure it out... lol
[05:55:41] <surial> That's what I've been trying to suggest for a while now. unit tests aren't particularly useful in testing new stuff. These kinds of "what... the... FUCK!?!?!?!?" moments are usually due to weirdness that you didn't expect and thus didn't write a test for.
[05:56:06] <Skyec> i just usually ask if you've tried turning it off and on again
[05:56:09] <GeorgeBrabazon> unit tests are good if you have samples of the data thats going ot be running through something
[05:56:14] <GeorgeBrabazon> not samples you made, but legit samples
[06:02:01] *** echelog has joined ##java
[06:02:05] *** bojo has quit IRC
[06:03:36] *** terranova has joined ##java
[06:03:39] <Rainier> A strange philosophical question about SpringLayout ... why in the world does it make a difference between HORIZONTAL_CENTER and VERTICAL_CENTER if seems to treat them the same? It also leads to a non-error case where you can put a constraint against the "vertical center" of one component against the "horizontal center" of another ...
[06:03:47] *** terranova has quit IRC
[06:04:00] <GeorgeBrabazon> cbeust: tests arent a substitue for debugging, but debugging isnt a substitute for tests, especially as a code base grows
[06:04:15] <Skyec> does anybody know how to work with ComponentColorModel BufferedImages... I'm finding very little on the internet. It's making me sad
[06:04:21] *** terranova has joined ##java
[06:04:50] <Rainier> It seems that despite them representing different points on an edge semantically, they're technically the same as what they do depends on the other edge against which they were used.
[06:06:22] <joed> GeorgeBrabazon: Nobody sad.
[06:06:26] <joed> siad.
[06:06:29] <joed> said.
[06:06:35] <joed> Damn.
[06:07:05] <joed> GeorgeBrabazon: I suspect cbeust has written more than a few tests to prove his comment.
[06:07:46] <GeorgeBrabazon> joed: im not doubting that, i just felt it should be pointed out nonetheless
[06:08:14] *** Wagoo has quit IRC
[06:08:16] <Rainier> I'z dumb. I just realized the case that I pretty much presented where it cares to make a distinction: when pairing a center against another center. It indicates which you meant :-/
[06:08:18] <joed> GeorgeBrabazon: My comment was also made from inspecting around 3700 unit tests
[06:10:18] <GeorgeBrabazon> joed: hopefully they were not unit tests like i usually end up writing 1/3 of mine: not really testing just a unit, overly brittle and complex
[06:10:31] <GeorgeBrabazon> i try to at least leave an //i'm really sorry comment on those
[06:10:52] *** t0rc has quit IRC
[06:10:56] *** dtrott has joined ##java
[06:10:58] *** elfrank has joined ##java
[06:11:24] <kebomix> what does it means that pixel color value = -1 ?
[06:11:46] <joed> GeorgeBrabazon: I tend to write units that test the package I need to test, otherwise it is integration or useless.
[06:11:49] <ojacobson> kebomix: whatever you want it to mean. What colour model?
[06:12:25] *** Wagoo has joined ##java
[06:12:46] *** surial has quit IRC
[06:13:25] <elfrank> trying to do a challenge problem where I'm supposed to add every positive number with the least number of characters ... can't figure out a way to shorten it: http://pastie.org/1654404
[06:13:48] <GeorgeBrabazon> joed: i mean i write tests that only really test preferably one public method, and if they do reference other resources, its only in a minimal enough way where im just using them to create mock objects
[06:14:05] *** yxz97 has joined ##java
[06:14:25] <GeorgeBrabazon> doesnt mean i dont half ass them sometimes when i finished everything ut tests, and doesnt mean i dont pay for it later
[06:14:52] *** ExtraSpice has joined ##java
[06:15:55] *** kinks has joined ##java
[06:16:18] *** bojo has joined ##java
[06:16:39] <joed> GeorgeBrabazon: I usually write tests that test the component I have, so I know it works, if it is threaded I hit it with a pool and latches.
[06:16:49] <joed> GeorgeBrabazon: Not sure what you mean really.
[06:17:37] *** homie has joined ##java
[06:17:49] <joed> GeorgeBrabazon: Why would you only test public methods?
[06:18:17] <GeorgeBrabazon> joed: not always, but generally when im first banging out a bunch of stuff
[06:18:42] <GeorgeBrabazon> and because the public methods are the interface everything else uses to interact with the class
[06:18:50] <joed> Okay?
[06:18:55] <GeorgeBrabazon> so as long as the functionality there isnt broken the class is performing as expected
[06:19:13] <joed> And since you can mock public, what is the point of a test?
[06:20:09] <GeorgeBrabazon> automated build stuff like hudson/jenkins
[06:20:21] <joed> Like 100% idiocy?
[06:20:57] <GeorgeBrabazon> you change something in another class that the class being tested depends on, build breaks on commit if you didnt catch it by running the tests yourself already
[06:21:17] *** sorabji52 has joined ##java
[06:21:18] <joed> But those were interfaces?
[06:21:20] * Rainier writes a plugin for jenkins named leroy that plays a sound when the build fails >:D
[06:21:30] <joed> You could have caught that in a build?
[06:22:45] <GeorgeBrabazon> ? im not saying unit test public methods on Interfaces?
[06:23:03] *** yxz97 has left ##java
[06:23:39] <GFXDude> Thanks whoever told me to suck it up and do it myself, lol.
[06:23:41] <GFXDude> Got it figured out
[06:23:53] <GeorgeBrabazon> im saying the first layer of unit tests should be on public methods of classes
[06:24:04] <joed> Why public?
[06:24:05] <GeorgeBrabazon> and that will catch the bulk of problems
[06:24:28] <joed> I think any piece of code you checkin should be tested.
[06:24:54] <GeorgeBrabazon> because protected/private methods are implementation details, and while you might want to lock those into a specific process/way of working its not hte initial place effort should be expended
[06:25:29] <GeorgeBrabazon> and lets say you break a private/protected method, but have good tests on all the public methods of a class, the majority of time that problem will manifest itself in one of the public unit tests
[06:25:55] <GeorgeBrabazon> im saying work/reward ratio is way better on testing the methods that a class exposes to the world
[06:26:05] *** kebomix has left ##java
[06:26:23] <GeorgeBrabazon> how a class does what it promises it will do, is generally less of an immediate concern, as long as its doing it
[06:26:34] <GeorgeBrabazon> and you're using comprehensive enough test cases against those public methods
[06:28:18] *** Fanook has joined ##java
[06:30:17] <Rainier> Is there a convention for naming of an interface that is an extension of an existing one providing features in a similar vein but does not want to change the original interface for compatibility concerns with existing implementations? In Java core I seem to see only one example of this, LayoutManager, and LayoutManager2 (which indicates at least some thoughtfulness that there's only one such instance I see quickly) and I've been t
[06:30:17] <Rainier> old Windows API appends Ex ...
[06:30:51] *** elfrank has quit IRC
[06:30:56] <Rainier> In my case it's really not so much compatibility as many things that might be built around the simple base interface that really wouldn't use or care for the extended methods/info.
[06:31:14] *** zuxqoj has joined ##java
[06:31:50] *** sorabji52 has quit IRC
[06:32:02] <GeorgeBrabazon> AdvancedInterface? i dont know of any convention off hand, but im not an expert by any means at all
[06:32:30] <ojacobson> Same name, different signature
[06:32:50] <ojacobson> fooEx is a remnant of the inability to have two symbols with the same name
[06:33:27] <Rainier> So same name, different package?
[06:33:46] *** voxter has joined ##java
[06:34:00] <ojacobson> I'm pretty sure I said what I meant.
[06:34:27] <ojacobson> The signature of a method is its name and argument types (and sometimes return type and exception list; formally, though, just those two things :)
[06:34:31] * Rainier wonders why it smells like a litter box in his apt and he doesn't even own any pets.
[06:34:36] <GeorgeBrabazon> he means the whole interface i think
[06:34:40] <voxter> Hey everyone. I am trying to modify a single file inside of a jar. I know i can simply unzip it to reveal the contents, etc, but if i simply re-zip it, will the JAR still work, most likely? or is JAR creation a special procedure?
[06:34:54] <GeorgeBrabazon> i.e. he wants to make a Basketball interface to extend his Ball interface
[06:34:55] <Rainier> ojacobson, yeah, I get that relative to methods :) I meant the interface itself.
[06:34:57] <joed> It is a zip file.
[06:35:09] <Rainier> ojacobson, hence my LayoutManager, LayoutManager2.
[06:35:30] <ojacobson> I would not use '2'... Surely there's some behavioural aspect you can use to distinguish them
[06:35:33] <Rainier> It's no biggie if the best suggestion is just to put it in the original, since I have enough flexibility at this point to not care :P but it would be nice to have a simpler version.
[06:35:42] <ojacobson> (See also the history between Logger and Category in log4j for inspiration)
[06:35:42] <GeorgeBrabazon> i mean is there some descriptive set of attributes that things that use the extended version have that the basic dont?
[06:35:44] <Rainier> ojacobson, yeah, definitely not "2" :) I figured that.
[06:36:54] <Rainier> GeorgeBrabazon, oh! sorry. The original is Layoutable2D (I didn't pick the name! I only made it 2D to distinguish it from other items given we're technically working in a 3D environment), and it offers a way to get the current size, set the size and position.
[06:37:24] <GeorgeBrabazon> and the new one?
[06:37:30] <Rainier> The would-be extender would contain the concept a "wished for" size (preferred size) to use in absence of other constraints, and an alignment for horizontal and vertical.
[06:37:37] <Rainier> I was typing, slow, apparently :P
[06:37:44] *** rgr has joined ##java
[06:38:17] <GeorgeBrabazon> Layouttable2dDefault? something to imply it will automagically pick the size?
[06:38:49] *** sorabji52 has joined ##java
[06:38:54] <Rainier> well the original is used in an environment where you give the layout manager a pre-determined size or size constraint with which to lay it out.
[06:39:27] <GeorgeBrabazon> Layouttable2dIntelligent would sound snazzy after implements
[06:39:49] <GeorgeBrabazon> you just have to make sure the implementation lives up to the name ;)
[06:40:55] *** irn has joined ##java
[06:42:16] <GeorgeBrabazon> you could make a seperate new interface 'AutomaticPlacement' that defines the size and placement for all sorts of things and not juts Layouttable2d
[06:42:49] *** voxter has left ##java
[06:43:21] *** jpk has joined ##java
[06:48:58] <Rainier> If I didn't have the preferredSize, AlignableLayoutable comes to mind. Well, I think rather than think up some stupid name I'll just keep it in the parent class and go with the idea that if it becomes a problem it'll get refactored and by then there will most likely be a better name for what may become. So simple is better for now. The existing stuff can stick it, because there's a small amount of it, and most extend a common base
[06:48:59] <Rainier> which can implement this extra stuff and return dumb defaults.
[06:49:32] <Rainier> (dumb not as in stupid, but as in not really context sensitive)
[06:49:43] *** openpercept has quit IRC
[06:50:38] <GeorgeBrabazon> haha good luck! im off to the land of sleeping
[06:50:43] <Rainier> seeya
[06:51:57] *** flippo has joined ##java
[06:53:21] *** mistik1 has quit IRC
[06:53:44] *** mistik1 has joined ##java
[06:54:43] *** L-----D has joined ##java
[06:55:19] <cbeust> Rainier: about your interface question: Yes, I use the convention 2 3 etc...
[06:55:34] *** GFXDude has quit IRC
[06:55:38] <cbeust> At least it makes it clear that each is a broader version of the previous one
[06:56:20] *** dack_x has quit IRC
[06:57:49] *** pyrrhic has joined ##java
[07:03:50] *** sorabji52 has quit IRC
[07:04:38] *** sorabji52 has joined ##java
[07:06:49] *** aaron11 has joined ##java
[07:06:54] *** topriddy has joined ##java
[07:07:22] <aaron11> Hey how can I make java keep changing the value of a random? Do I have to use a while loop?
[07:08:42] <Planck_> I don't know what you mean by those questions.
[07:09:11] *** bojo has quit IRC
[07:09:54] <Planck_> What do you mean by "keep changing"? A random what?
[07:10:05] *** [[thufir]] has joined ##java
[07:11:17] *** dtrott has quit IRC
[07:11:32] *** sorabji52 has quit IRC
[07:11:40] <aaron11> Planck_, java.util.Random. To keep changing the int value.
[07:11:51] <Planck_> Keep changing which int value?
[07:12:22] <Planck_> Every time you ask it for a new random int value, it will give you one.
[07:13:58] *** Junior has joined ##java
[07:14:06] <Junior> yello :)
[07:19:01] *** zChris has quit IRC
[07:19:04] *** davo has joined ##java
[07:20:27] <davo> Hi all. I have a program that I'm trying to modify which contains 2 tabbed panes based on: tabbedPane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
[07:20:50] *** LordXe-gnu has joined ##java
[07:21:00] <davo> is there a way i can remove one of the tabbed panes without losing the other tabbed pane?
[07:21:14] *** McMAGIC-- has quit IRC
[07:21:50] <davo> the code has panel1 = new JPanel(); and panel2 = new JPanel();....I am wanting to remove only panel2, without losing panel1, is this possible?
[07:22:31] <LordXe-gnu> Hi all, I'm writting a logger class and in it I've placed an enum of log severity (e.g. critical, error, warning, etc). I'd like to have the option to filter so that only a certain level of logging is shown.. coming from a C background I went and tried using <= on the num values (which were arranged in order of severity) but I see from the errors that that's not the right way to do it.. can I do this in Java? or do I need to use
[07:22:31] <LordXe-gnu> a different method?
[07:22:39] <pyrrhic> davo, Sure
[07:23:05] *** topriddy has quit IRC
[07:23:16] <davo> should just commenting out the line with panel2 work? i tried it and both panels disappear
[07:23:32] *** bojo has joined ##java
[07:23:42] <pyrrhic> In java you can make a constructor for your enums that sets some info... And add functions I think.. Been a while
[07:23:42] *** CodeWar has joined ##java
[07:23:42] *** sorabji52 has joined ##java
[07:23:51] <LordXe-gnu> hm
[07:26:23] <GeorgeBrabazon> LordXe-gnu: why not just use Log4j or another logging library
[07:26:35] <GeorgeBrabazon> the problem has been solved many times over
[07:27:56] <Planck_> davo: Yes, you can remove one tabbed pane. How are you creating and displaying them?
[07:28:09] <GeorgeBrabazon> and if not LordXe-gnu it looks like someone already asked your specific question on stack overflowhttp://stackoverflow.com/questions/1149671/compare-java-enum-values
[07:28:18] <GeorgeBrabazon> in short, use .compareTo instead of >=
[07:28:19] <Planck_> (E.g. put your code in a pastebin)
[07:28:51] *** skoskav has joined ##java
[07:29:11] <LordXe-gnu> GeorgeBrabazon, mostly because I don't know what logging facility will actually go underneath - I'm targeting to write this code in a way that I'll have to make only minimal changes to make it run on android, and android has its own logging facility iirc, so something like that might go underneath my abstraction afaik
[07:29:27] <LordXe-gnu> ah, thanks
[07:29:28] <davo> Planck_: Actually I don't even want the tab to be created. I am trying to remove the code that creates the second tab, just not sure where it's being created, but I think it's: tabbedPane.addTab(" Schedule ", null, panel1, "Schedule Session Tab");
[07:29:54] <davo> or, parhaps remove tabbing from the application all together. whichever is easier.
[07:30:28] <GeorgeBrabazon> LordXe-gnu: i havent worked with slf4j (only with log4j directly) but see if it doesnt do what you need: http://www.slf4j.org/
[07:30:50] <LordXe-gnu> sure, I'm not opposed to using it if it does, I'll have a look - thanks for the tip
[07:30:54] <GeorgeBrabazon> again: im sure someone somewhere has handled a cross platform logging solution that involves android too at some point, don't reinvent the wheel if yo udont need to
[07:31:00] *** topriddy has joined ##java
[07:31:44] *** sorabji52 has quit IRC
[07:31:47] *** echosystm has quit IRC
[07:32:18] *** epalm has quit IRC
[07:35:18] <davo> Planck_: this is the code: http://pastebin.com/a1v6uUyk
[07:37:32] *** pyrrhic has quit IRC
[07:39:26] *** matsebc has joined ##java
[07:40:35] <Planck_> What happens if you just remove all code dealing with panel2?
[07:42:34] <davo> i tried that earlier, forgot what happened, i'll try it again now and see
[07:44:42] *** glcrazy has joined ##java
[07:47:54] *** terranova has quit IRC
[07:48:01] <davo> Planck_: I lose both panels and most of the GUI doesn't work. I get a small Square Java application window in the top corner of my screen that I have to drag the lower right corner to view the entire window, which loses all the JMenuItem menus and both panels are gone
[07:48:26] *** mistik1 has quit IRC
[07:49:17] <Planck_> Wow, you must have some really tight coupling between that panel and a lot of the rest of the gui
[07:50:34] <deebo> hmpf does hibernate automatically set classname based discriminator values into the mapped column?
[07:50:48] <Planck_> (Which I might have expected given a single class with about 70 UI component fields)
[07:51:23] <krang> hey all, any idea what I need to do with my type parameters to make this class work? http://pastebin.com/VuVtqqTD
[07:52:27] <Planck_> In what sense does your OrderingContainer<A> implement Comparable<A>?
[07:53:04] <krang> Planck_: It doesn't. That's just the last way I tried it :)
[07:53:15] <krang> I tried implementing Comparable first
[07:54:16] *** brig has joined ##java
[07:54:38] <Planck_> In what sense do you want it to "work"?
[07:54:54] <krang> Planck_: ohhhhhhhh, I see, I needed to implement Comparable<OrderingContainer>
[07:55:03] <krang> thanks for the hint!
[07:55:09] <Planck_> No prob :)
[07:55:24] <Planck_> (Though probably, Comparable<OrderingContainer<A>>
[07:58:42] *** supercosmonaut has quit IRC
[08:07:07] *** tewecske has joined ##java
[08:08:02] *** zuxqoj has quit IRC
[08:08:56] *** zuxqoj has joined ##java
[08:09:16] *** freeone3000 has joined ##java
[08:09:28] *** caverdude has joined ##java
[08:12:41] *** Psi-Jack has joined ##java
[08:13:46] <Psi-Jack> Does anyone know any good books for learning Java, geared towards web application development, that isn't painfully dry to follow along with like most I have seen?
[08:16:30] <krang> Planck_: Ok, so now I'm doing some other stupid thing that isn non-obvious to me, so my test won't even compile: http://pastebin.com/j9ZY4FjC
[08:16:54] <krang> Planck_: it's the bit where I sort that breaks
[08:17:04] *** zhulikas has joined ##java
[08:17:29] <cbeust> krang: include the line number and error you're seeing in the pastebin
[08:18:23] *** caverdude has quit IRC
[08:18:27] <krang> cbeust: Line 19, and I can't get the error due to some wiered junit thing hapening
[08:19:04] <cbeust> I don't believe sort returns a value
[08:19:15] <cbeust> either way, "weird thing" is not helpful, what's the exact error?
[08:20:56] *** caverdude has joined ##java
[08:20:57] <krang> /home/robert/.netbeans/6.9/var/cache/executor-snippets/junit.xml:77:
[08:20:57] <krang> Cancelled by user.
[08:23:00] <freeone3000> krang: Collections.sort() doesn't return a value.
[08:23:11] *** LordXe-gnu has quit IRC
[08:23:15] <krang> oh, it just modifies the collection in-place?
[08:23:26] <freeone3000> Right. And I believe that's already been answered, actually.
[08:25:12] <cbeust> Yeah that was exactly my first reaction.
[08:25:35] <cbeust> Seriously, learn to read the error message, I'm sure the error message said that exact thing
[08:25:47] *** frangiz has joined ##java
[08:26:04] <krang> cbeust: yeah, I honestly can't find the output for Netbeans when it's compiling junit tetsts
[08:26:17] <cbeust> krang: try to find it, it will save you hours of frustration
[08:26:22] <cbeust> Or get a real IDE, like Eclipse :)
[08:26:39] <krang> I normally do, just trying Netbeans out :)
[08:26:49] <cbeust> and a real testing framework, like TestNG :)
[08:27:20] <krang> Really, JUnit isn't what I'd find in my happy place any more?
[08:27:27] *** zhulikas has quit IRC
[08:28:41] <cbeust> I rarely see JUnit and Happy in the same sentence.
[08:29:28] *** caverdude has quit IRC
[08:29:40] <krang> Well, duly noted! This is my first foray into unit testing, and it's all so novel and interesting just now!
[08:29:53] <krang> What advantages does testNG have?
[08:30:17] <cbeust> ~~ testng
[08:30:18] <javabot> The syntax is: tell nick about factoid - you missed out the 'about', cbeust
[08:30:22] <cbeust> ~~testng
[08:30:22] <javabot> The syntax is: tell nick about factoid - you missed out the 'about', cbeust
[08:30:25] <freeone3000> @DataProvider. Additional parameters to @Test. Uses 'assert' instead of Assert.assert().
[08:30:28] <cbeust> Javabot you suck
[08:30:41] <cbeust> krang: See for yourself http://testng.org
[08:30:49] *** mastroDani has joined ##java
[08:31:00] *** DJClean has joined ##java
[08:31:04] <cbeust> Honestly for the simple testing you're doing right now JUnit is fine, but consider TestNG if you start needing more advanced functionalities
[08:31:13] *** LouisJB has quit IRC
[08:31:16] *** CodeWar has quit IRC
[08:31:41] *** bolt has quit IRC
[08:32:18] *** davo has quit IRC
[08:32:31] <krang> cbeust: I'll do that. Right now it's nice to be introduced to a framework that's well integrated into the IDE, as everything basically drops into my open mouth. This, of course, will only last a little while before I start wanting to actually *use* unit testing :)
[08:33:51] *** Clete2 has quit IRC
[08:35:20] <cbeust> krang: FYI, here is what the TestNG integration looks like in Eclipse: http://testng.org/doc/eclipse.html There's an IDEA plug-in too
[08:36:18] *** gh0st has joined ##java
[08:37:24] <krang> cbeust: oooh, I see a regression option right there. Does JUnit/Netbeans even do that?
[08:37:38] *** GeorgeBrabazon has quit IRC
[08:37:41] <cbeust> Regression option?
[08:37:56] *** Clete2 has joined ##java
[08:39:31] *** mitch0 has joined ##java
[08:40:12] *** deeeed has quit IRC
[08:41:59] *** wolfman2000 has quit IRC
[08:45:38] *** Ch30ps has joined ##java
[08:47:01] *** bolt has joined ##java
[08:47:24] *** flippo has quit IRC
[08:48:08] *** mazzachre has joined ##java
[08:48:09] *** _Jorde has joined ##java
[08:48:27] * shookees morning lads
[08:48:30] *** JaMeSiTeGeN has joined ##java
[08:48:41] <JaMeSiTeGeN> Hey does anyone here know how to make a .jar file using the `tar` command?
[08:49:27] *** FrozenKnight has joined ##java
[08:49:59] <freeone3000> tar doesn't make zips. zip makes zips.
[08:50:16] <freeone3000> jar also makes zips, and places the manifest at the appropriate spot in the TOC.
[08:50:51] <JaMeSiTeGeN> What flags would i use with `tar` to make a zip then?
[08:52:15] <freeone3000> jar also makes zips, and places the manifest at the appropriate spot in the TOC.
[08:52:23] <freeone3000> Augh, sorry. Meant a differentcommand.
[08:52:36] *** JaMeSiTeGeN has left ##java
[08:53:50] *** zuxqoj has quit IRC
[08:54:02] <krang> cbeust: yeah, something to do with catching a working test when it breaks
[08:56:24] *** dframe has joined ##java
[08:56:32] *** Ademan has joined ##java
[08:56:55] *** mah01 has joined ##java
[08:59:16] *** zuxqoj has joined ##java
[08:59:44] *** faust45 has joined ##java
[08:59:54] *** deeeed has joined ##java
[09:02:52] <topriddy> cbeust: TestNG > JUnit? does it go for web testing too?
[09:04:18] *** bulltwang_ has joined ##java
[09:05:12] *** gh0st has quit IRC
[09:05:33] <Ademan> anyone know how to generate ctags from a .jar file? I tried unjar-ing the file and using ctags on the resulting directory, however that's not working, I assume ctags only understands .java files, not .class files
[09:05:59] *** krang has quit IRC
[09:06:42] <bulltwang_> yes you need the source files, not the compiled ones
[09:07:29] *** [[thufir]] has quit IRC
[09:08:50] *** eitch0000 has joined ##java
[09:08:54] <Ademan> ah, that's annoying, thanks I'll grab them
[09:12:10] *** dropdrive has quit IRC
[09:14:20] *** cbeust has quit IRC
[09:17:02] *** Matuku has joined ##java
[09:23:33] *** robbyoconnor has quit IRC
[09:26:33] <FauxFaux> javap might output something close enough to what ctags wants.
[09:26:34] *** deeeed has quit IRC
[09:26:42] *** frangiz has quit IRC
[09:26:51] * Rainier takes his virtual boot and shoves it far up the end of Java's overly protective compile time errors.
[09:27:34] *** frangiz has joined ##java
[09:27:39] <FauxFaux> Rainier: Which, ooi?
[09:29:10] <Rainier> FauxFaux, the one that says I must not touch any parts of "this" while constructing the damn thing even if such code doing so will not be called until after the construction has finished, Java just wants to ensure such case is not possible period even when I know different. It seems to me that instead of letting me be stupid and just dieing with an Error of sorts at runtime if this conditional fails, it decided it would make a gre
[09:29:10] <Rainier> at compile-time error.
[09:31:47] *** freeone3000 has quit IRC
[09:31:54] <Rainier> I'm also sure doing so much simplified running things on their end, and that I could probably "be stupid" with byte-code manipulation, but yuuuuck.
[09:32:26] *** csaba has joined ##java
[09:32:28] <Rainier> I will just have to find a way that gives up on my parent class's final field so I can construct it after the super call, not in.
[09:34:02] <FauxFaux> Normally you can get around that with initialisation blocks. (class A{ {...;} })
[09:34:06] <Rainier> Though considering I've done C/++ programming, I shouldn't really be wishing Java to allow me to promote utter stupidity.
[09:34:30] *** Phil-Work has quit IRC
[09:35:07] <Rainier> FauxFaux, yeah, there's various little things ... the idea was I extend the base-class which has a final field, and I feed it that value through its constructor (super), but then I realized the value I was giving I wanted to intercept its drawing method, to call a before and after method on the current class.
[09:35:42] <Rainier> but it doesn't like that, for reasons stated, even though the framework causing the drawing won't call that method until long after because I haven't added it to anything at that point.
[09:36:14] <Rainier> So I just have to provide a setter for what was an immutable wrapper.
[09:36:19] *** vitas42 has joined ##java
[09:36:34] <Rainier> not that it was really all that immutable, so I guess this shatters the last vestiges of my denial.
[09:37:16] *** hotspants has joined ##java
[09:39:05] *** deeeed has joined ##java
[09:40:31] *** dextro_ has joined ##java
[09:40:39] <dextro_> i need to convert a string to a int
[09:40:48] <dextro_> casting doesnt work
[09:40:53] <Rainier> uh, duh?
[09:41:00] <Rainier> ~~ dextro_ javadoc Integer
[09:41:00] <javabot> dextro_: http://is.gd/ji5nq [JDK: java.lang.Integer]
[09:41:27] <dextro_> aha
[09:41:30] <dextro_> Integer.parseInt()
[09:41:31] <dextro_> t
[09:41:32] <dextro_> ty*
[09:42:07] *** neutrino has quit IRC
[09:43:33] *** terranova has joined ##java
[09:44:50] *** bearded_oneder has quit IRC
[09:47:13] *** mastroDani has quit IRC
[09:48:45] *** mastroDani has joined ##java
[09:54:28] *** frangiz has quit IRC
[09:57:42] *** Matuku has quit IRC
[09:58:48] *** frangiz has joined ##java
[10:01:36] *** ngochai has joined ##java
[10:03:20] *** Omen_20 has quit IRC
[10:03:42] *** Rainier has quit IRC
[10:04:45] *** graphikz has joined ##java
[10:05:29] <graphikz> hey, is there any reason why it's adding every current to every queue? http://pastie.org/private/uf20aulj8ao7att1ffitqg
[10:05:35] <graphikz> lines 42-49
[10:05:57] <graphikz> priorityQueues 0 1 and 2 all end up having a size of 100
[10:06:36] *** xianny has quit IRC
[10:06:40] <deebo> java has queues btw
[10:06:46] <deebo> no need to use lists
[10:07:29] <graphikz> my teacher's a dumb slut and told us to use linkedlists because it implements queues
[10:07:59] <deebo> do you have proof of her being a slut or is this speculation
[10:08:07] <graphikz> "If you look up the Queue class you'll see it's just an interface. So you can't use that to build a working queue. However if you check the LinkedList class you'll see that it implements the Queue interface, which means it contains its own poll and offer methods - a LinkedList object can be used as a queue without any further work on your part. -wl (3/6/11)*"
[10:08:09] *** coalado has joined ##java
[10:08:12] <Slush-> priorityqueues 0 1 and 2 all refers to the same list
[10:08:26] <deebo> and since you mentioned teacher
[10:08:34] <deebo> ~~ graphikz why no homework
[10:08:34] <javabot> graphikz, We understand you aren't asking us to do your homework. That's not why we don't answer. We don't because 1) You usually don't comprehend the answer and we get stuck in an endless loop of 'why', 2) You will understand, but you'll retort with "my professor doesn't want me to do it this way'. That's frustrating. 3) Homework questions are boring questions. We don't get paid. Your prof does.
[10:09:17] <graphikz> lol
[10:09:51] *** choongii has joined ##java
[10:10:00] <graphikz> is she wrong about queues then?
[10:10:26] <mitch0> 33Gdd:%s/\<blank\>/new LinkedList<Integer>()/g
[10:10:51] <graphikz> ohhh I have to clone it
[10:10:55] <graphikz> fuckin' a
[10:11:24] <graphikz> ty
[10:11:54] *** okiwan has joined ##java
[10:14:42] *** rvncerr has quit IRC
[10:15:24] <DroidAgent> I hope to encounter you in a professional capacity someday!
[10:17:02] *** laught has joined ##java
[10:17:25] *** terranova has quit IRC
[10:18:06] *** rfw has quit IRC
[10:18:07] <laught> hello
[10:18:51] *** danmar has joined ##java
[10:19:39] <laught> using this regexp: "(?:^\\[)*(\\[(?:^\\])+\\])?(?:.)*", it matches this string: "pratos [Sizzle] {Sizzle}"
[10:19:44] <graphikz> DroidAgent: me?
[10:20:06] <danmar> I've been reading: http://developers.sun.com/mobility/midp/articles/midp2network/
[10:20:09] *** TheBeerinator has quit IRC
[10:20:12] <laught> what i want to do is matcher.group( 1 ) so it should give me "Sizzle"
[10:20:13] <danmar> and I fail to compile one example
[10:20:18] <laught> but it returns null
[10:20:38] <danmar> this code: client.setSocketOption(DELAY, 0);
[10:20:56] <danmar> the symbol DELAY is not found... where can I find it?
[10:21:38] <laught> must be a constant somewhere in the code
[10:21:49] <danmar> ok
[10:21:51] <laught> you have to define it
[10:22:06] <laught> ok
[10:22:09] <laught> reading it
[10:22:13] <laught> it tells this:
[10:22:32] <laught> SocketConnection provides some useful constants, DELAY and KEEPALIVE, among others.
[10:22:47] <laught> try SocketConnection.DELAY
[10:23:01] <danmar> great tip.. I'll try
[10:23:40] <danmar> yes! that works :-)
[10:24:03] <danmar> thanks
[10:24:26] <danmar> I've been wondering about this and searched around for an hour or so..
[10:24:45] <laught> lol
[10:24:53] <laught> it was in that link you pasted
[10:26:27] *** mazzen has joined ##java
[10:28:10] *** frangiz has quit IRC
[10:29:06] *** frangiz has joined ##java
[10:30:33] *** jjido has joined ##java
[10:32:39] *** hyppias has joined ##java
[10:32:41] *** deeeed has quit IRC
[10:32:54] *** hyppias has quit IRC
[10:33:20] *** PigFlu has quit IRC
[10:33:26] *** meling has quit IRC
[10:34:00] *** hyppias has joined ##java
[10:34:30] *** mapreduce has joined ##java
[10:35:02] <hyppias> JAXB, XJC/toString question: http://pastebin.com/7XWUnDBQ
[10:35:17] *** jonkri has joined ##java
[10:36:19] *** meling has joined ##java
[10:37:06] *** zuxqoj has quit IRC
[10:38:09] *** mastroWork has joined ##java
[10:38:53] *** jjido has quit IRC
[10:39:20] *** vitas42 has quit IRC
[10:39:23] *** infid has quit IRC
[10:40:04] *** dr0id has joined ##java
[10:40:08] *** dr0id has left ##java
[10:41:09] *** infid has joined ##java
[10:41:32] *** mastroDani has quit IRC
[10:42:23] *** drindt has joined ##java
[10:42:24] *** zemanel has joined ##java
[10:43:43] *** dmb has quit IRC
[10:43:51] *** drindt has quit IRC
[10:43:59] *** dmb has joined ##java
[10:44:32] *** XaS has joined ##java
[10:45:28] <Wizard> hi
[10:46:11] *** jjido has joined ##java
[10:46:29] *** mastroWork has quit IRC
[10:47:22] *** pranay_09 has joined ##java
[10:48:07] *** tty1 has joined ##java
[10:51:38] *** mastroWork has joined ##java
[10:51:57] *** drindt has joined ##java
[10:52:33] *** devish has joined ##java
[10:57:30] <Slush-> Hello Wizard
[10:58:06] *** frangiz has quit IRC
[10:58:23] *** devish has quit IRC
[10:59:05] *** devish has joined ##java
[10:59:23] *** frangiz has joined ##java
[11:01:04] *** Phil-Work has joined ##java
[11:01:22] *** IamTrying has joined ##java
[11:01:32] <IamTrying> ~logs
[11:01:32] <javabot> channel logs can be found at http://www.antwerkz.com/javabot (Select the channel from the list on the left-hand side.)
[11:01:38] *** bitshuffler has joined ##java
[11:01:51] <IamTrying> ~log
[11:01:51] <javabot> IamTrying, logging is the recording of various events that happen in an application. The Java API supports logging since version 1.4 (see java.util.logging.Logger), and there are various other libraries, see ~log4j, ~slf4j and ~commons-logging
[11:01:57] *** Tyred has joined ##java
[11:02:23] <IamTrying> ~log4j
[11:02:23] <javabot> IamTrying, what does that even *mean*?
[11:02:36] <IamTrying> ~slf4j
[11:02:36] <javabot> IamTrying, slf4j is the Simple Logging Facade, an abstraction layer for different logging systems. see http://www.slf4j.org/ and the #slf4j channel on this network.
[11:02:49] <IamTrying> ~commons-logging
[11:02:49] <javabot> IamTrying, what does that even *mean*?
[11:03:28] *** mastroWork has quit IRC
[11:04:05] <ronr_> ~logging
[11:04:05] <javabot> ronr_, logging is the recording of various events that happen in an application. The Java API supports logging since version 1.4 (see java.util.logging.Logger), and there are various other libraries, see ~log4j, ~slf4j and ~commons-logging
[11:04:20] <ronr_> oh duh
[11:05:05] *** psst has joined ##java
[11:05:18] *** jjido has quit IRC
[11:06:23] *** Zta has quit IRC
[11:06:30] <dreamreal> morning
[11:06:40] <ronr_> noon
[11:08:09] *** saebbi has joined ##java
[11:08:15] *** xiliax has joined ##java
[11:08:37] *** mastroWork has joined ##java
[11:08:46] <saebbi> i want to write java under ubuntu 10.10. seems like there used to be a package called sun-java6-jdk, but not anymore
[11:09:04] <ronr_> damn. you can't use java under ubuntu then.
[11:09:09] <saebbi> now theres just a sun-java6-jre package
[11:09:24] <dreamreal> saebbi: also consider openjdk
[11:09:25] <saebbi> ronr_, funny.. ;) seriously, what do i need then?
[11:09:31] <saebbi> dreamreal, yea i was about to ask
[11:09:40] <saebbi> dreamreal, are they equivalent?
[11:09:45] <ronr_> saebbi: ask in #ubuntu about the jdk repos? :)
[11:09:50] <dreamreal> effectively
[11:10:18] <saebbi> dreamreal, the code i want to compile os over 10 years old
[11:10:23] <dreamreal> so?
[11:10:32] <saebbi> nothing :)
[11:10:41] <saebbi> i'll try it, thanks :)
[11:10:45] <ronr_> openjdk doesn't exist 10 years, so it won't work.
[11:10:55] <saebbi> ronr_, did you have a clown for breakfast?
[11:11:20] <ronr_> saebbi: I actually changed my facebook picture to me dressed as a clown as a kid.
[11:11:34] <saebbi> that explains that
[11:11:40] <Wizard> heh
[11:12:03] * Wizard writes in jabba and everything works perfect on ubuntu
[11:12:04] <Wizard> ;)
[11:12:16] <ronr_> ~ubuntu
[11:12:17] <javabot> See https://help.ubuntu.com/community/Java and try #ubuntu-java. Also Ubuntu is an ancient African word meaning 'I can't configure Debian'. If you want to install java on ubuntu, ask me about ~debian (same instructions apply to ubuntu).
[11:12:27] <ronr_> :p
[11:12:40] <saebbi> woah nice :)
[11:12:40] <Wizard> damn yeah
[11:12:49] <deebo> after using debian on the desktop for 4 years im happy to be rid of it
[11:12:51] <saebbi> and just for the record, my server runs debian :P
[11:13:24] <ronr_> nobody cares about your record ;)
[11:13:30] *** choongii has quit IRC
[11:13:31] <ronr_> OMG!
[11:13:36] <ronr_> The Dali Lama is leaving!
[11:13:37] <deebo> debian comes in three flavors: "older than jesus" "old" "and from the future", of which only the first works reliably and is usable if youre fine running software from 5 years sago
[11:13:46] *** jjido has joined ##java
[11:14:11] *** houst0n has joined ##java
[11:15:43] <houst0n> Hey guys, first off - I'm not a dev however we're hosting an app which is using icefaces and the ajax push progressbars only work if I use the httpd built into the appserver. Anyone know if there's some special trick involved to get ajax push working on a apache+mod_proxy_ajp+glassfish setup?
[11:16:05] <houst0n> I would ask the devs, but they asked us ;)
[11:16:30] <Wizard> uh
[11:16:34] <ronr_> your devs are morons and should be fired.
[11:16:40] <houst0n> You're probably right
[11:16:57] <houst0n> But we're not paying them, they're paying us
[11:17:10] *** dwilliamii has quit IRC
[11:17:22] <ronr_> you should charge them more.
[11:17:23] <ronr_> a lot more.
[11:17:38] <houst0n> We're not cheap ;)
[11:17:40] <FauxFaux> Icepush is pretty terrible; it barely works normally; have fun getting it working in your edgecase.
[11:18:20] *** jjido has quit IRC
[11:18:27] <houst0n> Well, I may just drop ajp and doa straight rproxy to the app - seems to work in my testing env. I do prefer ajp though
[11:18:59] <houst0n> Just curious if anyone had seen that mess before :)
[11:20:23] <ronr_> well, can't help you there :)
[11:21:13] <houst0n> Well, thanks for the heads up on how sucky icepush is anyway chaps
[11:21:23] <houst0n> I'll just do a straight http proxy to it sod it
[11:23:01] *** zuxqoj has joined ##java
[11:23:56] <dreamreal> FauxFaux: you had problems with icefaces?
[11:24:08] *** mastro has joined ##java
[11:26:55] *** devish has quit IRC
[11:27:37] *** mastroWork has quit IRC
[11:29:00] *** aLeSD has joined ##java
[11:29:06] <aLeSD> hi all
[11:29:17] *** zuxqoj has quit IRC
[11:29:19] <aLeSD> I have a native c++ lib and I'd like to use it in java
[11:29:40] *** PigFlu has joined ##java
[11:29:46] *** zuxqoj has joined ##java
[11:30:01] <Wizard> aLeSD: jni?
[11:30:05] <aLeSD> I know that I have to use jni to create a wrapper of the lib ... but does exist something that create the headers directly form c headers ?
[11:30:07] *** frangiz has quit IRC
[11:30:19] *** zuxqoj has quit IRC
[11:30:27] <aLeSD> Wizard, no ?
[11:30:46] *** zuxqoj has joined ##java
[11:30:58] *** zuxqoj has left ##java
[11:31:02] *** bolt has quit IRC
[11:32:08] *** houst0n has left ##java
[11:32:34] <mitch0> alesd: http://en.wikipedia.org/wiki/SWIG
[11:32:57] <dreamreal> aLeSD: look at JNA, as well
[11:33:04] *** bolt has joined ##java
[11:33:20] <dreamreal> but standard practice is to write a java API, then generate the JNI headers, then migrate the calls
[11:33:31] <dreamreal> so JNI is used to create an interface layer
[11:34:13] <aLeSD> dreamreal: yes ... I 'd like something that could create the jni headers form the c headers
[11:34:27] <dreamreal> not likely
[11:34:28] <aLeSD> and maybe the java API too
[11:34:52] <mitch0> doesn't SWIG do that?
[11:35:13] <aLeSD> I have to use jni
[11:36:00] <mitch0> http://www.swig.org/Doc2.0/Java.html#Java
[11:36:30] *** chandan_kumar has joined ##java
[11:41:06] *** mastroWork has joined ##java
[11:41:20] *** platzhirsch has joined ##java
[11:43:42] *** Versuchen has joined ##java
[11:44:48] *** mastro has quit IRC
[11:46:08] <topriddy> if an Entity has a collection property loaded lazily, how then do i add a new item to it without loading it eagerly or something,? entity.getFooCollection() may return null such that chaining .add(new Item()); may not be an option. what do you guys suggest?
[11:46:40] *** DroidAgent has quit IRC
[11:46:55] *** graphikz has quit IRC
[11:49:28] *** topriddy_ has joined ##java
[11:49:32] <FauxFaux> dreamreal: Icepush (as part of vaadin), not icefaces itself.
[11:50:00] *** dextro_ has left ##java
[11:51:12] *** topriddy has quit IRC
[11:51:54] *** topriddy has joined ##java
[11:52:32] <topriddy> i may have missed a reply to my question. got disconnected
[11:52:33] *** jjido has joined ##java
[11:53:47] *** topriddy_ has quit IRC
[11:54:15] <dreamreal> FauxFaux: ah
[11:54:33] <dreamreal> topriddy: load it before accessing the collection.
[11:58:33] <topriddy> dreamreal: so i would have to load collection - which depending on the amount of data may have performance probs. A friend thinks i should make the Item* (ie Collection<Item> under Entity) reverse navigable back to Entity, hence i would just do item = new Entity(); item.setEntity(entity)
[11:59:42] *** DroidAgent has joined ##java
[11:59:58] <aLeSD> mitch0: maybe swing is what I am searching for
[12:00:01] <aLeSD> :)
[12:00:17] <platzhirsch> man I dreamed of mapreduce, how I posted in the wrong channel, into this one here and he kicked me out
[12:00:23] <platzhirsch> I definetly need more free time
[12:01:39] <mitch0> swig, not swing
[12:02:14] <aLeSD> ops yers
[12:03:08] *** mastro has joined ##java
[12:03:14] *** wliao has quit IRC
[12:03:26] *** saebbi has quit IRC
[12:05:33] *** jjido has quit IRC
[12:06:57] *** mastroWork has quit IRC
[12:07:03] *** molgrew has joined ##java
[12:07:03] *** pranay_09 has quit IRC
[12:07:19] *** Luc1fel has joined ##java
[12:07:33] *** [[thufir]] has joined ##java
[12:07:33] <Wizard> ping
[12:07:46] <Wizard> is there any possibility to have jdk on linux/arm?
[12:09:12] <dreamreal> of course.
[12:09:25] <FauxFaux> Not the cool jdk, though.
[12:11:44] *** McMAGIC-- has joined ##java
[12:13:21] *** jjido has joined ##java
[12:13:52] *** terranova has joined ##java
[12:16:40] *** [[thufir]] has quit IRC
[12:16:55] *** mastro has quit IRC
[12:17:29] *** Cymage has joined ##java
[12:18:02] *** jjido has quit IRC
[12:18:24] *** rigved has joined ##java
[12:19:07] *** csaba has quit IRC
[12:21:30] *** danmar has left ##java
[12:22:09] *** mastro has joined ##java
[12:24:02] <aLeSD> /join #ubuntu
[12:24:09] <aLeSD> eh eh ... sorry
[12:24:12] *** molgrew has left ##java
[12:26:13] *** jjido has joined ##java
[12:28:14] *** Pinochio has joined ##java
[12:28:15] <hyppias> JAXB, XJC/toString question: http://pastebin.com/7XWUnDBQ
[12:29:39] *** tilerendering has quit IRC
[12:30:38] *** faust45 has quit IRC
[12:30:40] *** jjido has quit IRC
[12:34:19] *** jjido has joined ##java
[12:37:01] *** zemanel has quit IRC
[12:40:40] <hyppias> JAXB, XJC/toString question: http://pastebin.com/7XWUnDBQ
[12:40:48] *** jjido has quit IRC
[12:41:44] <Wizard> dreamreal: openjdk?
[12:42:51] <dreamreal> Wizard: you should be able to build openjdk 6 on your platform
[12:43:40] *** Ch30ps is now known as wvdhaute
[12:43:49] *** Vanek has joined ##java
[12:44:16] *** mastroWork has joined ##java
[12:44:38] <Vanek> Tell me how to connect Intellij class MigLayout?
[12:44:50] *** supercosmonaut has joined ##java
[12:45:12] <dreamreal> would that not be a simple classpath issue?
[12:45:43] <Wizard> dreamreal: the trick is that building openjdk requires openjdk ;P
[12:45:52] <Wizard> for compiling .java files
[12:46:10] <dreamreal> why not compile them on a different machine, then move them if that's what's needed?
[12:46:27] <dreamreal> compile the bits you need in binary, compile externally for the bits that need to be bootstrapped elsewhere...
[12:46:45] <Vanek> dreamreal new JPanel(new MigLayout()); error
[12:46:57] <dreamreal> whatr error?
[12:47:08] <Vanek> cannot find symbol class MigLayout
[12:47:59] *** mastro has quit IRC
[12:48:04] <dreamreal> that would be a classpath issue.
[12:48:45] <dreamreal> you need to download miglayout, whether as a jar or through maven or whatever, then make sure miglayout is in your project's classpath.
[12:49:47] <Wizard> dreamreal: seems like alot of work, but i'll try
[12:50:03] <dreamreal> Wizard: *nod* well, ARM... :)
[12:50:26] *** jjido has joined ##java
[12:52:09] *** bitshuffler has quit IRC
[12:52:20] *** DerHorst has joined ##java
[12:52:44] *** chandan_kumar has quit IRC
[12:53:19] *** supercosmonaut has quit IRC
[12:54:35] *** mastroWork has quit IRC
[12:56:53] *** SpaceDoG has quit IRC
[12:57:52] *** jdolan has joined ##java
[13:01:14] *** jjido has quit IRC
[13:01:37] *** SpaceDoG has joined ##java
[13:02:11] *** Peeter has quit IRC
[13:03:06] *** PigFlu has quit IRC
[13:03:30] <Pinochio> what check do i put in place to make sure that a variable is non-negative
[13:04:22] <dreamreal> Pinochio: if(!(myNumber>0)) { ... }
[13:04:37] <dreamreal> if(myNumber<0) { ... }
[13:04:45] <dreamreal> I mean, really.
[13:05:35] <ronr_> if (myNumber*(-1) > 0) {...}
[13:05:54] *** topriddy_ has joined ##java
[13:06:15] <dreamreal> that's just silly.
[13:06:29] *** cocoloa has joined ##java
[13:06:46] *** davo has joined ##java
[13:07:13] <davo> hi all. i'm having trouble getting this code to generate 600 values. It '
[13:07:14] *** kraucrow has joined ##java
[13:07:23] <jink> Unexpected End of Line.
[13:07:41] *** McFly___80 has joined ##java
[13:07:48] <davo> 'crashes' after 10 or so, http://pastebin.com/SfQUes4a
[13:08:50] *** topriddy has quit IRC
[13:08:51] *** topriddy_ is now known as topriddy
[13:09:03] <dreamreal> maybe you should break it down and show us what line 922 is, as well.
[13:09:26] *** jjido has joined ##java
[13:10:10] <davo> oh sorry, i meant to comment line 922 in the code
[13:11:56] <davo> line 15 is where the line 922 error is: http://pastebin.com/NiqNz09e
[13:12:36] <dreamreal> yeah, break it down, Create the object array separately, for one thing.
[13:13:03] <Pinochio> thankyou dreamreal
[13:14:41] <topriddy> UML + andromda + hibernate + xdoclet generates "shitty codes" => why cant my company see that my hand crafted code is better *sighs* :(
[13:15:03] *** fr0ggler has joined ##java
[13:16:06] *** jjido has quit IRC
[13:18:38] *** _Jorde has quit IRC
[13:18:57] <dreamreal> topriddy: it's all an evil plot to keep you in your place.
[13:20:10] <ronr_> UML? *shudder*
[13:21:36] *** jjido has joined ##java
[13:21:37] *** pipeep has quit IRC
[13:23:13] *** LouisJB has joined ##java
[13:23:18] *** DerHorst has quit IRC
[13:24:21] *** cool123 has joined ##java
[13:26:03] <topriddy> dreamreal: the annoying thing is when writing the demo i implemented it cleanly using Entity + Dao + DaoImpl, full use of Generics lesser codes, and done with Guice for injection all cleanly delivered using Wickets and works! Now am asked to rewrite using company persistence standards, cos that should be more maintainable. Am not convinced HOW
[13:26:18] <dreamreal> studies, man.
[13:26:45] <dreamreal> Talk to an architect, show him how much time you invested, show him how much time it takes to write+maintain the other stuff. Show him live performance metrics.
[13:26:56] <dreamreal> data is your friend.
[13:27:07] <dreamreal> if it's not, then you're wrong anyway.
[13:27:21] <topriddy> dreamreal: i wish i could get something of the net that proves it. It may convince them.
[13:27:26] *** glcrazy has quit IRC
[13:27:31] <dreamreal> the net isn't the place to look.
[13:27:39] <dreamreal> Look in the company you're working for.
[13:27:44] *** la00 has joined ##java
[13:27:51] *** cocoloa has quit IRC
[13:28:17] <la00> hello...basic question: is there any way to do a safe: Integer.parseInt("sgdsdg9897897") ?
[13:28:25] <la00> withou catching the exception
[13:28:25] <dreamreal> if you like, look up mike gualtieri from forrester - he has a lot of posts about how java's dead, 4gls are going to take over ANY DAY now, the decade they've been sitting in the dark sucking has just been preamble.
[13:28:36] <dreamreal> la00: um. No, the exception catching is what makes it "safe."
[13:29:15] <la00> so...no Integer.parseIntORNULLIF FAILS
[13:29:31] <dreamreal> la00: nope. That would be silly anyway.
[13:29:56] <fr0ggler> la00, is catching exceptions really that hard?
[13:29:58] <la00> c.setNumero(Integer.parseInt(strLineSplit[NUM_FRENTE])); Numero is Integer
[13:30:05] <fr0ggler> that's what they're there for after all
[13:30:06] <dreamreal> I understand why you'd want it (well, not really, it's stupid but I'm trying to be kind) but that would lead to amazing failures in most people's code.
[13:30:23] <la00> not hard...to verbose...
[13:30:29] <fr0ggler> ver...bose...
[13:30:38] <dreamreal> la00: you do realise you could always write a method to do that?
[13:30:43] <fr0ggler> 3 lines is verbose?
[13:31:08] <la00> instead of one line
[13:31:15] <davo> i'm creating the Object array separately, any recommendation on how i can get the random numbers to change within the for loop at line 9?
[13:31:16] <la00> need a coulpe ones...
[13:31:18] <dreamreal> public Integer tryToParse(String s) { Integer c=null; try { c=Integer.parseInt(s); } catch(Exception ignored) { } return c; }
[13:31:27] <la00> dreamreal> yeah I know
[13:31:31] <dreamreal> la00: don't be stupid, really. It does you and yours no service.
[13:31:37] <la00> why java doesn't implement it :p
[13:31:41] <davo> http://pastebin.com/pSUCXAMH
[13:31:51] <dreamreal> la00: because nobody except one person on IRC would want it.
[13:32:17] <la00> seems realy useful for web development...
[13:32:20] <dreamreal> davo: break it out.
[13:32:25] *** cool123 has quit IRC
[13:32:33] <dreamreal> la00: no, it doesn't. It seems useful to you, because you have a ridiculous metric to consider.
[13:32:51] <fr0ggler> la00, are you serious
[13:32:54] <dreamreal> If you need it, it's painfully easy to write. (hint: copy/paste the code I wrote earlier.)
[13:33:07] <la00> don't need it...
[13:33:11] <fr0ggler> la00, you're either lazy or a bit retarded
[13:33:17] <dreamreal> la00: don't need what?
[13:33:26] <dreamreal> fr0ggler: be nice. He's not a bit retarded.
[13:33:35] <fr0ggler> la00, if you're *really* that bothered, formulate a feature request and send it Sunacle!
[13:33:58] <dreamreal> It's a pity PushToTest didn't get bought by oracle
[13:34:03] <dreamreal> we could have called it testicle
[13:34:15] <reisi> does anyone know if the 'default hibernate transaction' under spring + "open session in view" configuration could be specified as read only (flushmode = manual)?
[13:34:26] <fr0ggler> "Dear Larry Ellison, Please add loads of methods I could write myself in 10 minutes because the ones you have don't do exactly what I want, but everyone else seems to manage, it's just I'm whinging and can't be bothered to code myself. Cheers, la00"
[13:34:27] <dreamreal> ugh, jpa
[13:34:33] <la00> no time to argue....
[13:34:39] <dreamreal> fr0ggler: don't forget "... and add javax.homework.*!"
[13:35:00] <dreamreal> la00: indeed. Just write a utility method. Move along. What you want isn't present, regardless of whether you want it to be or not.
[13:35:06] <la00> maybe grails has this feature...
[13:35:10] <dreamreal> And let's be real, you're the only... hahahaha
[13:35:11] <dreamreal> oh god
[13:35:16] <dreamreal> yes, maybe grails does
[13:35:24] <dreamreal> please use grails. It has its own channels.
[13:35:36] <dreamreal> la00: thank you, I needed the laugh
[13:36:56] <jink> :P
[13:37:16] <dreamreal> I once worked with a version of Tcl that had "if" and "IF", that acted differently if the expression had a failure or not
[13:37:40] <jink> Sounds like fun. :)
[13:37:41] *** cool123 has joined ##java
[13:37:50] <dreamreal> it was really confusing, encouraged us to use VERY clear fonts. Unfortunately, the editor used did not allow font specification, so we had to copy/paste into editors that did a good bit.
[13:38:00] <jink> Hahaha. :D
[13:38:01] <fr0ggler> sounds like la00 wrote it.
[13:38:23] <dreamreal> (not to mention the bloody "If" which was, naturally, different from "if" and "IF". Thankfully, i don't recall an "iF." That would be a syntax error.)
[13:38:31] <fr0ggler> of course!
[13:38:39] * dreamreal tries to calm the twitching in his eye.
[13:39:55] <dreamreal> I actually put a bounty out for anyone who would actually write up a formal, accepted contract for work that included the phrase that "Vignette StoryServer is shit". I allowed some modifications, but it had to be clear that the assertion was that StoryServer was something that, if it happened to drop from YOUR bum, you'd go to the hospital to have something checked out.
[13:40:07] <jink> Would it really syntax error, or silently fail or do something else?
[13:40:09] <dreamreal> Nobody claimed it, sadly
[13:40:22] *** TheMZ has joined ##java
[13:40:24] <dreamreal> jink: the validation routines would bitch. "Syntax error: if"
[13:40:36] <jink> Ah. :)
[13:40:38] <dreamreal> (Odd fact: validation didn't prevent commit.)
[13:41:19] <dreamreal> storyserver was really cool, if you ... first, had a mostly-static site and not one whose data changed constantly (i.e., like a real estate site's data would. BTW: homes.com.)
[13:41:37] <dreamreal> second, it was really cool if you ignored EVERYTHING about the tech behind it. Now it's done in Java and is MUCH better.
[13:41:40] <TheMZ> I'm creating a BigInteger on both Java and CPP using the same Hex-string. When I pry into their byte-arrays, I'm getting completely different bytes. Any suggestion?
[13:41:46] *** Sliker has joined ##java
[13:42:55] <dreamreal> TheMZ: endianness?
[13:43:11] <TheMZ> Nope, they're not reversed.
[13:43:20] <TheMZ> They're entirely different, this is so strange
[13:43:33] <dreamreal> so give us an example: what would the byte arrays look like for, oh, 125?
[13:43:58] <TheMZ> One moment please ;)
[13:44:15] * dreamreal sighs, disinterested but trying to teach basic triage anyway
[13:45:25] <TheMZ> Ok,
[13:46:12] <TheMZ> Here's the setup:
[13:46:25] *** eyesUnclouded has joined ##java
[13:46:31] <TheMZ> BigInteger N is created from this Hex-string: "894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"
[13:46:41] <TheMZ> CPP: http://img7.imageshack.us/i/examplet.png/
[13:46:49] <TheMZ> Java: 0, -119, 75, 100, 94, -119, -31, 83, 91, -67, -83, 91, -117, 41, 6, 80, 83, 8, 1, -79, -114, -65, -65, 94, -113, -85, 60, -126, -121, 42, 62, -101, -73,
[13:46:59] <TheMZ> (the zero can be ignored though)..
[13:47:54] <TheMZ> wait a minute...
[13:47:55] *** jdolan has quit IRC
[13:47:59] <TheMZ> oh man.
[13:48:12] <TheMZ> Gee I'm so sorry
[13:48:19] <TheMZ> they really are reversed...
[13:49:00] <TheMZ> Gah! this is ridiculous. I haven't slept in like a week now. Sorry mate.
[13:49:36] *** aaron11 has quit IRC
[13:49:59] *** SamuraiAlba has joined ##java
[13:50:24] <SamuraiAlba> good coffee to all!
[13:50:49] * SamuraiAlba sets up the Keurig coffe maker, and sets out Donut Shop, Caramel Vanilla Creme, Pumpkin Spice, and Cafe' Mocha.
[13:51:01] <SamuraiAlba> *coffee
[13:51:03] <TheMZ> :D
[13:51:16] <SamuraiAlba> I'm new to Java
[13:51:35] *** mastroDani has joined ##java
[13:51:37] <SamuraiAlba> I was thinking of finally getting off my duff, learning to program, and making some money in the market. Any suggested reading?
[13:53:43] *** bitshuffler has joined ##java
[13:54:07] <TheMZ> I don't happen to know any books in English
[13:54:32] <TheMZ> I use Oracle's online tutorials and Javadoc alot
[13:55:43] *** whaley has joined ##java
[13:56:31] <aLeSD> dreamreal, I have a doubt
[13:56:51] <aLeSD> I compliled my c lib for the ARM arch with my toolchain
[13:57:00] <aLeSD> ops
[13:57:04] *** TheMZ has quit IRC
[13:57:06] <aLeSD> nevermind
[13:57:09] <SamuraiAlba> lol
[13:57:57] *** jjido has quit IRC
[13:58:23] <Candle> SamuraiAlba: For Java? There are plenty of tutorials available, a somple search will return quite a lot.
[13:58:31] <Candle> *simple search
[13:58:33] *** rgr has quit IRC
[13:59:59] *** Xeli has joined ##java
[14:01:52] *** Johannes13 has joined ##java
[14:01:58] *** platzhirsch has left ##java
[14:02:10] *** Fuco has joined ##java
[14:02:15] <la00> http://msmvps.com/blogs/deborahk/archive/2009/08/11/tryparse.aspx <- not the only lazy out there
[14:02:50] *** Indigenous has joined ##java
[14:02:53] *** [[thufir]] has joined ##java
[14:04:08] *** nikolavp has joined ##java
[14:05:07] *** jjido has joined ##java
[14:11:45] *** jjido has quit IRC
[14:13:11] *** tktiddle has joined ##java
[14:13:36] <tktiddle> is it possible to impliment more than one interface?
[14:14:11] <lf94> most definitely
[14:14:12] <lf94> not
[14:14:15] <lf94> (no clue)
[14:14:38] *** coalado has quit IRC
[14:14:46] <tktiddle> another thing.. whats the acess modifier to only allow objects in the same package to modify?
[14:14:47] <paulweb515> ~~ tktiddle tias
[14:14:47] <javabot> tktiddle, Try it and see. You learn much more by experimentation than by asking without having even tried.
[14:15:10] *** coalado has joined ##java
[14:15:24] <davo> dreamreal: is this similar to what you meant by breaking it up?
[14:16:54] <nikolavp> tktiddle: no modifier is package protected
[14:17:55] <davo> http://pastebin.com/tkDjc9ZQ
[14:18:02] *** matsebc has quit IRC
[14:18:22] *** Cymage has quit IRC
[14:18:45] <tktiddle> thanks
[14:19:24] *** matsebc has joined ##java
[14:19:40] *** michelem has joined ##java
[14:19:52] <nikolavp> new Boolean(TRUE) is so inefficient, please something else.
[14:19:59] <nikolavp> use*
[14:20:12] *** saby has joined ##java
[14:20:14] <saby> hi
[14:20:26] <nikolavp> use either Boolean.valueOf or Boolean.<constant>
[14:21:28] <saby> i have a project which i am running using eclipse and it uses the mysql connector and its running perfectly, but after i created a jar file of the project and when i run it, it gives the error "error: No suitable driver found for jdbc:mysql://localhost/tweet_db"
[14:21:46] <saby> i have also pasted the mysql connector jar in the same directory as the project
[14:21:51] <saby> *jar files
[14:21:58] *** kalusn has joined ##java
[14:22:04] <whaley> ~~ saby classpath
[14:22:05] <javabot> saby, The classpath tells Java or the compiler in which jar files and folders to look for classes and resources. Use the -cp/-classpath run-time options to specify the classpath (does NOT work with -jar!). Also see http://is.gd/j4gM [sun.com] for more info. If you're on windows see: http://is.gd/9qq26 [sun.com].
[14:22:08] <nikolavp> and how do u "run it"
[14:22:35] <saby> thanx whaley, will check it
[14:22:41] <davo> it's part of a large package of classes nikolavp
[14:22:44] <whaley> saby: just putting the .jar in the same directory does nothing - the mysql .jar needs to be explicitely on the classpath
[14:22:57] <saby> in the class path in the manifest ?
[14:23:05] <whaley> saby: it can be, yes
[14:23:14] <saby> or in the environment variables of windows ?
[14:23:24] <nikolavp> or with java -cp
[14:23:38] <whaley> saby: most commonly it is specified with the -cp parameter to java(.exe)
[14:24:04] <saby> lets say the name of my project is abc.jar & mysql-connector.jar
[14:24:12] <saby> so i need to pass
[14:24:13] *** pfrog has joined ##java
[14:24:28] <pfrog> is there a really nice java library for doing visualization/plotting/graphing?
[14:24:39] <saby> java -jar abc.jar -cp C:/users/saby/project/mysql-connector.jar ?
[14:24:50] <whaley> java -cp abc.jar;mysql-connector.jar your.main.class.Here
[14:24:54] <michelem> hello folks
[14:25:10] <saby> thank you whaley will try this
[14:25:20] <fr0ggler> pfrog, jfreechart can generate some nice plots. what are you after?
[14:25:23] <whaley> saby: try that and see... I haven't used -jar in about 4 years so I don't remember if that works or not :)
[14:25:46] <michelem> I'm trying to figure out which JRE implementation to go for on a tomcat server (FreeBSD). There's mainly Sun's JDK and OpenJDK. I mostly care about stability, second performance. Which do you recommend?
[14:25:53] <pfrog> plotting millions of points in a sane way
[14:26:02] *** GreYFoXGTi has joined ##java
[14:26:05] *** kriko has joined ##java
[14:26:12] <saby> whaley should i just give the name of the package in which the main class is ?
[14:26:34] *** coalado has quit IRC
[14:26:51] <whaley> saby: no, you have to specify the fully qualified name of your class that has a "static public void main(String[] args)" method
[14:27:01] <saby> ah arlight :)
[14:27:31] *** coalado has joined ##java
[14:27:47] *** jonkri has quit IRC
[14:28:28] *** glcrazy has joined ##java
[14:29:21] *** GreYFoXGTi has quit IRC
[14:29:25] <tktiddle> if i have sub packages like 'example.ex' is it possible to set access modifiers so ony classes in package 'example' and 'example.ex' have access?
[14:30:57] *** Dux has quit IRC
[14:30:57] *** pfrog has quit IRC
[14:30:59] <paulweb515> tktiddle: not with access modifiers
[14:32:13] <tktiddle> paulweb515: but possible?
[14:32:48] <saby> thanx whaley it works
[14:32:49] <saby> :)
[14:32:59] <saby> thank you so much for your help :)
[14:33:03] <paulweb515> tktiddle: not with the java SDK, but with container based libraries (but they add extra restrictions as well)
[14:33:16] <paulweb515> tktiddle: what are you trying to do, anyway?
[14:33:30] <tktiddle> just trying to design a program!
[14:33:50] <tktiddle> trying to figure out the best way to do things in java
[14:34:28] *** Sliker has quit IRC
[14:34:40] <tktiddle> Does anyone have any links for OO design?
[14:34:43] <paulweb515> tktiddle: the best way to do "what" ... the best way to fool around with access modifiers is to *not* fool around with access modifiers
[14:34:44] <ojacobson> tktiddle: Think less in terms of enforcing limits and more in terms of implementing things so that they behave correctly (in context) regardless of how they're called.
[14:35:27] <nikolavp> tktiddle: most of the time it is a nice idea to just design and start from private modifiers
[14:35:32] *** tissue has quit IRC
[14:35:56] *** kebomix has joined ##java
[14:36:09] <nikolavp> if u need to be able to see something - provide an a method or just change visibility.
[14:36:17] <nikolavp> lal
[14:36:28] * nikolavp sad there is no edit in IRC
[14:36:50] <kebomix> anybody tell me why when i call drawGrid() it draws and when i call clear() it doesn't clear the image ? http://pastebin.com/ntvZvHhp
[14:37:03] <tktiddle> sometimes it is nicer not to use get and set though if you just have a little data class, but it would be nice to restrict the classes that can access the data class.. Prehaps I should use inner class?
[14:39:02] <tktiddle> i.e i have a class Particle that has "private Cartesian position;" its nice to be able to just do position.x from in Particle.
[14:39:09] *** mastroWork has joined ##java
[14:39:29] <ronr_> is there a standard way to define annotation processors? I understand how to run them, but I wonder if there's a standard way that let's say if I take a project and move it between different IDEs (and build them from within), it'd run the APs without me having to define those differently at those IDEs.
[14:39:37] <ojacobson> Why would Particle care about the specific components of its position?
[14:39:58] <ojacobson> ronr_: The compiler uses SPI to discover annotation processors at compile time
[14:40:05] <ojacobson> If your IDE doesn't respect that, get a better IDE
[14:40:37] <ronr_> the compiler uses SPI to discover annotation processors? really? hmm.
[14:41:22] <ojacobson> Discovery is documented at
[14:41:27] <ojacobson> ~javadoc javax.annotation.processing.Processors
[14:41:28] <javabot> I don't know of any documentation for javax.annotation.processing.Processors
[14:41:29] <ojacobson> ~javadoc javax.annotation.processing.Processor
[14:41:30] <javabot> ojacobson: http://is.gd/aEH0eH [JDK: javax.annotation.processing.Processor]
[14:41:35] <tktiddle> ojacobson: thats quite insightful
[14:41:37] <tktiddle> :)
[14:41:40] <ojacobson> iirc
[14:41:47] *** surial has joined ##java
[14:42:05] <ojacobson> tktiddle: the point of types is to use the values of those types en bloc most of the time
[14:42:10] *** f_kafka has joined ##java
[14:42:25] <ojacobson> destructuring a "plain old data" type like a point back to its components wastes a lot of the potential expressiveness of having a point type in the first place
[14:42:43] *** mastroDani has quit IRC
[14:43:07] *** la00 has quit IRC
[14:43:14] <ojacobson> I wouldn't make the individual components accessible anyways, unless they were final (in which case it matters less), because data types like that should be immutable and you can't enforce that via public non-final fields
[14:43:23] <ojacobson> er, implement that via? something
[14:43:33] <f_kafka> i've got a question... lets say i got: int i = 3; | double x; | x = 10 / i ..... will it be legal?
[14:43:36] *** VJTachyon has joined ##java
[14:43:37] <ronr_> ojacobson: I don't see anything about spi there.. nor in:
[14:43:44] <ronr_> ~annotation processing
[14:43:44] <javabot> ronr_, annotation processing is done by java compilers; they look for annotation processors on the classpath, and then let themlook at source files as they are compiled, and optionally create new files and sources. Quick getting started tutorial: http://blogs.sun.com/darcy/entry/jsr_269_in_mustang_build and API: http://bit.ly/ap-api
[14:43:49] <tktiddle> ojacobson: thanks your a good teacher!
[14:43:52] <ojacobson> "The tool uses a discovery process to find annotation processors and decide whether or not they should be run. By configuring the tool, the set of potential processors can be controlled. For example, for a JavaCompiler the list of candidate processors to run can be set directly or controlled by a search path used for a service-style lookup."
[14:44:09] <ronr_> hmm.
[14:44:13] * ronr_ is blind.
[14:44:22] <ojacobson> ronr_: you are in a maze of twisty little links, all alike
[14:44:37] <ronr_> blame the bot there, not me.
[14:44:39] <ronr_> :p
[14:44:39] *** Quantum_Ion has joined ##java
[14:44:56] <f_kafka> i mean x is double... i can recieve 3.3333.... right? question is can it recieve it by deviding a number with an int
[14:44:59] <f_kafka> ?
[14:45:22] <ojacobson> ronr_: a noddy working example: https://bitbucket.org/ojacobson/todo-annotations/
[14:45:39] <ojacobson> http://alchemy.grimoire.ca/m2/sites/ca.grimoire/todo-annotations/
[14:45:41] <ronr_> noddy?
[14:45:52] <ojacobson> trivial and not very meaningful
[14:45:57] <ronr_> k :)
[14:46:41] *** arborist has joined ##java
[14:47:09] <surial> f_kafka: "Can it receive it"?
[14:47:29] <surial> f_kafka: A double can never be 3.33333333333 endlessly repeating. It's not exact. It'll be 3.333333333333334813491234 or some such.
[14:47:41] <ronr_> ojacobson: so it should be fairly easy if the project is a maven project.
[14:47:50] *** Fisiu has joined ##java
[14:48:04] *** Quantum_Ion has quit IRC
[14:48:15] <f_kafka> yes oki
[14:48:21] <surial> f_kafka: And all numeric math is either between 2 integers and is thus integer math with rounding (always round towards 0, i.e. chop off the decimals), or between 2 doubles. Attempting to do numeric math between an integer and a double will result in first the integer being cast to a double (silently if need be).
[14:48:33] <surial> so 1/3 is 0, but 1.0/3 is 0.333333333334123431241
[14:48:58] <surial> as the first one is 2 integers and thus gets you integer division, but the second one is equivalent to 1.0/(double)3 which is 1.0/3.0 which is double math.
[14:49:33] <f_kafka> ok lets say it was: int i = 4; | double x; | x = 10 / i
[14:49:33] *** Matuku has joined ##java
[14:49:45] *** Cymage has joined ##java
[14:49:46] <f_kafka> is that legal? will it accept it?
[14:50:24] <ojacobson> (10 / i) will be evaluated using integer arithmetic, then the result of that will be promoted to a double, then that double will be assigned to x
[14:50:30] *** Ven]n has joined ##java
[14:50:34] <ojacobson> in this case resulting in x == 2.0
[14:50:39] *** eyesUnclouded has quit IRC
[14:50:49] <Ven]n> How do I add something to windows registry from my java application? And to be able to remove it afterwards from the program.
[14:50:49] *** kebomix has left ##java
[14:50:50] <f_kafka> 10 / 4 = 2.5?
[14:50:57] <ojacobson> No.
[14:51:00] <f_kafka> oh?
[14:51:04] <ojacobson> 10.0 / 4.0 is 2.5. 10 / 4 is 2.
[14:51:22] <f_kafka> ohhhhh
[14:51:24] <f_kafka> now i get it
[14:51:31] <ojacobson> Integer arithmetic never evaluates to anything but an integer.
[14:52:02] <f_kafka> so i wont get the answer i need by using and int that will result in a double expression
[14:52:10] *** eyesUnclouded has joined ##java
[14:52:13] *** alanic has joined ##java
[14:52:16] <f_kafka> *an int
[14:52:40] <alanic> anyone have stackoverflow careers 2.0 invites to spare? :)
[14:53:59] *** matsebc has quit IRC
[14:56:57] *** matsebc has joined ##java
[14:57:44] *** aLeSD has quit IRC
[15:03:17] *** [SkiD] has joined ##java
[15:03:33] <ronr_> ojacobson: you're an intellij advocate, no?
[15:03:34] *** jdolan has joined ##java
[15:03:53] <ojacobson> I'm generally not an IDE advocate at all
[15:03:56] <topriddy> m]
[15:04:16] <reisi> Ven]n: i really hope no-one has implemented any registry support for java
[15:04:26] *** L-----D has quit IRC
[15:05:16] <ojacobson> reisi: It exists. Most of the variations i've seen either use JNA/JNI (the right way) or reach into sun. classes (the wrong way).
[15:06:34] *** kriko has quit IRC
[15:06:35] *** mastroWork has quit IRC
[15:06:46] <ronr_> ojacobson: hmpf. doesn't seem to work with the IDE :-/
[15:07:47] <ronr_> nice... now I noticed that the AP has a services dir in it. cool.
[15:07:55] <ronr_> too bad it doesn't work.
[15:09:21] <davo> any advice, something obviously wrong to get *new* random numbers generated for each Object? http://pastebin.com/vmuf5YiF
[15:10:27] <cheeser> um. no.
[15:10:49] <cheeser> if you want to reuse the same random number on each line, then call Math.random() once and save it in a var
[15:11:10] <cheeser> and maybe consider using randomGenerator that you declare up top
[15:11:37] *** mastroWork has joined ##java
[15:11:40] <cheeser> but other than that, your question doesn't really make much sense to me.
[15:11:44] <surial> davo: Read the docs. Creating a new Random instance using "new Random()" randomizes the seed.
[15:11:55] <surial> davo: If you want the exact same sequence of random numbers, use the new Random(long seed) constructor.
[15:11:58] <ojacobson> Too bad he never uses that Random instance
[15:12:06] <surial> Oh, er, and there's that.
[15:12:16] <ojacobson> (if he did, he wouldn't need the bizarro floating point arithmetic, either... :)
[15:12:22] *** topriddy1 has joined ##java
[15:12:30] <surial> davo: And use your random instance. Making one and then calling Math.random() does absolutely nothing. the syntax is: random.nextInt(60) + 1. Note that Math.random() * 60 isn't as random as you think it is.
[15:12:32] *** Tyred has quit IRC
[15:13:01] <surial> Also..
[15:13:02] <Ven]n> reisi: I want my program to add to the windows context menu
[15:13:02] <surial> ~~ davo homework
[15:13:02] <javabot> davo, Homework is meant to be done by YOU, so that YOU learn something. Stop cheating; we don't like doing our own, why should we do yours? Also, answering homework questions is extremely frustrating. See "~why no homework" for more reasons why we won't answer your questions.
[15:13:36] <surial> Ven]n: That's a registry thing and beyond the scope of this channel. Once you know which keys to fiddle with, asking how to do so in java is appropriate.
[15:13:55] <surial> Ven]n: I'll give you a hint, though: Bundle up your java app into an exe using launch4j.
[15:14:25] <Ven]n> I know what to add in registry
[15:15:15] *** Luc1fel has quit IRC
[15:15:45] <Ven]n> but I was thinking having buttons in my java program that added and removed things from registry
[15:16:59] *** homie has quit IRC
[15:17:11] <surial> That can be done.
[15:17:14] <surial> ~registry
[15:17:14] <javabot> surial, what does that even *mean*?
[15:17:17] <surial> shame.
[15:17:24] <surial> ~g windows registry java
[15:17:24] <javabot> http://www.google.com/search?q=windows+registry+java
[15:17:26] <FauxFaux> Appropriate.
[15:17:44] <surial> ~jregistrykey
[15:17:44] <javabot> surial, what does that even *mean*?
[15:18:05] <surial> ~jregistrykey is an API to read and write to the windows registry for java. http://sourceforge.net/projects/jregistrykey/
[15:18:05] <javabot> OK, surial.
[15:18:06] *** Pinochio has left ##java
[15:18:10] <surial> ~registry is <see>jregistrykey
[15:18:10] <javabot> OK, surial.
[15:18:14] <surial> ~~ Ven]n registry
[15:18:15] <javabot> Ven]n, jregistrykey is an API to read and write to the windows registry for java. http://sourceforge.net/projects/jregistrykey/
[15:18:15] <surial> ~next
[15:18:16] <javabot> Another satisfied customer. Next!
[15:18:30] *** Pinochio has joined ##java
[15:18:30] <Ven]n> thank you
[15:18:50] <surial> You're welcome :)
[15:19:00] <Pinochio> anyone got time to go over a couple of fundamentals with me, complete nooby with java :)
[15:19:09] <mitch0> read a book
[15:19:14] *** Versuchen has quit IRC
[15:19:26] <Pinochio> ..
[15:19:41] <surial> Pinochio: You can try. Success not guaranteed, as newbie questions tend to be quite boring and as java is the go-to language for first steps at many universities, we get rather a lot of them.
[15:20:12] *** platzhirsch has joined ##java
[15:20:14] *** platzhirsch has left ##java
[15:21:18] <Pinochio> very understandable, just looking for someone that has got time to have a quick glance rather than boring the whole chat room
[15:22:12] *** c_axis has joined ##java
[15:22:48] *** MikeJansen has joined ##java
[15:23:18] <davo> surial: thanks. i did what you said and it's generating new random data for each run. the problem i'm having is that i'm calling the Object multiple times and assigning the same "new" random data to say 60 of the same type object, when i want each object to have different random data. any suggestion?
[15:23:26] *** aLeSD has joined ##java
[15:23:39] <surial> davo: First, start to make sense.
[15:23:54] <surial> "calling the Object"? You call methods, not objects.
[15:24:15] <ojacobson> davo: your code is written to do exactly as you describved
[15:24:36] <surial> davo: A good first step is to post a COMPLETE test case (including 'public class' and all that, not just a snippet), and include what you EXPECT should happen and what ACTUALLY happens. If you pastebin all that, we might be able to help.
[15:25:09] *** drindt has quit IRC
[15:25:29] <davo> i would but i have several large packages implementing this project, not sure how i could scale it down to a testcase size
[15:26:00] *** whaley has quit IRC
[15:26:13] *** EricInBNE has joined ##java
[15:26:22] *** homie has joined ##java
[15:26:38] *** whaley has joined ##java
[15:26:38] <ronr_> ojacobson: just found out my IDE doesn't support it. yay.
[15:26:52] <surial> You don't know how to scale this down to testcase size? Er, then all the advice I can give you is to start from scratch at the first cup tutorial. This looks like it can be trivially testcased.
[15:27:34] <EricInBNE> I have a java app, single threaded, concatenates a bunch of pdfs into a huge pdf using iText. Works ok on a small - mediumish number of files, but not on alot of files.
[15:27:47] <EricInBNE> pretty confident im closing and flushing in the right places
[15:28:15] *** Iask2ask has joined ##java
[15:28:16] *** saml has joined ##java
[15:28:45] <ronr_> ojacobson: nevertheless, thank you for bringing the spi-support for APs to my attention.
[15:28:49] <EricInBNE> what are my options?
[15:28:53] <cheeser> ~~ EricInBNE doesn't work
[15:28:53] <javabot> EricInBNE, doesn't work is useless. Tell us what it is, what you want it to do, and what it is doing. Consider putting some code and any errors on a pastebin. (use ~pastebin for suggestions)
[15:29:00] <ojacobson> ronr_: cheers
[15:29:11] *** dwilliamii has joined ##java
[15:29:18] <ojacobson> It's ultimately up to the compiler vendor
[15:29:33] <ojacobson> if your compiler isn't javac(1) from the JDK, you're somewhat at the mercy of whoever wrote it
[15:29:55] <EricInBNE> What it is -> Pdf concatenator, What I want it to do -> Work on alot of files What it is doing -> Works on a small number of files, but not alot.
[15:29:58] <ojacobson> javac(1) itself (as well as the compiler APIs) provide some standard ways to bolt tooling to the compiler, but not everyone's figured that out :)
[15:30:19] <cheeser> EricInBNE: that says nothing about what the failure looks like.
[15:30:24] *** Cymage has quit IRC
[15:30:28] <ronr_> well, they state their reasoning as to why they don't do it.
[15:30:29] <EricInBNE> im getting no failure
[15:30:31] <cheeser> does it hang? throw an exception? reboot your machine? catch fire?
[15:30:32] <ojacobson> ~alot is better than you: http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html
[15:30:32] <javabot> I already have a factoid named alot, ojacobson
[15:30:35] <ojacobson> ~alot
[15:30:35] <javabot> ojacobson, alot is http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-everything.html
[15:30:46] <cheeser> ojacobson: doh!
[15:30:46] <cheeser> 8^)=
[15:30:52] <ojacobson> Pre-empted :D
[15:30:52] <EricInBNE> cheeser, it just starts putting blank pages in the pdf
[15:31:03] <cheeser> weird
[15:31:12] *** cocoloa has joined ##java
[15:31:12] <cheeser> might be an itext bug.
[15:31:24] <cheeser> try closing both PDFs after each file.
[15:31:36] <EricInBNE> yeah i am
[15:31:45] <Iask2ask> Can anyone tell me the intended use of attach and attachment (methods) in SelectionKey?
[15:32:13] *** RLa has joined ##java
[15:32:15] <cheeser> Iask2ask: it's a way to provide a context object or meta data for the channel
[15:32:17] <cheeser> or key
[15:33:51] <Iask2ask> Is the usage dependent on what type of IO the channel/key is connected to?
[15:34:36] *** EricInBNE has quit IRC
[15:36:18] <davo> surial: is this even close to qualify as a test case? http://ideone.com/IJxFK
[15:37:13] *** caverdude has joined ##java
[15:37:14] *** chl5011 has joined ##java
[15:37:42] *** Cymage has joined ##java
[15:37:43] <Iask2ask> that syntax doesn't look valid to me at all
[15:38:10] <FauxFaux> Nice attemp, though.
[15:38:28] <surial> davo: Here's a hint: If it doesn't even compile, then, no.
[15:38:30] <cheeser> clearly not valid
[15:38:34] *** jesmon has joined ##java
[15:39:04] <davo> ok
[15:39:32] *** asfdd has quit IRC
[15:39:51] *** TheBeerinator has joined ##java
[15:39:56] *** gtrak has joined ##java
[15:40:39] *** mastro has joined ##java
[15:44:10] *** mastroWork has quit IRC
[15:44:37] <Iask2ask> It's definitely missing the start and the end of a method.
[15:44:40] *** gtrak has quit IRC
[15:46:14] *** chl5011 has left ##java
[15:46:42] <balooo> EricInBNE: Have you tried with a small number of very large pdfs (say three)? Does that fail?
[15:47:28] *** eschnou has joined ##java
[15:47:42] *** eschnou has left ##java
[15:48:42] *** jtheuer has joined ##java
[15:50:37] <davo> am i just missing some libraries to complete the test case or is it way more than that? :-/
[15:51:01] *** Pinochio has quit IRC
[15:51:36] <Iask2ask> yes, a library containing beggining java, java 101 and learn java in 14 days.
[15:52:31] <bulltwang_> davo: homework?
[15:52:44] <ojacobson> Iask2ask: tsk.
[15:53:28] *** Veritto has joined ##java
[15:53:29] <ojacobson> davo: The underlying point is that providing a complete, *short, runnable example is way more useful than a random stretch of code devoid of context. While it's fairly obvious what the problem is here, since we can't see what you see, we're mostly operating by guesswork rather than fact if we follow up on that "obvious" thing.
[15:53:41] *** gtrak has joined ##java
[15:53:44] <Iask2ask> davo that main thing you are missing is the concept of the relation to classes and methods, basically, classes contain all of your methods and functions
[15:54:02] <davo> bulltwang_: i guess you could call it a project that i'm working on at home yes
[15:54:31] <Iask2ask> you're training the class as a method/procedure/function
[15:54:45] <Iask2ask> treating*
[15:54:46] *** gtrak has quit IRC
[15:55:10] <davo> ah yes
[15:55:22] <bulltwang_> davo: Iask2ask is right, the first thing you are gonna need is to put that into a method of some sorts.
[15:55:36] * bulltwang_ ***dough stupid lag
[15:56:17] *** gremmachook has joined ##java
[15:56:42] <Iask2ask> Also under the standard naming convention for classes yours should be called Main (camel case with all words capitalised) and the file Main.java
[15:57:01] *** tigger0jk has quit IRC
[15:57:09] *** gtrak has joined ##java
[15:58:16] <bulltwang_> has anyone here used the GWT designer yet?
[15:58:39] <bulltwang_> having trouble with eclipse to install it, rather not if is not worth it....
[15:59:47] *** abhijain has joined ##java
[16:00:06] *** sbalmos has joined ##java
[16:00:31] *** [[thufir]] has quit IRC
[16:00:43] <surial> To be perfectly honest, the real problem appears to be that davo doesn't actually know much about java and has been asked to work on a project that's way above his head.
[16:01:38] *** realtime has joined ##java
[16:01:51] <davo> fair enough surial ;)
[16:02:05] <surial> We have links to some excellent tutorials if you want to learn.
[16:02:49] *** cbeust has joined ##java
[16:03:02] *** gremmachook has quit IRC
[16:03:04] *** mastroWork has joined ##java
[16:03:12] <davo> the topic link javachannel.net for starters
[16:03:50] *** tktiddle has quit IRC
[16:04:04] *** c_axis has quit IRC
[16:05:49] *** Iask2ask has quit IRC
[16:06:40] *** mastro has quit IRC
[16:07:21] <RLa> can you use jsp to generate any text format document, not just html?
[16:08:01] *** maxorator has joined ##java
[16:08:24] <ronr_> yes.
[16:11:07] *** khasathan has joined ##java
[16:11:51] <RLa> ronr_, what standalone jsp libs would you recommend
[16:12:06] <ronr_> RLa: I wouldn't.
[16:12:35] <RLa> hm, i would need library to generate some text docs
[16:12:45] <mitch0> rla: http://freemarker.sourceforge.net/
[16:12:51] <RLa> from plain java objects
[16:13:01] <surial> RLa: Don't do that. If you're looking for a templating tool, look at for example velocity. Note that mixing code and non-code is a horrible idea; the appropriate way to do it is to have very simple (i.e. loop, if, include, and insert-value) template commands and then have code supply the data.
[16:13:05] <surial> ~ velocity
[16:13:05] <javabot> surial, velocity is http://velocity.apache.org
[16:14:20] *** bduncan has joined ##java
[16:15:22] *** meling has quit IRC
[16:15:34] <RLa> looks like both freemarker and velocity are suitable
[16:16:20] *** alanic has quit IRC
[16:16:33] <ronr_> RLa: sorry for not helping more, not really a web developer.
[16:17:07] <RLa> i'm not using it for web
[16:17:24] <RLa> i need to generate some c++ code from complex excel files
[16:18:08] <ronr_> right, but JSP is web technology :)
[16:19:32] *** Kamaran has joined ##java
[16:19:55] *** mastroWork has quit IRC
[16:20:12] <RLa> now, if i could find freemaker and velocity syntax comparison
[16:20:33] <khasathan> Hello, everybody. I 'm developed java program for get email data. My program connect Gmail inbox via SMTP and the program can get email data and attachment but down large attachment (i.e.image size > 3Mb) too slow.
[16:21:36] <RLa> maybe your internet connection is too slow
[16:22:45] <khasathan> RLa: problem cause is I/O. can i increasing performance?
[16:23:04] <RLa> buy faster internet connection :)
[16:23:27] *** Luc1fel has joined ##java
[16:24:21] <bulltwang_> khasathan: you get any errors, or is it just very slow??
[16:24:29] <RLa> hm, freemarker uses valid xml as syntax?
[16:24:40] *** cool123 has quit IRC
[16:25:45] *** topriddy1 has quit IRC
[16:25:47] *** topriddy has quit IRC
[16:26:02] <khasathan> bulltwang_ : no error, my program read binary to byte array.
[16:27:03] <RLa> first you should say what is your current internet connection speed and how fast you expect the file to be downloaded
[16:27:11] <khasathan> bulltwang_ : attachment file is binary such as image file
[16:27:20] <RLa> smtp is binary protocol?
[16:27:34] <RLa> or you mean pop3?
[16:27:45] <RLa> wasn't smtp for sending
[16:27:55] *** moai has joined ##java
[16:27:59] *** BoF has joined ##java
[16:28:11] <ojacobson> "i need to generate some c++ code from complex excel files" is going to give me nightmares tonight, for the record
[16:28:13] <khasathan> RLa: sorry, i used IMAP :p
[16:28:31] <sbalmos> ojacobson: O_o
[16:28:32] *** mastroDani has joined ##java
[16:28:49] <RLa> ojacobson, manually coding it much worse
[16:28:53] <jtheuer> yeah, excel suckz ;-)
[16:29:00] <Candle> ojacobson: extracting the buisness logic and algorithms from it?
[16:29:07] * ojacobson points up-thread.
[16:29:14] <ojacobson> Not my problem, thankfully
[16:29:34] <RLa> Candle, yes, it generates some switches and object tree creation
[16:30:01] <whaley> does junit's Assert.assertEquals(Object,Object) test for symmetric equivalence?
[16:30:23] <whaley> and yes I'm too lazy to look at the source :P
[16:30:33] *** yxz97 has joined ##java
[16:30:48] <ojacobson> whaley: I wouldn't count on it
[16:30:57] <ojacobson> but surely you have tests to ensure that your .equals methods are commutative
[16:31:46] <Candle> ojacobson: ah, hrm. yes. RLa: good luck!
[16:31:46] *** Mooniac has joined ##java
[16:31:54] *** topriddy has joined ##java
[16:32:13] <Mooniac> Is Java Web Start still active? All I find on the web for it is old web pages. Was it discontinued?
[16:32:21] <ojacobson> ~jws
[16:32:21] <javabot> jws aka javaws aka webstart aka jnlp (Java Network Launching Protocol) is a web-based java app deployment mechanism that is better than applets because it removes browser incompatibility hell. You can run any app as normal, via its main() entry point. For tech guide see http://bit.ly/bQqkI9 and for product overview see http://bit.ly/aYUQKq (javaws is free and included with java).
[16:32:25] <whaley> ojacobson: it doesn't - and this is a fresh batch of tests and I forgot to write tests for testing .equals and got burned :)
[16:32:25] *** riotz has joined ##java
[16:32:26] <khasathan> RLa, bulltwang_: my internet connection is normally. internet speed is dl/up 0.79/o.79 Mbps
[16:32:33] <ojacobson> whaley: tsk :D
[16:32:41] <whaley> ojacobson: shame shame
[16:33:05] <ojacobson> Mine tend to look like {assertTrue(a.equals(b)); assertTrue(b.equals(a)); assertEquals(a.hashCode(), b.hashCode()) followed by several != cases (which do not exercise hashCode
[16:33:36] <RLa> khasathan, so that's about 0.079 MB/s, 3MB file takes 38 seconds then
[16:33:39] *** cbeust has quit IRC
[16:34:01] <FauxFaux> Test that was failing 55% of the time this morning has just passed six times in a row, and I still have no idea what's wrong.
[16:34:07] <FauxFaux> That's not the right channel.
[16:34:20] *** cbeust has joined ##java
[16:35:15] <RLa> khasathan, i'm not sure how imap encodes files or whether it compresses them, so it might take even 2-3x longer because of overhead of encoding binary as text
[16:35:33] <khasathan> RLa: no, 0.79Mbps (~789Kbps)
[16:35:39] <Mooniac> Does anyone know of a good tutorial how to call Java Swing components from a .jsp file? I want to hook up Swing with .jsp.
[16:35:56] <RLa> khasathan, make sure you know differences between bits and bytes
[16:36:22] <ojacobson> Mooniac: JSP files and Swing don't generally run in the same VM or even on the same host
[16:36:37] <ojacobson> JSP files are evaluated inside a web container on a server; Swing is run in a desktop app running on the user's computer
[16:36:58] <ojacobson> You can embed JWS apps, applets (ick), or some kinds of GUI beans into JSP pages, but they're run separately via a client-side plugin
[16:37:03] <Mooniac> I know, but I read on a website that it's possible to embed all Swing components through a .jsp.
[16:37:07] *** lapice has joined ##java
[16:37:12] <ojacobson> it's on the internet - it must be true!
[16:37:13] <whaley> i'm not sure why anyone lets me write code, tbh
[16:37:23] <ojacobson> whaley: We can't be arsed to stop you
[16:37:31] <cheeser> it's funny and we're bored.
[16:37:38] <whaley> poor excuses, both of you
[16:37:56] <sbalmos> whaley: Your code ends up being halfway-usable more often than most other outsourced monkeys?
[16:38:07] <Mooniac> Does anyone know of a tutorial how to embed Swing components in a .jsp?
[16:38:20] <FauxFaux> Yes, ask again, that'll work.
[16:38:24] <whaley> sbalmos: quaterway-usable, but yeah
[16:38:32] <ojacobson> Don't like the answer? Wait thirty seconds and retry.
[16:38:39] <FauxFaux> ojacobson: Yes, ask again, that'll work.
[16:38:56] <bulltwang_> Mooniac: http://java-source.net/open-source/web-frameworks/wings
[16:39:09] <bulltwang_> I think thats something you are looking for...
[16:39:23] <sbalmos> Sure, let's stab in the dark
[16:39:26] <Mooniac> bulltwang_: Thanks, that's great.
[16:39:35] <Mooniac> I'll peruse.
[16:39:57] <ojacobson> Mooniac: What, exactly, would a JPanel look like embedded within a web page? (Remember that the only thing a browser sees from a JSP is the resulting HTML - it has no idea that it came from a JSP)
[16:40:36] <Mooniac> Why do you think I don't know that?
[16:40:45] <ojacobson> Because your question is predicated on pretending that that's not true.
[16:40:51] <Mooniac> wong
[16:40:53] <Mooniac> wrong
[16:41:04] *** gelignite has joined ##java
[16:41:04] <ojacobson> Then it's equivalent to "how do I embed swing controls in HTML"
[16:41:08] <sbalmos> ojacobson: <blink><marquee>SUNDAY SUNDAY SUNDAY!!! One-day only sale!</marquee></blink>
[16:41:11] <ojacobson> to which the answer is "ahaha no"
[16:41:23] <bulltwang_> Mooniac: np, here's a better link: http://www.wingsframework.org/cms/
[16:41:34] <ojacobson> You can put Swing controls in a client-side app, and you can launch client-side apps via browser plugins from HTML
[16:41:40] <ojacobson> JSP doesn't change that
[16:41:42] *** eitch0000 has quit IRC
[16:41:48] <Mooniac> cool. But is that the same product? Seems to be the same?
[16:42:10] <khasathan> RLa: i recently test internaet speed again. this image is result http://img684.imageshack.us/i/screenshotyio.png/
[16:43:05] <ronr_> khasathan: if you download the same file directly from gmail using your browser, is it faster?
[16:44:39] <khasathan> ronr_: yes, just use for < 20 sec
[16:44:58] <bulltwang_> Mooniac: yes it is... i just managed to get the actual project's site...
[16:45:06] *** topriddy_ has joined ##java
[16:45:41] <Mooniac> Thanks, I had never heard of that. But I might consider AJAX or GWT as well. For now I consider Swing easier.
[16:46:43] *** jdolan has quit IRC
[16:46:52] *** jdolan has joined ##java
[16:47:40] *** mastroWork has joined ##java
[16:48:43] <bulltwang_> I've worked with GWT, and its really cool... and google introduced a designer for it now as well... (haven't tried it yet though)...
[16:49:43] <bulltwang_> at this point prefer it anyday above using jsp or velocity....
[16:50:38] <Mooniac> I have to use .jsp, have no choice.
[16:50:49] *** xianny has joined ##java
[16:51:03] *** kbotnen has joined ##java
[16:51:14] *** mastroDani has quit IRC
[16:51:21] *** Veritto has quit IRC
[16:53:26] <khasathan> Thank you everybody for answer. I will trying for solve this problem. :)
[16:54:15] *** mazzachre has quit IRC
[16:54:33] *** bduncan has quit IRC
[16:54:42] *** Cobi has quit IRC
[16:55:57] *** bearded_oneder has joined ##java
[16:56:10] *** Sembiance has joined ##java
[16:56:30] *** Sembiance has left ##java
[16:57:05] *** Cobi has joined ##java
[16:58:09] *** meling has joined ##java
[17:00:23] *** dframe has quit IRC
[17:02:55] *** forneus_ has joined ##java
[17:03:46] *** kalusn has quit IRC
[17:03:51] *** rigved has quit IRC
[17:04:49] *** forneus has quit IRC
[17:06:14] *** mastroWork has quit IRC
[17:07:58] *** SpaceDoG has quit IRC
[17:09:00] *** mapreduce has quit IRC
[17:10:19] *** epalm has joined ##java
[17:11:20] *** blahspam has joined ##java
[17:11:30] *** mastroWork has joined ##java
[17:12:15] *** pen has joined ##java
[17:12:15] *** pen has quit IRC
[17:12:43] *** pen has joined ##java
[17:12:43] *** pen has quit IRC
[17:12:48] *** riotz has quit IRC
[17:12:56] *** NightMiles has joined ##java
[17:13:06] *** bojo has quit IRC
[17:13:08] *** pen has joined ##java
[17:13:17] *** wvdhaute has quit IRC
[17:13:56] *** chandan_kumar has joined ##java
[17:14:11] *** davo has quit IRC
[17:14:21] *** SpaceDoG has joined ##java
[17:15:04] *** rkhshm has joined ##java
[17:15:16] *** rkhshm has left ##java
[17:15:57] *** BoF has quit IRC
[17:16:42] *** kh31d4r has quit IRC
[17:16:46] *** [SkiD] has left ##java
[17:17:52] *** moai has quit IRC
[17:19:15] *** bojo has joined ##java
[17:19:16] *** kh31d4r has joined ##java
[17:19:17] *** michelem has quit IRC
[17:19:49] *** bulltwang_ has quit IRC
[17:20:43] <bearded_oneder> += bearded_oneder
[17:20:49] *** abhijain has quit IRC
[17:22:30] <ronr_> ~bearded_oneder--
[17:22:30] <javabot> bearded_oneder has a karma level of 15, ronr_
[17:23:19] <bearded_oneder> :-S
[17:24:00] <bearded_oneder> ~ronr_++
[17:24:00] <javabot> ronr_ has a karma level of 1, bearded_oneder
[17:24:14] <ronr_> WOOT!
[17:27:44] *** BeholdMyGlory has joined ##java
[17:28:21] <mrapple> whats the best way to check if an integer is negative or positive
[17:29:00] <sbalmos> Seriously?
[17:29:12] <mrapple> seriously >.<
[17:29:15] * cheeser commites seppuku
[17:29:16] <mrapple> wait
[17:29:19] <mrapple> greater then zero! huzzah
[17:29:19] <cheeser> dude
[17:29:24] <sbalmos> good f'ing lord
[17:29:24] <cheeser> basic. math.
[17:29:27] <cheeser> fuck.
[17:29:31] <mrapple> heh
[17:29:41] <mrapple> i was just searching everywhere for like Ingeter.isPositive() or something
[17:29:44] <sbalmos> That takes the cake, the baker, the flour for the cake mix, and even the farmer growing the wheat
[17:29:50] *** b1lly has joined ##java
[17:30:14] <sbalmos> cheeser: Is javachannel.net still running the Wall of Shame?
[17:31:00] *** K4mirox has joined ##java
[17:31:08] <fr0ggler> ...
[17:31:16] <fr0ggler> i'm agog
[17:31:23] <ronr_> no, you're aging
[17:31:29] <fr0ggler> that too
[17:32:17] *** realtime_ has joined ##java
[17:32:43] *** mastro has joined ##java
[17:33:33] *** tewecske has quit IRC
[17:34:08] * bearded_oneder beams with amusement
[17:34:13] *** kraucrow has quit IRC
[17:35:03] *** BoF has joined ##java
[17:35:25] <Kristen207> I'm having a bit of a problem. I need to make a JColorChooser that appears upon clicking a small preview JPanel. I have this encoded by adding a mouse listener to the JPanel such that when it's clicked on the JColorChooser is set visible, and when it's clicked again, it is set not visible. But the JColorChooser isn't displaying with an "OK" button
[17:35:30] *** tewecske has joined ##java
[17:35:38] <Kristen207> How would I make it display with an OK button?
[17:35:48] *** chetan- has joined ##java
[17:36:11] *** mastroWork has quit IRC
[17:37:50] <chetan-> anyone know of a library that can properly decode URL-encoded strings with unicode represented as %uxxxx?
[17:37:52] *** Phil-Work has quit IRC
[17:38:04] <ojacobson> I wouldn't call that "url encoded"
[17:38:10] <ojacobson> since it's incompatible with URL encoding
[17:38:27] <ojacobson> find out what software produced that string and start there
[17:39:13] <b1lly> i'm interested in getting into java-more specifically mobile app development for androids; i need a good starting point, and don't know anything about the language and need a good starting point
[17:39:31] <ojacobson> b1lly: 1. learn the language 2. then learn a specific platform
[17:39:39] <ojacobson> ~tutorial
[17:39:39] <javabot> Please see http://download.oracle.com/javase/tutorial/
[17:39:49] <ojacobson> is probably the best place to start on the language and some of the core Java bits
[17:39:50] <cheeser> 3. android isn't java. sorry.
[17:40:08] <ojacobson> Android isn't quite Java-the-platform, so be prepared for some rude surprises
[17:40:21] *** pen has quit IRC
[17:40:34] *** pen has joined ##java
[17:40:45] *** jor has joined ##java
[17:40:51] <chetan-> ojacobson: agree, however it seems the ecma encode() function converts unicode in this way. need to support it for backwards compat..
[17:41:54] *** meling has quit IRC
[17:42:02] *** VJTachyon has quit IRC
[17:42:06] <chetan-> er, the escape() method rather
[17:42:26] *** sebrock has joined ##java
[17:46:29] *** vivek200912 has joined ##java
[17:47:39] <vivek200912> java.lang.NullPointerException while performing jdbc programming...can anyone help?
[17:48:15] <cheeser> ~stacktrace
[17:48:15] <javabot> http://i.imgur.com/jacoj.jpg
[17:48:16] <cheeser> 8^)=
[17:49:15] *** cbeust has quit IRC
[17:49:19] <ronr_> cheeser :)
[17:49:19] *** marens has joined ##java
[17:49:54] *** b1lly has quit IRC
[17:50:55] <vivek200912> java.lang.NullPointerException in linux, can anyone help?
[17:51:12] <cheeser> ~stacktrace
[17:51:12] <javabot> http://i.imgur.com/jacoj.jpg
[17:51:18] <chetan-> lol..
[17:51:41] <ronr_> actually, NullPointerException can't happen on linux, only on windows.
[17:52:04] <ojacobson> ronr_: Don't confabulate.
[17:52:28] <ronr_> ojacobson: don't use complicated words with non-native english speakers.
[17:52:43] *** cbrock has joined ##java
[17:52:54] <cheeser> don't make up shit
[17:53:11] <ronr_> finally, that I can understand ;)
[17:53:15] <cheeser> 8^)=
[17:53:16] <fr0ggler> ~~vivek200912 NPE
[17:53:16] <javabot> vivek200912, NullPointerExceptions are easy to spot and deal with. For some tips on dealing with them, please see http://is.gd/ha7A and http://is.gd/n3kP
[17:53:50] <ronr_> well, mentioning it's in linux is most likely irrelevant ;)
[17:54:40] <vivek200912> thanks
[17:55:00] <gener1c> null pointer exception -__-
[17:55:05] <gener1c> i dont like it one bit
[17:55:21] <ojacobson> Then don't write code that dereferences null pointers
[17:55:28] <gener1c> lol
[17:55:40] *** f_kafka has left ##java
[17:55:42] *** nikolavp has left ##java
[17:55:50] *** mastro has quit IRC
[17:56:01] <vivek200912> actually I am new to jdbc programming..
[17:56:07] <vivek200912> and irc too
[17:58:41] *** jaska^ has joined ##java
[17:59:27] <vivek200912> fr0ggler, do you have any Idea regarding jdbc driver?
[17:59:53] <vivek200912> fr0ggler, or can you let me know how to install it?
[17:59:56] <fr0ggler> vivek200912, you haven't pasted any code or any stack trace.
[18:00:10] <vivek200912> fr0ggler, no, not yet
[18:00:16] <vivek200912> fr0ggler, how to do it?
[18:00:20] <fr0ggler> ~pastebin
[18:00:21] <javabot> http://paste.pocoo.org/ - Paste the final url after you've pasted your stuff there.
[18:00:41] *** Luc1fel has quit IRC
[18:01:01] <fr0ggler> paste any compiler/runtime errors (the output when you try to compile/run your program), and the code that generates those errors
[18:03:02] <bearded_oneder> ~~vivek200912 jdbc
[18:03:02] <javabot> vivek200912, jdbc is is the Java Database Connectivity API. It's the standard java API for communicating with databases using embedded SQL commands. See http://java.sun.com/javase/6/docs/technotes/guides/jdbc/index.html - and for some drivers: http://jdbc.postgresql.org/ http://dev.mysql.com/doc/refman/5.0/en/connector-j.html
[18:03:05] <ronr_> cheeser: one of the team leaders here actually printed out the stacktrace comic and hang it on their door :p
[18:03:37] <vivek200912> fr0ggler, http://paste.pocoo.org/show/351400/
[18:03:49] <vivek200912> bearded_oneder, thanks..
[18:03:53] *** tktiddle has joined ##java
[18:04:25] <fr0ggler> vivek200912, stmt is most likely null
[18:04:43] *** luxurymode has joined ##java
[18:04:52] <fr0ggler> if you read the links in the NPE factoid, you probably would've arrived at that conclusion too
[18:05:01] <luxurymode> hey all. anyone have suggestions for a fast, lightweight java editor for Mac OS X?
[18:05:08] <vivek200912> fr0ggler, means?
[18:05:20] <fr0ggler> vivek200912, huh? stmt is null. what more do you need?
[18:05:42] <ojacobson> I don't see how stmt could *not* be null
[18:05:46] <vivek200912> fr0ggler, I dont know I have installed that jdbc driver correctly, I am not sure about it..
[18:05:59] <tktiddle> Hi im just trying to figure out how to model a bunch of particles interacting, I want to have all the particles attract one another. Would it be a good ideat to treat the forces as a seperate object?
[18:06:05] <fr0ggler> vivek200912, it's nothing to do with the driver. listen to what I'm telling you. "stmt is null"
[18:06:25] <vivek200912> fr0ggler, ok.
[18:06:55] <tktiddle> i mean have a force object that references two particles..
[18:07:01] <ojacobson> The conn == null check is also bogus - DriverManager.getConnection either succeeds (and returns a non-null Connection reference) or fails (and throws an exception)
[18:07:08] <fr0ggler> indeed
[18:07:29] <vivek200912> fr0ggler, but the code is written is my text book..
[18:07:45] <fr0ggler> vivek200912, then ditch the textbook.
[18:07:49] <vivek200912> fr0ggler, I mean its not from my mind.
[18:08:08] <fr0ggler> or, you've copied it wrong, which is the ultimate form of programming fail.
[18:08:13] <vivek200912> fr0ggler, But it works on other pc.
[18:08:38] <fr0ggler> i doubt that.
[18:09:17] *** sebersole has joined ##java
[18:09:28] *** laught has quit IRC
[18:10:15] *** luxurymode has quit IRC
[18:10:23] <vivek200912> fr0ggler, text book teach that u have to initialise it to null firstly..
[18:10:31] <fr0ggler> ...
[18:11:33] <vivek200912> fr0ggler, I have doubt on my driver, I have not installed it correctly or something wrong going on..
[18:11:48] <fr0ggler> vivek200912, i give up. fine, it's your driver.
[18:12:11] <fr0ggler> maybe try reinstalling Office and minesweeper too.
[18:12:31] <vivek200912> fr0ggler, I use linux
[18:12:36] <fr0ggler> and maybe, just maybe, fix your code so that stmt isn't null.
[18:12:55] *** blahspam has quit IRC
[18:13:08] <vivek200912> fr0ggler, so what to initialise those stmts with?
[18:13:08] <fr0ggler> even better! update your kernel and make sure glibc is upside-down.
[18:13:18] <ojacobson> fr0ggler: take a minute
[18:13:19] *** jtheuer has quit IRC
[18:13:24] * fr0ggler walks away
[18:13:30] <ojacobson> vivek200912: Why did you ask a question if you weren't willing to accept the answers?
[18:14:00] <ojacobson> We're not lying to you, either for our own amusement or otherwise. We're honestly trying to tell you where the problem is, and offer pointers on how to fix it.
[18:14:04] *** ronr_ is now known as ronr_away
[18:14:12] <ojacobson> Fixating on some other hypothetical solution helps neither you nor us.
[18:14:15] <vivek200912> ojacobson: I did not satisfied, thats why
[18:14:26] * bearded_oneder likes the Antwerkz link in the NPE factoid
[18:14:27] *** chandan_kumar has quit IRC
[18:15:14] <vivek200912> ojacobson, fr0ggler : finally can you give me link that will guide me to install jdbc driver or so?
[18:15:29] *** cbrock has quit IRC
[18:15:43] <ojacobson> vivek200912: if your program reaches any line after conn = DriverManager.getConnection("jdbc:mysql://localhost/student_db","root","ganapati"); then the driver is installed.
[18:15:59] <fr0ggler> vivek200912, would you be satisfied if I told you the sky was blue? if so, why are you not satisfied with the correct answer that you need to initialise your Statement object?
[18:16:06] *** kinks has quit IRC
[18:16:14] *** cythrawll has joined ##java
[18:16:15] *** [clay] has quit IRC
[18:16:16] <ojacobson> vivek200912: We can't help you solve a problem you don't have.
[18:16:21] <ojacobson> We can tell you what the problem you have is, though.
[18:16:28] *** kinks has joined ##java
[18:16:33] <fr0ggler> ojacobson, tried that. no dice.
[18:17:14] <vivek200912> I have no idea about anything in jdbc programming..
[18:17:21] *** saby has quit IRC
[18:17:32] *** meling has joined ##java
[18:17:37] *** chandan_kumar has joined ##java
[18:17:45] *** Frostix has joined ##java
[18:18:26] <fr0ggler> vivek200912, http://download.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html
[18:18:35] <fr0ggler> the part about Creating Statements
[18:18:50] <vivek200912> ojacobson,fr0ggler: Thank you all for your patiences..
[18:19:30] *** Fisiu has quit IRC
[18:19:37] <vivek200912> fr0ggler, ohh...thanks for above link
[18:20:06] <vivek200912> fr0ggler, it will help me and will satisfy my query..(I think so)
[18:20:12] *** wvdhaute has joined ##java
[18:20:20] <fr0ggler> i hope so.
[18:21:09] *** XaS has quit IRC
[18:21:26] *** Develman has joined ##java
[18:21:28] <bearded_oneder> {imitating yoda's voice} vivek200912, thank do you not. do you do.
[18:22:29] *** zemanel has joined ##java
[18:22:47] <vivek200912> bearded_oneder: what do you want to suggest me?
[18:23:43] <bearded_oneder> demonstrate your gratitude by shutting up, reading, studying, and then coding the solution. :-P
[18:25:25] <RLa> aww, i hate template engines whitespace handling
[18:25:43] <RLa> either too much whitespace or too little
[18:25:53] <jink> RLa: Just get used to the way your engine handles it, and deal with it.
[18:26:00] <jink> It's not that hard, really.
[18:26:52] <RLa> uh
[18:27:06] <vivek200912> fr0ggler: The link did help me, I have not written "stmt = conn.createStatement();" in my code..
[18:28:04] <fr0ggler> vivek200912, yes. that was my original point which you apparently weren't satisfied with. glad you found eventual satisfaction.
[18:28:11] <RLa> jink, how do i "deal" with it
[18:28:29] <vivek200912> fr0ggler: ha ha ha ha, so sorry...
[18:29:30] *** cbrock has joined ##java
[18:29:45] *** PelleTut has joined ##java
[18:30:23] <vivek200912> fr0ggler: You were right...I did not concentrate to your advise, now its solved, thanks to you again....!!!
[18:30:26] *** Rissien has joined ##java
[18:30:44] <RLa> hm, nvm, found some weird control tags in freemarker to control whitespace handling
[18:30:57] <vivek200912> fr0ggler: please don't mind, I am really very sorry...!!!!
[18:31:05] <fr0ggler> vivek200912, no problem
[18:31:16] *** vivek200912 has left ##java
[18:32:20] <jink> RLa: Get to know the engine, and understand why it handles whitespaces the way it does. It's not voodoo, usually. :)
[18:32:25] *** wvdhaute has quit IRC
[18:32:33] <jink> ~freemarker++
[18:32:33] <javabot> freemarker has a karma level of -1, jink
[18:32:37] *** wvdhaute has joined ##java
[18:33:17] *** cbeust has joined ##java
[18:33:26] <RLa> it actually is voodoo, and most engines seem to be for html/xml where whitespace does not matter
[18:34:13] <jink> I used freemarker to generate java and whitespace did matter to me. It's all good now. :)
[18:34:30] *** mah01 has quit IRC
[18:35:36] <RLa> jink, got some code available somewhere?
[18:37:37] <RLa> nvm, looks like single <#t> tag fixed a lot
[18:37:45] <okiwan> Hi guys. Due to my lack of experience with Java I'm having a problem working with a extended classes. Anyone could land a hand?
[18:39:04] <whaley> ~~ okiwan show us
[18:39:04] <javabot> okiwan, Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems.
[18:39:41] *** Vanek has quit IRC
[18:39:49] <okiwan> ~pastebin
[18:39:50] <javabot> http://pastie.org - Paste the final url after you've pasted your stuff there.
[18:40:08] <kba> if I have an ArrayList, is there an easy way to trim it to a specific size? Say 10 items max.
[18:40:36] *** tizbac has joined ##java
[18:40:39] <okiwan> Here's the new class
[18:40:41] <okiwan> http://pastie.org/1656423
[18:41:35] <okiwan> Here's what I want to do on another class
[18:41:36] <okiwan> http://pastie.org/1656427
[18:41:54] *** LouisJB has quit IRC
[18:42:18] <okiwan> Here's the error
[18:42:19] <okiwan> http://pastie.org/1656428
[18:42:27] *** Mooniac has quit IRC
[18:43:32] <okiwan> Not sure but, may I create the constructor on the new class and then call the "super" constructor?
[18:43:38] <whaley> okiwan: you need to define a constructor JListEx... constructors aren't inherited
[18:44:04] <okiwan> So, for each constructor I have to define them and call the "super()" statement?
[18:44:06] <whaley> okiwan: and yes call super() in the first statement of your custom made constructor
[18:44:23] *** Behold has joined ##java
[18:44:24] <okiwan> All right. That was it.
[18:44:27] <okiwan> Really appreciated!
[18:44:38] <whaley> or any constructor defined on the super class... doesn't have to be default constructor
[18:44:52] *** BeholdMyGlory has quit IRC
[18:45:05] *** forneus_ has quit IRC
[18:45:15] <okiwan> I see! Thank you, whaley!
[18:45:16] <bearded_oneder> http://www.youtube.com/watch?v=wRie_cRxFfY
[18:45:33] *** Bombstone has joined ##java
[18:46:18] <whaley> kba: create a new ArrayList by passing in the result of yourList.subList(0,10), perhaps
[18:46:36] *** fr0ggler has quit IRC
[18:46:53] <whaley> kba: and then reassign the reference
[18:47:11] <whaley> kba: or just loop and use remove
[18:47:30] *** Sliker has joined ##java
[18:47:53] *** netsurf3 has quit IRC
[18:48:38] *** Niamkik has joined ##java
[18:48:56] *** Fisiu has joined ##java
[18:49:06] *** X-Scale has joined ##java
[18:49:12] *** netsurf3 has joined ##java
[18:50:15] *** matsebc has quit IRC
[18:50:21] <Ven]n> how do I return the full path to the runable jar I make (in my case I create an .exe afterwards)
[18:50:32] *** topriddy_ has quit IRC
[18:50:38] *** topriddy has quit IRC
[18:50:42] <dmlloyd> you don't
[18:50:50] *** selckin has joined ##java
[18:51:07] <Ven]n> my intention is to add the path to the program into the registry
[18:51:49] *** irn has quit IRC
[18:53:14] <Ven]n> how should I do it?
[18:53:36] *** teralaser has joined ##java
[18:55:00] *** bojo has quit IRC
[18:56:03] *** tktiddle has quit IRC
[18:56:35] *** netsurf3 has quit IRC
[18:56:35] *** sebrock has quit IRC
[18:58:01] *** netsurf3 has joined ##java
[19:00:12] *** Niamkik has quit IRC
[19:00:37] *** Niamkik has joined ##java
[19:00:54] *** zatan has joined ##java
[19:01:04] *** rekoil has joined ##java
[19:01:15] *** bojo has joined ##java
[19:01:55] <rekoil> hello, i have a question regarding JButton
[19:02:14] <rekoil> is it possible to create an invisible and clickable JButton on mac os x?
[19:03:15] *** cool123 has joined ##java
[19:03:22] <rekoil> i could change to a different type of button as well if that's easier
[19:03:29] *** Kamaran has quit IRC
[19:03:39] * rekoil is still learning java
[19:04:02] <cheeser> non-visible elements typically can't receive events.
[19:04:22] *** feathersanddown has joined ##java
[19:05:05] <rekoil> right, well in that case i need to colour the button
[19:05:17] <rekoil> on windows my code displays fine
[19:05:34] *** riotz has joined ##java
[19:05:41] <rekoil> but on mac the buttons aren't taking to my colour choice
[19:06:45] <rekoil> these are my two classes: http://pastie.org/1656492 http://pastie.org/1656495
[19:07:13] *** pgib has joined ##java
[19:07:17] *** riotz has quit IRC
[19:07:45] <rekoil> it is supposed to emulate a wildfire
[19:08:13] <rekoil> i haven't actually done the code for spreading fire yet, trying to fix the issue with the buttons
[19:08:50] <rekoil> basically, when i click a button the boolean[][] fire at the location is supposed to be changed to true
[19:09:15] <rekoil> and when i repaint that button is now supposed to be yellow
[19:09:23] *** riotz has joined ##java
[19:09:31] *** coalado has quit IRC
[19:09:38] *** igorklem has joined ##java
[19:09:58] *** freeone3000 has joined ##java
[19:10:23] <rekoil> but apparently JButtons don't like colour on os x :P
[19:10:45] *** Frostix has quit IRC
[19:10:55] *** VJTachyon has joined ##java
[19:10:57] *** wrtpeeps has joined ##java
[19:11:38] <rekoil> (specifically jb[i][j].setBackground(Color.colour) )
[19:11:52] <wrtpeeps> hi guys. I have an interview for a java job tomorrow. I haven't used java in a long time and even then it was a basic level. The job doesn't require that I already know java, but I'd like to at least show that I took the initiative to look up the basics, what j2ee is etc etc. Anyone got a link to some decent articles for me to read? For what it's worth, I'm coming from a .NET/C# background if that helps.
[19:12:12] <rekoil> if i make the buttons opaque i can see the set background colour behind the button
[19:12:14] <selckin> ~rbi
[19:12:14] <javabot> selckin, rbi is http://download.oracle.com/javase/tutorial/reallybigindex.html
[19:12:18] <rekoil> which is what i've been doing so far
[19:12:34] <wrtpeeps> rekoil, cheers.
[19:12:51] * rekoil forwards thanks to selckin
[19:12:59] <wrtpeeps> oh
[19:13:04] <rekoil> :P
[19:13:05] <wrtpeeps> woops! Thanks selckin
[19:13:16] *** vipaca has joined ##java
[19:13:33] <vipaca> What is the simplest way to get the current timestamp
[19:13:41] <cheeser> new DAte()
[19:14:05] <selckin> System.currentTimeoinmiliisiecoiosdi
[19:14:10] <rekoil> alright, scrap that problem then, another question
[19:14:35] <rekoil> i want to add a button under my grid of 15x15 buttons, any idea how i might do that?
[19:14:36] <vipaca> @cheeser new Date.getTime()
[19:14:53] <vipaca> selckin That was actually what I was looking for thx
[19:16:34] <cheeser> whatever works for you
[19:18:20] *** Pozejdon has joined ##java
[19:20:44] *** kinks has quit IRC
[19:21:37] *** tomvolek has joined ##java
[19:22:00] *** netsurf3 has quit IRC
[19:22:55] *** netsurf3 has joined ##java
[19:24:24] *** sputnick has quit IRC
[19:25:09] *** gtrak has quit IRC
[19:29:44] <bobbytek2> Is there a way to minimize the memory utilization for the following using a memory mapped file or other? final InputStream inputStream = new ByteArrayInputStream( veryBigStringBuilder.toString().getBytes( "UTF-8" ) );
[19:30:05] *** Junior has quit IRC
[19:30:31] *** Charrit has joined ##java
[19:30:32] *** bojo has quit IRC
[19:30:59] *** flodin has joined ##java
[19:31:54] *** netsurf3 has quit IRC
[19:32:04] *** cool123 has quit IRC
[19:32:30] <flodin> can you offer me a guideline on whether to use
[19:32:31] <flodin> new BufferedReader(new InputStreamReader(is))
[19:32:33] <flodin> or
[19:32:37] <flodin> new InputStreamReader(new BufferedInputStream(is))
[19:32:47] <flodin> i.e. should I buffer at the lower or the higher level
[19:33:21] *** netsurf3 has joined ##java
[19:34:14] *** VJTachyon has quit IRC
[19:34:28] <bobbytek2> Hmm, perhaps something like DeferredOutputStream
[19:35:00] *** forneus has joined ##java
[19:35:16] *** bojo has joined ##java
[19:36:21] *** freeone3000 has quit IRC
[19:36:46] *** VJTachyon has joined ##java
[19:37:01] *** gtrak has joined ##java
[19:37:30] *** Pritchard has joined ##java
[19:37:50] <Pritchard> How can I set a border around multiple components? I only know of component.setBorder( border ), but I've only seen that work for a border around a single component.
[19:38:43] *** matsebc has joined ##java
[19:38:45] *** cocoloa has quit IRC
[19:40:03] *** VJTachyon has quit IRC
[19:40:27] *** io2 has joined ##java
[19:40:41] *** chomping has quit IRC
[19:41:14] *** Kamaran has joined ##java
[19:42:14] *** VJTachyon has joined ##java
[19:46:39] <jim> put the multiple components on a view, set the border on the view
[19:47:21] <Pritchard> jim: Thank you.
[19:47:47] <jim> at least that would be the simplest way I can think of
[19:48:40] *** msieradzki has joined ##java
[19:49:23] <Pritchard> I've never heard of views.
[19:49:53] <jim> oh, let me see...
[19:50:05] <jim> are you using awt? swing? what?
[19:50:09] <jim> android?
[19:50:10] <Pritchard> Swing.
[19:50:56] *** robbyoconnor has joined ##java
[19:51:28] <Ven]n> shouldnt I get the sysouts when running a runnable .jar in cmd.exe?
[19:52:56] <jim> ahh, s/view/JComponent subclass/
[19:54:13] *** mvno_subscriber has joined ##java
[19:54:19] <jim> Pritchard, I'm doing android stuff, so to me everything is a View subclass...
[19:55:07] <Pritchard> jim: I see. This is still foreign to me. In VB.NET we have groupboxes and they're pretty easy to deal with. I was disappointed to find that the Container class didn't have a setBorder method, although I can imagine why...
[19:55:40] <Pritchard> jim: Just found JPanel. I should be fine now.
[19:56:13] <Pritchard> I see setBorder :)
[19:56:13] <mvno_subscriber> hi.. i register a socketchannel with a selector, then later call SelectionKey.cancel(). When I try to register with the selector again later, I get a CancelledKeyException. How can I "unregister" a channel with a selector and be able to re-register it aain?
[19:56:36] *** kermit is now known as go
[19:56:50] *** cbrock has quit IRC
[19:57:00] *** go is now known as kermit
[19:57:32] <jim> mvno_subscriber: consider the possibility that "cancel" isn't what you want?
[19:59:20] <mvno_subscriber> jim: that's exactly my question. I have a thread that writes data and registers socketchannels that need data. when they don't need data anymore I don't want to listen to them. however, they may need data again in the future so i need to be able to "re-enable" them
[20:00:19] *** Guyman has joined ##java
[20:00:46] *** Malbicho has joined ##java
[20:02:51] <jim> I'm not familiar with sockets and (I guess) the SocketChannel class... but it seems like you want to do something similar to pooled connections
[20:06:13] *** Niamkik has quit IRC
[20:07:46] *** MadOtis has joined ##java
[20:10:57] *** Niamkik has joined ##java
[20:11:20] <MadOtis> Hello all… I have a Jersey/JSON client that runs perfectly well on Linux, but when run on Mac OS-X, it breaks with "UnmarshalExceptions"… both clients are built with the same Maven pom (just one on OS-X, one on OpenSuse) and both with the latest platform release of Java 6. The odd part is, if I fix it so it runs on OS-X, it breaks with a different error on the Linux client....
[20:11:58] <jim> mvno_subscriber, what is the fully qualified name (capitalization counts) of the class you're using?
[20:13:03] <cheeser> MadOtis: might be an encoding issue. what's the fix on OS X?
[20:13:14] <Bombe> Hehe, MacRoman ftw.
[20:14:07] <MadOtis> cheeser: If I return a List of my entity, it works on the Mac… in order for it to work on Linux, I have to return an Array of my Entity.
[20:14:49] <MadOtis> i.e.: if I change the service return to List<Project> it works on the mac, but fails on Linux… if I change it to Project[] it works on Linux, but fails on the Mac
[20:14:51] <sbalmos> o_O
[20:15:20] <pgib> hmm. I find it strange that JAXB's xjc tool uses Java's String for XSD's anyURI. I'd figure URI would be used instead :-/
[20:15:54] *** RLa has quit IRC
[20:15:57] <MadOtis> Here's the exact error:
[20:16:01] <MadOtis> [javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"id"). Expected elements are <{}project>]
[20:16:16] <MadOtis> It's Jersey 1.4, BTW
[20:16:34] <MadOtis> Don't know if I need to switch it to the latest 1.5 if that would help any.
[20:16:41] <ojacobson> You sent something beginning with <id> instead of <project>
[20:16:44] *** Pozejdon has quit IRC
[20:16:46] <cheeser> not sure why that would differ from OS to OS
[20:17:02] <cheeser> run the exact same jars on each machine and see
[20:17:10] <sbalmos> Well he said it was JSON, so maybe Jackson's also screwing up in the middle?
[20:17:48] *** ztj has quit IRC
[20:18:24] *** Frostix has joined ##java
[20:18:31] <MadOtis> I did indeed try with the same client jar… so, I checked out the entire project and built it from source and got the exact same result.
[20:21:08] <MadOtis> Here's a paste of the client, and the method it's calling: http://pastebin.com/Qg7X95PB
[20:23:20] *** Ven]n has left ##java
[20:23:40] *** sebrock has joined ##java
[20:26:16] *** irn has joined ##java
[20:29:14] *** cool123 has joined ##java
[20:30:05] *** cool123 has quit IRC
[20:30:06] <pgib> it is just odd too me. schemagen does java.net.URI => xs:anyURI. JAX-RS seems to support a java.net.URI in the representation class. Now I want to use xjc to build java from the schema instead (ojacobson's suggestion) but it doesn't seem I can get it to generate code with java.net.URI.
[20:30:37] <pgib> Just seems odd, especially in the JAX-RS universe where URIs run rampant and javax.ws.rs has APIs using URI
[20:31:41] <ojacobson> There might be a binding customization you need to use
[20:32:01] <ojacobson> xjc likes to generate bizarro Java classes at the drop of a hat if you're not careful with customizing it
[20:32:19] *** Soliah has quit IRC
[20:32:59] *** cool123 has joined ##java
[20:33:34] *** tibrox has joined ##java
[20:33:40] <sbalmos> Yet more quick Googling suggests writing a custom type adapter
[20:34:57] *** hanstech has joined ##java
[20:35:37] <tibrox> Hi all. Could someone please tell me what the username and password is for glasfish 3 open source ed? I installed from netbeans 6.91 installer. admin, adminadmin doesn't work :(
[20:35:55] * caverdude was just now paying attention and thought you said Xgc likes to make bizzare java classes at the drop of a hat
[20:35:58] *** Nikelandjelo has joined ##java
[20:36:09] *** Raystorm has joined ##java
[20:36:13] <tibrox> it's asadmin something something. I always damn well forget and can't find in through google
[20:36:23] <MadOtis> sbalmos: That's about the only thing I haven't tried yet…. I just couldn't figure out why I would work on one platform, but not on another… I haven't even tried Windows yet. With my luck, I'll get even a 3rd different error!
[20:36:24] *** a|3x has joined ##java
[20:36:41] *** Alkhi has joined ##java
[20:36:43] *** VJTachyon has quit IRC
[20:36:43] <a|3x> hi
[20:36:52] *** irn has quit IRC
[20:37:00] <a|3x> does anybody know how to work jpa correctly?
[20:37:23] *** VJTachyon has joined ##java
[20:37:56] <a|3x> it gives me strange message "Exception Description: Configuration error. Class [com.mysql.jdbc.Driver] not found." but i am not even using mysql
[20:38:14] <jim> something is
[20:38:16] <FauxFaux> You've probably told it to use mysql /somewhere/.
[20:38:34] <tibrox> a|3x, check your xml settings?
[20:39:19] <a|3x> everything is fine there
[20:39:31] <a|3x> you mean persistance.xml?
[20:39:48] <tibrox> yes
[20:40:15] <MadOtis> Look in the <properties> section of persistence.xml… if you're using OpenJPA, your driver and connection information should be defined there.
[20:40:19] <a|3x> i used to have mysql there but no longer
[20:40:38] *** ztj has joined ##java
[20:41:08] <MadOtis> you may be picking up an old copy of your persistence.xml or a MANIFEST.MF file with it in the class-path section
[20:41:38] <tibrox> I guess the error means that some old config is still pointing to com.mysql.jdbc.Driver
[20:41:47] <MadOtis> try a clean build, or if you're using maven, clean out your .m2/repository folder
[20:42:04] <tibrox> does someone know the user/pass to glassfish? or must I trade buttsecks for it?
[20:42:16] *** yoshx has joined ##java
[20:42:53] <Raystorm> I'm adding unit testing for class, I have a several functions that throw exceptions rather than writing the same try/catch boilerplate code over and over again I thought I would create, a function that I could just pass the expected excetion type, and *SOMETHING*(representing the function I expect to throw the exception) and have all the boiler plate code in one place. How can I do that?
[20:43:20] <Raystorm> or more precisely what do I need to pass?
[20:43:52] <MadOtis> tibrox: I recall something about logging in as "anonymous" with no password
[20:44:09] <tibrox> MadOtis, I tried that too :(
[20:44:36] <MadOtis> ok, never mind then. ;)
[20:47:31] *** Indigenous has quit IRC
[20:48:01] *** akshatj has joined ##java
[20:48:12] <tjsnell> admin pw: adminadmin
[20:48:17] *** akshatj has left ##java
[20:49:05] *** Develman has quit IRC
[20:49:08] <whaley> Raystorm: junit?
[20:49:23] <Raystorm> whaley: yes
[20:49:36] *** oCean has joined ##java
[20:49:54] <whaley> Raystorm: if you are just testing to make sure the Exception is thrown, use @Test(expected=SomeException.class) as the annotation on the test method
[20:50:12] <whaley> ... assuming I understand your question
[20:50:16] *** oCean has left ##java
[20:50:17] <reisi> any ideas why Array.newInstance(Class<?>, int) is not generic, as in <E> E[] Array#newInstance(Class<E>,int) ?
[20:50:33] <dmlloyd> because you can create arrays of primitive type
[20:50:36] <dmlloyd> like int[]
[20:50:38] *** khasathan has quit IRC
[20:50:49] *** oCean has joined ##java
[20:50:53] <dmlloyd> int.class is only assignable to variables of type Class<?>
[20:50:54] *** oCean has left ##java
[20:50:56] *** Mkaysi has joined ##java
[20:51:01] <Raystorm> whaley: i wish it where that easy, I'm using source level 1.4 (old project, I really should move up to at least 1.5 if not 1.6)
[20:51:06] *** SamuraiAlba has quit IRC
[20:51:08] <dmlloyd> you could easily write a wrapper though, reisi
[20:51:25] <whaley> Raystorm: ouch. I can't offer any help there :P What you proposed a minute ago seems to be logical enough though.
[20:51:28] <tjsnell> 1.4! wow
[20:51:31] <dmlloyd> you just won't be able to create primitive arrays with it (try though, if you're curious)
[20:52:06] <Raystorm> whaley: I'm currently trying to code a solution, using the "hard way" -- reflection
[20:52:16] *** Malbicho has quit IRC
[20:52:17] <tjsnell> haha
[20:52:34] <reisi> dmlloyd: of course, thanks for clarifying
[20:54:47] <cbeust> Reflection is not the "hard way". It's the "wrong way".
[20:56:25] *** caverdude has quit IRC
[20:56:40] <svm_invictvs> cbeust: Well, being the wrong solution doesn't make it any easier :P
[20:58:00] *** subanark has joined ##java
[20:58:13] *** chandan_kumar has quit IRC
[20:58:26] <subanark> Is there a way to resize a column in a JTable to be as small as possible while not truncating any cells?
[20:59:10] <subanark> I tried getting the size of the JLabel used to render the cell, but it seems to be too small (even after including the margin between cells)
[20:59:46] *** Mkaysi has left ##java
[21:00:03] *** Xeli has quit IRC
[21:00:17] *** tibrox has quit IRC
[21:00:17] <cbeust> I have a dream... I imagine a world where #java would be devoid of Swing questions. How awesome would that be, uh?
[21:00:25] <ojacobson> Fuck off, fanboy
[21:00:38] <whaley> cbeust: start #swt or join that, I suppose.
[21:00:46] <subanark> Whats wrong with swing?
[21:00:51] <whaley> subanark: don't feed
[21:01:07] <cbeust> I didn't say I wanted a #swt channel, just that it would be nice to have a channel without Swing questions!
[21:01:16] <ojacobson> ##java ain't it
[21:01:21] <whaley> cbeust: the implication was obvious given prior commentary :P
[21:01:26] <tjsnell> you can leave, that'd solve it
[21:01:34] <cbeust> We've outlawed applets, surely Swing should be next
[21:01:39] <Pritchard> cbeust: Java's framework encompasses a lot of functionality. I'll use that as a basis for ##java's broad list of acceptable topics.
[21:01:40] <subanark> Would you perfer one of those javabeans questions? Or maybe a networking question? Those are fun too
[21:01:52] <Raystorm> cbeust: you're probably right, however, I was hoping to right a function assertThrows(Exception e, ...) and have it run the function and if it throws an exception of the expected type, the test passes, else throw an assertion failure. The "logic" sounds simple enough. However, the invoke appears to be my roadblock. So now I'm thinking abstract inner class that gets passed to assertthrows
[21:01:53] <tjsnell> except more here hate SWT and like Swing than vice versa
[21:02:02] <ojacobson> subanark: "as small as possible" isnt' terribly well defined unfortunately
[21:02:15] <cbeust> You people are so obsessed with SWT, you need to let it go
[21:02:18] <subanark> small enough that I don't see "..." in the cell
[21:02:19] <ojacobson> if you know what the content model of the column is, you can pull content-specific size information out (strings via FontMetrics and so on, for example)
[21:02:27] <tjsnell> you brought it up
[21:02:33] <subanark> *large enough
[21:02:39] <whaley> that and applets really are deprecated... unlike Swing. But I honestly don't give a shit about GUI development, so I'll stop there.
[21:02:42] <cbeust> tjsnell: not true, I didn't mention SWT until somebody else did
[21:02:59] <cbeust> Oh I thought Swing was deprecated? Sun seemed to think so
[21:03:03] <tjsnell> OK, indirectly you pedant
[21:03:14] <ojacobson> No, "Swing Application Framework" is deprecated-slash-never-took-off
[21:03:17] *** cyphorious has joined ##java
[21:03:18] <subanark> a lot of awt kind of is
[21:03:19] <ojacobson> Swing is not SwAF
[21:03:24] <tjsnell> he knows that
[21:03:34] *** VJTachyon has quit IRC
[21:03:46] <ojacobson> Of course he does. He's still FUDing
[21:03:49] <Pritchard> I knew a blind programmer who said he used SWT because it was typically more accessible.
[21:04:11] <subanark> I would have thought that asking the cell renderer for the cell would tell me, but I guess JTable modifies the component after it renders it or something
[21:04:15] *** tjololo has quit IRC
[21:04:27] <ojacobson> subanark: the cell renderer only exists while it's rendering each cell
[21:04:30] *** VJTachyon has joined ##java
[21:04:33] <ojacobson> it's not retained between renderings
[21:04:50] <a|3x> how do i find and load entity by column value with jpa?
[21:05:05] <subanark> yea thats fine. I just loop though each cell in the column and ask the component for its preferred size
[21:05:13] <ojacobson> The jtable rendering glue permits reusing the same component for an entire table if you like, and using a single component (tree) for a whole column is not uncommon
[21:06:11] <subanark> I know, its just like JList
[21:06:27] *** coldpizza72i has joined ##java
[21:06:49] <coldpizza72i> can you initilize 2 variables on the same line like "int i, j;"
[21:06:58] *** Fx21 has quit IRC
[21:07:03] <subanark> What I'm doing is getting the cell renderer and asking it to produce a component for each cell. After each call I get the size of the cell and keep track of the largest one
[21:07:51] <subanark> As I put more and more text into the cell I get larger results, but the result seems to be about 2/3 of the size I wanted
[21:08:20] *** matsebc has quit IRC
[21:10:23] *** mistik1 has joined ##java
[21:11:23] <coldpizza72i> ?
[21:11:40] <subanark> I tried using the FontMetrics, but I'm getting almost the same result as asking the rendered component for the size.
[21:11:52] <subanark> int i = 0, j = 0;
[21:13:29] <coldpizza72i> subanark: so then what i have will cause an error right?
[21:13:52] *** wessel has joined ##java
[21:15:36] <subanark> What you have will declare 2 unitialized variables
[21:15:52] <subanark> If you try using them before you declare them it will be an error
[21:16:01] *** irn has joined ##java
[21:16:41] <wessel> Is there any way to pass a function as a object in Java? So for example I have some abstract function meanError(), which should calculate the "mean squared error" when I pass the handle "squared error", and calculate the "mean absolute error", when I pass the handle "absolute error"?
[21:16:49] <ojacobson> Not directly.
[21:17:03] <subanark> Interfaces are usually used instead
[21:17:06] <ojacobson> You can create a tiny ("SAM" - single abstract method) interface an an anonymous implementation that delegates to the real method, though.
[21:17:21] <wessel> So like method overloading?
[21:17:43] <subanark> kind of
[21:17:52] <ojacobson> eg. public interface ErrorFunction { public double calcuateError(...); } and return new ErrorFunction() { @Override public double calculateError(...) { return meanError(...); } }
[21:17:53] <wessel> Create an object AbsoluteError and run AbsoluteError.mean(double[]) ?
[21:18:07] <subanark> SAM is when you put the function code inside your method call
[21:18:19] *** zhulikas has joined ##java
[21:18:27] *** thevishy has joined ##java
[21:18:52] <cbeust> SAM is an interface with just one method
[21:18:58] <thevishy> Hi what is struts hibernate spring ? what does it have to with jav
[21:19:18] <thevishy> any links to read up on basics
[21:19:19] <wessel> can you give me one more keyword so I can google this SAM + Java?
[21:19:30] *** coldpizza72i has quit IRC
[21:19:34] <subanark> look up anonymous methods
[21:19:35] <Bombe> thevishy: www.google.com
[21:19:48] <cbeust> wessel: looking up SAM will probably bring up results that will confuse you (related to closures)
[21:19:50] <subanark> well anonymous callses
[21:19:53] <subanark> *classes
[21:20:18] *** realtime_ has quit IRC
[21:21:21] <Pritchard> ojacobson: Hey.
[21:21:32] *** mescalinum has joined ##java
[21:21:35] <wessel> I will try and make some simple code
[21:21:41] <wessel> what classes should I make?
[21:21:51] <ojacobson> ~~ wessel anonymous classes
[21:21:51] <javabot> wessel, anonymous class is essentially a local class without a name. See http://www.developer.com/java/other/article.php/3300881
[21:22:02] <ojacobson> wessel: the other alternative is to hoist your function up to a full class
[21:22:05] <thevishy> google yeah but u know somtimes need a qucik one word what it is about
[21:22:06] <Pritchard> Oh never mind. I wanted to test if I still had voice for my involvement in the swt/swing discussion. Insomnia's no good.
[21:22:07] <ojacobson> and use instances + virtual methods
[21:22:23] <ojacobson> Pritchard: I don't generally de-voice people.
[21:22:34] <ojacobson> wessel: the difference is mostly aesthetic.
[21:22:43] *** McFly___80 has quit IRC
[21:23:08] <wessel> its conceptually different I think from passing a function as an argument
[21:23:17] <wessel> it works with method overloading right?
[21:23:32] *** PigFlu has joined ##java
[21:23:33] <ojacobson> Yes
[21:23:46] <ojacobson> It's how you implement "pass a function and I'll apply it" styles in Java, though
[21:23:52] <ojacobson> you don't have functions/delegates, just objects
[21:24:13] <svm_invictvs> No function pointers or function objects.
[21:24:26] <svm_invictvs> ANonymous inner classes are nice, though.
[21:24:30] *** tomvolek has quit IRC
[21:24:41] *** tjololo has joined ##java
[21:25:19] *** Guyman has quit IRC
[21:25:28] <wessel> what would be the anonymous class in the case of averageError(), absoluteError(), squaredError()?
[21:25:37] <wessel> to me they all have a name :-/
[21:25:57] <thevishy> struts uses java language to generate HTML ?
[21:26:07] *** Endust has joined ##java
[21:26:32] <deebo> struts uses the blood of inncoent children to drive the hate machine that is j2ee circa 1999
[21:26:57] *** topriddy has joined ##java
[21:27:27] <thevishy> ooops
[21:27:46] <cbeust> thevishy: forget everything you know about Struts, it's a dead framework which encourages bad practices.
[21:27:50] <ojacobson> thevishy: generally Struts apps use JSP
[21:28:03] <ojacobson> Struts 1 is barely better than no framework, Struts 2 is alright but not great
[21:29:22] <thevishy> right its for a small job ... he asked me to learn , part time
[21:29:35] <thevishy> struts is used in market right
[21:30:38] *** bojo has quit IRC
[21:30:51] <thevishy> he is like having a consultacy which does projects on struts hibernate spring
[21:31:00] <ojacobson> Nobody does new development in struts 1
[21:31:14] <ojacobson> (Which is usually what people mean by "struts")
[21:31:16] <thevishy> so asked me to learn up ...i am not expert ... know a bit of PHP
[21:32:08] <wessel> ojacobson: what you wrote here: "public interface ErrorFunction { public double calcuateError(...); } and return new ErrorFunction() { @Override public double calculateError(...) { return meanError(...); } }"
[21:32:15] <wessel> how do I use this as a start of some sample code?
[21:32:43] <thevishy> so what does Hibernate and Spring represent ?
[21:32:45] <wessel> I need some interface ErrorFunction and some class Test?
[21:33:03] *** irn has quit IRC
[21:33:22] *** Endust has left ##java
[21:34:05] <cbeust> thevishy: I would question the motives of that person asking you to learn Struts. The only good reason I could see for this is if you're going to work on legacy code.
[21:34:21] <whaley> +1
[21:34:22] <cheeser> or that person is just a dick.
[21:34:23] <cheeser> 8^)=
[21:36:19] *** yoshx has quit IRC
[21:36:23] <deebo> troll manager, forces developers to use old tech for shits and giggles
[21:37:02] <thevishy> I will ask him .... right away he is on gchat
[21:37:36] <cbeust> gchat? Maybe there's hope for him then :)
[21:38:30] <thevishy> he is basically a trader ...was in java for long time ....decided to enough is enough ....and now when market is down , he is back to industry
[21:38:42] *** Frostix has quit IRC
[21:38:53] <cbeust> thevishy: if he's been away from JAva for a while, that might explain it. He does need to do some catch up though
[21:40:02] <thevishy> no he knows he is telling me java is like that , techolnology catches up muchh faster
[21:42:03] *** BoF has quit IRC
[21:42:08] <thevishy> he said its a legacy application and is more like maitainance
[21:42:08] *** BoF has joined ##java
[21:42:16] <thevishy> so whats the new replacement ?
[21:42:22] <thevishy> JSP ?
[21:42:31] <cbeust> ~~ thevishy web frameworks
[21:42:31] <javabot> thevishy, Popular web frameworks: JSF, JAX-RS, Struts 2, Stripes, Wicket, Spring MVC, Grails, GWT, Play, and Click. Ask me about each for more info.
[21:42:45] <thevishy> great
[21:42:55] <cbeust> JSP is pretty old itself and more considered as a foundation technology than a web framework per se
[21:43:25] <thevishy> right , jsp is a java feature that generates HTML ?
[21:43:27] <cbeust> thevishy: Myself, I have a preference for GWT. If it meets your requirements, I suggest you start with it
[21:43:43] <thevishy> Its a legacy app he says and its about maitaining it
[21:43:57] <cbeust> thevishy: ok fair enough, and bad news for you then :)
[21:44:40] <thevishy> yeah am asking him would he better jobs from clients :)
[21:45:26] *** terranova has quit IRC
[21:46:02] *** srji has joined ##java
[21:46:14] *** Guyman has joined ##java
[21:46:35] <Guyman> is there any way to check if a string begins with a word without using split?
[21:46:53] <dmlloyd> ~~ Guyman javadoc String.startsWith(*)
[21:46:54] <javabot> Guyman: http://is.gd/E6AHRL [JDK: java.lang.String.startsWith(String)]; http://is.gd/QKQZbS [JDK: java.lang.String.startsWith(String,int)]
[21:47:02] <Guyman> thanks
[21:47:13] <dmlloyd> usually you should check the javadoc before asking
[21:47:21] <Guyman> i missed it
[21:48:09] <Raystorm> thevishy: I came from PHP myself and went to Wicket(not my choice 2 websites we're already written with it.) There was a deffinite learning curve coming from PHP, however once I got used to it. It is actually a really nice framework. but if you have a choice defenitly read up on how they compare before picking one yourself
[21:49:48] *** mvno_subscriber has left ##java
[21:50:05] <Guyman> dmloyd how would i check if this word is the only one in the first row? (also without white spaces after it)
[21:50:39] *** VJTachyon has quit IRC
[21:50:59] <dmlloyd> strings don't have rows, Guyman
[21:51:09] <Guyman> is it line seperator?
[21:51:13] <Guyman> System.getProperty("line.separator")
[21:51:21] <dmlloyd> there is such a thing
[21:51:29] <dmlloyd> are you trying to say that you have a multi-line string?
[21:51:37] <cheeser> though whu use it?
[21:51:41] *** BoF has quit IRC
[21:51:42] <cheeser> s/whu/why/
[21:51:50] <Guyman> what?
[21:52:11] <Guyman> then what would i use?
[21:52:20] <dmlloyd> for what?
[21:52:22] *** BoF has joined ##java
[21:52:24] <thevishy> Thanks for that Raystorm I will do a review , but are different MVC's easy to learn once you learn one of them ?
[21:52:26] <Guyman> dmlloyd yes, i do
[21:52:33] <cheeser> ~javadoc Character.LINE_SEPARATOR
[21:52:34] <javabot> cheeser: http://is.gd/AGaym3 [JDK: java.lang.Character.LINE_SEPARATOR:byte]
[21:52:41] <bobbytek2> Is there a way to minimize the memory utilization for the following using a memory mapped file or other? final InputStream inputStream = new ByteArrayInputStream( veryBigStringBuilder.toString().getBytes( "UTF-8" ) );
[21:52:49] <dmlloyd> hey, kudos on the field support cheeser :)
[21:52:53] * cheeser bows.
[21:53:01] <cheeser> it's been there for a year or so P^)=
[21:53:01] <bobbytek2> Essentially calling getBytes will double the required memory
[21:53:16] *** io2 has quit IRC
[21:53:27] <dmlloyd> bobbytek2: easy, stop using ByteArrayInputStream
[21:53:45] <Guyman> whats the difference between Character.LINE_SEPARATOR to System.getProperty("line.separator") ?
[21:53:47] <cheeser> or use ASCII
[21:53:49] <bobbytek2> dmlloyd, okay, but I need to get this as a stream some how
[21:53:50] <Guyman> would it run also in UNIX ?
[21:53:50] *** cbrock has joined ##java
[21:54:07] <dmlloyd> ~~ bobbytek2 javadoc StringReader
[21:54:07] <javabot> bobbytek2: http://is.gd/xuaxbZ [JDK: java.io.StringReader]
[21:54:29] <Raystorm> Guyman: String.substring(0,String.indexOf(System.getProperty("line.separator")).endswith("myword"); or similar should work
[21:54:42] <dmlloyd> queuing stuff into a giant stringbuilder is also a bad idea, bobbytek2
[21:54:52] <bobbytek2> hmmm, can I easily convert this to an input stream?
[21:54:55] <Guyman> what about startsWith(WORD+System.getProperty("line.separator")
[21:55:00] <bobbytek2> If so that would be neato :)
[21:55:07] <bobbytek2> I will do some research
[21:55:12] *** hiredman has joined ##java
[21:55:14] <bobbytek2> Thanks dmlloyd
[21:55:21] <dmlloyd> bobbytek2: the JDK can't but there's about a zillion ReaderInputStream impls out there if you look around
[21:55:43] <bobbytek2> dmlloyd, will check it out. Perhaps guava has something
[21:55:45] <hyppias> JAXB, XJC/toString question: http://pastebin.com/7XWUnDBQ
[21:56:16] <hiredman> is it possible to replace the base64 decoder that javamail uses with your own?
[21:56:21] *** freeone3000 has joined ##java
[21:56:21] *** glcrazy has quit IRC
[21:56:34] <thevishy> wiki says : Struts is the most popular framework for developing Java based web applications
[21:56:56] <Raystorm> thevishy: I haven't learned any others, so I can't really say.
[21:57:17] *** n3C has joined ##java
[21:57:22] *** tktiddle has joined ##java
[21:57:22] <thevishy> right Raystorm
[21:57:26] <freeone3000> Having looked at struts, I'm fairly sure that's true in the same sense that C is the most popular language for developing desktop applications.
[21:57:30] *** c_axis has joined ##java
[21:57:57] <thevishy> Right so I guess its a legacy stuff now
[21:58:11] <thevishy> but maintained by Apache nonetheless
[21:58:14] <tktiddle> I want to have a flow layout and an image in a border layout, how do I do this?
[21:59:10] <freeone3000> tktiddle: You want a JPanel with a FlowLayout, and an JLabel containing an ImageIcon, inside another JPanel using a BorderLayout.
[22:00:23] *** srji has quit IRC
[22:01:00] <tktiddle> Ah OK thanks freeone3000, didnt realise JPanel was required
[22:01:20] <freeone3000> A container only has one layout.
[22:01:28] *** pldn has joined ##java
[22:03:10] *** BoF has quit IRC
[22:03:49] *** Guyman has quit IRC
[22:05:01] *** Pritchard has left ##java
[22:05:57] *** Johannes13 has quit IRC
[22:06:23] *** n3C has quit IRC
[22:06:46] *** kracker[BDC] has joined ##java
[22:07:43] <wessel> ojacobson: is this what you suggested?
[22:07:45] <wessel> http://pastebin.com/9qwEHuTd
[22:07:47] <wessel> seems to work
[22:08:44] *** aksn has joined ##java
[22:08:45] *** kracker[BDC] has quit IRC
[22:09:46] *** lmatteis has joined ##java
[22:09:48] *** Tjololo12 has joined ##java
[22:09:50] <lmatteis> hi
[22:10:05] *** pldn has left ##java
[22:10:30] <Tjololo12> Could someone help me out with some java-style regex I'm having a problem with?
[22:10:41] <lmatteis> somehow my webserver caches my class files because if i change or even remove class files the webserver is still able to reach them
[22:10:59] <freeone3000> lmatteis: To change your application, redeploy it.
[22:11:00] <lmatteis> how can i avoid this? is it up to the JVM to cache these class file?
[22:11:11] *** BoF has joined ##java
[22:11:22] <freeone3000> Nope. It's the application server doing its job. When you change your application, redeploy.
[22:11:47] *** vdv has joined ##java
[22:12:31] *** tewecske has quit IRC
[22:12:41] <lmatteis> freeone3000: redeploy? i just have to restart to see the changes
[22:13:02] <lmatteis> i'd like to avoid restart
[22:13:11] <freeone3000> lmatteis: Then redeploy.
[22:13:18] <lmatteis> define redeploy please
[22:13:28] <tktiddle> so how do i add a jpanel to a jframe??
[22:13:42] *** rekoil has left ##java
[22:14:01] <freeone3000> lmatteis: Your application server can reload a running application from a supplied WAR at minimum, and possibly even a directory of classes. It's like deploying, only the app was running. So it's redeploying.
[22:14:29] <tktiddle> sorry silly question
[22:14:37] <ojacobson> lmatteis: read your container's application deployment documentation
[22:14:39] <lmatteis> freeone3000: so redeploying = restart server?
[22:14:43] <freeone3000> lmatteis: Nope.
[22:14:50] <ojacobson> most containers have some kind of explicit deploy/undeploy step; some of them involve restarting the container, some do not
[22:14:52] <freeone3000> The server runs independently of the applications inside it.
[22:15:39] <lmatteis> freeone3000: but the server points to a war dir structure - that contains class files. my code changing involves updating these .class files. so what exactly is *deploying*?
[22:15:50] <freeone3000> lmatteis: Dunno. Ask your server.
[22:16:01] <lmatteis> what? it's a word you made up
[22:16:05] <lmatteis> so i ask you
[22:16:07] <ojacobson> No, he's right
[22:16:15] <ojacobson> generally you don't modify apps in-place within the server
[22:16:30] <lmatteis> within? why not
[22:16:31] <ojacobson> you package the app up as a WAR and deploy it using your container's deployment tools (tomcat's manager app, manually, whatever)
[22:16:53] <ojacobson> when you want to change it, you package up a new app and use your container's deployment tools to replace the existing app in-place, usually preserving things like sessions
[22:17:10] <Tjololo12> So if anyone knows/can help me with regex, I have a regex string: "((?i)[ a-z0-9]+?\\b)" and I need it to match "1st String" but not "1 String". Anyone know how to make it match only if there is a letter (or string) after the number?
[22:17:25] <ojacobson> Hot deployment tends to be leaky, so restarting after a deploy is not unusual, but most containers *have* hot deployment and redeployment.
[22:18:06] <freeone3000> Tjololo12: "\\d\\w" will match any one digit followed by any one word character.
[22:18:19] <ojacobson> Editing stuff in-place on a server is fine during development with a local server that you're usually restarting whenever the mood strikes anyways, but not for production or even testing environments
[22:18:33] <lmatteis> ojacobson: it seems silly to go through this deployment thing when i'm changing the dir withing the server (webapps/myproject) directly
[22:18:52] *** dropdrive has joined ##java
[22:19:24] *** hyppias has quit IRC
[22:19:24] <lmatteis> so the "deployment" just replaces the dir with the new dir? that involves deleting a bunch of files which is redundant
[22:19:27] <ojacobson> The deployment and undeployment step is exactly what you're looking for, though: it's a clear, formal point at which the container decides everything it knew about your app's classes and content is no longer valid (undeployment) and that a new set of definitions exists (deployment)
[22:19:42] *** BoF has quit IRC
[22:19:47] <ojacobson> no, there's usually classloader machinery and other internal-to-the-container wiring that gets torn down and rebuilt
[22:20:11] <ojacobson> sessions persisted out to disk for restoration into the new version of the app, etc
[22:20:13] <Tjololo12> freeone3000: I need to make it optional, so would I just do "((?i)(?:\\d\\w)?[ a-z0-9]+?\\b)"?
[22:20:15] <ojacobson> cached compiled JSPs thrown away
[22:20:28] *** bindaas has quit IRC
[22:20:53] *** bindaas has joined ##java
[22:20:54] *** penthief has joined ##java
[22:20:56] <freeone3000> Tjololo12: Making it optional will cause both strings to be matched, becuase [ a-z0-9]+ matches "1 string".
[22:21:20] <penthief> Is Tiles any good?
[22:22:08] *** Auv5 has quit IRC
[22:22:35] <Tjololo12> Yeah, that's what I just found out, sorry. I just tested it and it failed...I also need to match things without numbers...so basically if it has a number at the beginning, it needs to be followed by a letter or string. If it's followed by a space, it fails...Any ideas?
[22:23:06] <lmatteis> ojacobson: "Deployment is the term used for the process of installing a web application (either a 3rd party WAR or your own custom web application) into the Tomcat server.
[22:23:09] <lmatteis> "
[22:23:14] <lmatteis> i'm not installing - i'm developing
[22:23:19] <ojacobson> Same deal.
[22:23:24] <lmatteis> i can't do this every single time i want to see a code change
[22:23:32] <ojacobson> As a convenience, some containers (including tomcat) try to hot-deploy certain kinds of changes in place
[22:23:35] <ojacobson> sure you can
[22:23:38] *** LouisJB has joined ##java
[22:23:42] <ojacobson> mvn jetty:run # you're done
[22:23:52] <ojacobson> (tomcat:run, whatever)
[22:24:07] <sbalmos> Eclipse/IDEA Run > Application Server
[22:24:12] <ojacobson> Tearing down and starting up containers (and deploying and undeploying apps within those containers) is pretty normal
[22:24:18] <Tjololo12> shoot brb, duty calls
[22:24:24] <ojacobson> most IDE-to-container integration also redeploys your app whenever it needs to
[22:24:26] <ojacobson> which is often
[22:24:37] *** bindaas has quit IRC
[22:24:58] *** bindaas has joined ##java
[22:26:18] <freeone3000> Tjololo12: Basically, you want to match as the first sequence either a digit followed by a word character, or a nondigit. That's (\\d\\w|\\D).
[22:27:07] *** tigger0jk has joined ##java
[22:28:48] *** BoF has joined ##java
[22:29:23] *** ExtraSpice has quit IRC
[22:29:54] *** pen has quit IRC
[22:31:39] *** Kamaran has quit IRC
[22:31:45] *** MadOtis has left ##java
[22:33:40] *** dcope- is now known as dcope
[22:34:33] *** eyesUnclouded has quit IRC
[22:34:45] *** tilerendering has joined ##java
[22:35:31] *** gelignite has quit IRC
[22:35:37] *** freeone3000 has quit IRC
[22:35:48] *** dandre has joined ##java
[22:36:02] <dandre> hello,
[22:36:06] <lmatteis> hi
[22:37:06] <dandre> is there any way to choose wich application is launche when using Desktop.getDesktop().open(file)?
[22:37:37] <saml> hey, SomeEnum.values() is the order of elements in the returned array same as what's written?
[22:37:39] <dandre> I haven't found in the docs
[22:37:53] *** wessel has quit IRC
[22:37:56] <cheeser> the OS handles that not the JVM
[22:38:07] <saml> enum A { B, C } A.values() is it always [B,C] ?
[22:38:14] <saml> or can it be sometimes [C,B] ?
[22:38:37] *** LouisJB has quit IRC
[22:38:37] *** Wicked has quit IRC
[22:38:44] <dandre> yes but in the os there are more than one value the I cant choose with rightclic
[22:39:27] <dandre> is there something that gets all the possible actions accordinglly to the os?
[22:39:40] *** feathersanddown has quit IRC
[22:40:39] <dmlloyd> saml: yes they're always in declaration order, which you can get via the ordinal() method on the enum constant
[22:41:01] <saml> thanks dmlloyd
[22:41:05] *** Tashtego has joined ##java
[22:41:40] *** sebrock has quit IRC
[22:42:08] *** forneus has quit IRC
[22:43:44] *** gratz|home has joined ##java
[22:44:04] *** Prot has quit IRC
[22:45:24] *** IanWizard has joined ##java
[22:46:08] *** penthief has quit IRC
[22:48:07] *** Xeli has joined ##java
[22:49:54] *** forneus has joined ##java
[22:51:46] *** m_W has joined ##java
[22:53:36] *** SniperFodder has joined ##java
[22:54:37] <SniperFodder> Yo. I'm trying to do a window like an options window where you hit next and back and fill in options. I'm just not sure how to go about it. I'm trying to use a JLayeredPane but I'm failing miserably. Any suggestions?
[22:55:36] <cbeust> SniperFodder: You mean a wizard?
[22:55:42] <SniperFodder> yea, like a wizard.
[22:55:55] <cbeust> I don't believe Swing has wizards, you'll probably have to roll your own
[22:56:21] <SniperFodder> Yea, why I was thinking of using a JLayered pane. The LayeredPane isn't meant for that...
[22:57:07] <SniperFodder> but... I figured I would basically add all the panes I want with the options in each pane, and just set the pane in use as the top layer pane and all the panes behind it to not visible.
[22:57:24] <cbeust> If you're going to do that, take a look at a good API such as this one: http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
[22:57:29] <cbeust> Basically, a wizard has several pages
[22:57:30] *** lmatteis has quit IRC
[22:57:35] <cbeust> and you carry properties over from page to page
[22:57:48] <cbeust> don't commit them until the user presses Finish
[22:58:00] *** fuzzygroove has joined ##java
[22:58:27] <cbeust> And make sure you reinitialize each page with these properties so the user doesn't lose data that they typed but that haven't been committed yet.
[23:00:55] *** rjohnson19 has joined ##java
[23:01:02] *** RenatoSilva has joined ##java
[23:01:58] <SniperFodder> ooooo. This looks interesting
[23:03:58] *** mazzen has quit IRC
[23:03:58] <svm_invictvs> hm
[23:04:05] *** RenatoSilva has left ##java
[23:04:13] <svm_invictvs> Does System.currentTimeMillis() acquire locks?
[23:04:32] <dreamreal> svm_invictvs: I don't think so, unless the OS time() call does
[23:04:42] <dreamreal> and if it does, that OS must royally suck
[23:05:09] <svm_invictvs> I woudld imagine that it doesn't or if it does it's highly optimized to not be a huge hit.
[23:05:45] <dreamreal> well, "locks" and "highly optimized to not be a huge hit" are, like, not things that go together :)
[23:06:19] <svm_invictvs> yeah true
[23:06:39] *** pgib has quit IRC
[23:06:52] <svm_invictvs> yeah, well, I've been dealing with this stupid bottlenck issue where UUID obtains a lock on a static instance of SecureRandom
[23:07:06] <svm_invictvs> And I finally was like, 'Do we need UUIDs to tag exceptions or is a timestamp good enough?"
[23:08:46] *** dasilvj has quit IRC
[23:09:00] *** sebersole has quit IRC
[23:09:19] *** melow01 has joined ##java
[23:10:33] <svm_invictvs> Why does randomUUID need to use a secure random number generator?
[23:10:40] *** dasilvj has joined ##java
[23:10:41] <dreamreal> yikes. Consider nanotime, then.
[23:10:41] *** cbrock has quit IRC
[23:11:15] *** cbrock has joined ##java
[23:11:16] <svm_invictvs> dreamreal: Nobody evne reads the tags and noboddy even seems to know why we're tagging exceptions with UUIDs
[23:11:32] *** IanWizard has quit IRC
[23:11:39] *** tjsnell has quit IRC
[23:11:39] <dreamreal> then use a constant!
[23:11:47] *** Niamkik has quit IRC
[23:12:09] <svm_invictvs> haha
[23:12:13] *** KarlKFI|work has quit IRC
[23:12:26] <svm_invictvs> dreamreal: TRWTF is why are exceptions getting thrown often enough that it's a performance limiter :P
[23:12:28] <dreamreal> I was being serious
[23:12:49] *** fuzzygroove has quit IRC
[23:12:54] <dreamreal> depends on what's being defined as an exceptional condition, I guess
[23:12:59] <svm_invictvs> True dat
[23:14:27] <svm_invictvs> Whatever, three days on this stupid issue 90% politics and 2 lines of code later I'm ready to close the fucking bug..
[23:14:48] <svm_invictvs> (Granted I've only spent like 20 minutes total in those 3 days on it)
[23:14:53] <svm_invictvs> ~next
[23:14:54] <javabot> Another satisfied customer. Next!
[23:15:00] *** fuzzygroove has joined ##java
[23:15:11] *** fuzzygroove has left ##java
[23:16:59] *** kriko has joined ##java
[23:17:27] *** BoF has quit IRC
[23:17:31] *** LouisJB has joined ##java
[23:17:48] *** BoF has joined ##java
[23:19:08] *** eerie has quit IRC
[23:19:18] *** epalm has quit IRC
[23:19:52] *** phantomcircuit_ has joined ##java
[23:20:19] *** zhulikas has quit IRC
[23:21:16] *** beasty has quit IRC
[23:21:23] *** selckin has quit IRC
[23:21:23] *** anaconda has quit IRC
[23:22:53] *** gelignite has joined ##java
[23:23:41] *** pr3d4t0r has quit IRC
[23:24:04] *** eerie has joined ##java
[23:24:50] *** anaconda has joined ##java
[23:25:25] *** jogla has joined ##java
[23:26:47] *** BoF has quit IRC
[23:27:16] *** BoF has joined ##java
[23:28:13] *** Luc1fel has joined ##java
[23:28:46] *** wvdhaute has quit IRC
[23:28:50] *** pipeep has joined ##java
[23:30:14] *** FrozenKnight has quit IRC
[23:30:33] *** sbalmos has quit IRC
[23:30:48] *** ech0s7 has joined ##java
[23:30:49] <ech0s7> hi
[23:30:57] <ech0s7> anyone uses magicdraw ?
[23:31:18] *** saml has quit IRC
[23:31:21] *** kriko has quit IRC
[23:32:25] *** RogueShadow has joined ##java
[23:33:47] *** selckin has joined ##java
[23:34:09] <wyvern`> cbeust, nice writeup on the modern approach to singleton
[23:34:19] <cbeust> wyvern`: Thanks
[23:34:24] <wyvern`> Nothing new here, but nice to have one place to point the newblings
[23:34:58] <cbeust> Yeah I got tired of reading "singletons are evil" here :)
[23:35:21] *** riotz has quit IRC
[23:35:34] *** camcorder has quit IRC
[23:36:02] *** Gott__ has joined ##java
[23:36:07] <cheeser> they're not evil. they're just misguided souls in need of hugs. P^)=
[23:36:16] <cbeust> Aren't we all?
[23:37:59] *** BoF has quit IRC
[23:38:36] <tktiddle> How do I add a Jpanel to a boxLayout?
[23:38:45] *** davo has joined ##java
[23:39:03] *** ChanServ sets mode: +o dmlloyd
[23:39:04] <cheeser> ~javadoc BoxLayout
[23:39:05] <javabot> cheeser: http://is.gd/jm1y9u [JDK: javax.swing.BoxLayout]
[23:41:08] *** alex9999 has joined ##java
[23:42:36] <alex9999> I instantiate an JLabel with an Icon as a parameter but the Icon doesn't show up unless I use setText() and then it only shows up in a small rectangle surrounding the text. How can I get the Icon to be fully displayed and without any text?
[23:44:09] *** tizbac has quit IRC
[23:44:21] *** anaconda_ has joined ##java
[23:44:41] *** pipeep has quit IRC
[23:46:25] *** cbrock has quit IRC
[23:47:35] *** phantomcircuit_ has quit IRC
[23:48:24] *** FCTW has joined ##java
[23:48:28] *** cyphorious has quit IRC
[23:49:48] *** ech0s7 has quit IRC
[23:49:56] *** tjsnell has joined ##java
[23:50:50] *** mescalinum has quit IRC
[23:51:28] *** Tashtego has quit IRC
[23:53:13] *** cool123 has quit IRC
[23:54:11] *** Gott__ has quit IRC
[23:54:27] *** tjsnell has quit IRC
[23:54:28] *** cool123 has joined ##java
[23:54:35] *** eerie has quit IRC
[23:55:19] <davo> hi all. this snip of code i am working on only gets a random value one time, however i am trying to modify the code to get different random values for each loop. any ideas? http://pastebin.com/74aRxyxF
[23:56:00] *** tjsnell has joined ##java
[23:56:03] *** Soliah has joined ##java
[23:56:28] *** eerie has joined ##java
[23:56:53] <cbeust> Are you saying that calling nextInt() 3 times returns 3 identical values?
[23:57:18] <cbeust> Oh I see
[23:57:18] <SniperFodder> cbeust: singleton writeup? Link?
[23:57:29] <cbeust> Well you are creating an object with variables that you don't change inside the loop
[23:57:43] <cbeust> don't use variables, use random.nextInt() directly when you create the object
[23:58:08] <cbeust> SniperFodder: Singleton link: goo.gl/JV2rz
[23:58:12] <cbeust> http://goo.gl/JV2rz
[23:58:27] <SniperFodder> Danke
[23:58:51] <cbeust> Bitte.
[23:59:53] <Raystorm> Tjololo12: (((\\d)*\\w*)|\\w*) ?
top

   March 10, 2011  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | >