logs | stats
   March 14, 2010  
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

[00:00:01] *** sepult has quit IRC
[00:00:23] <yshavit> IvoryZion: well, but "null" means "default behavior." So for whatever reason, they wanted to give you this hook, but make it optional.
[00:00:46] <yshavit> I don't know if this hook in particular is a useful one :) but that idea is okay in theory.
[00:01:13] <IvoryZion> Really, what theory?
[00:01:38] *** sepult has joined ##java
[00:01:52] <yshavit> the "this is an optional thing that you may or may not want to override, and it's not important enough for us to force you to do so" theory
[00:02:13] *** skillz2billz has joined ##java
[00:02:15] *** QbY has joined ##java
[00:02:25] <IvoryZion> yshavit:  Like a "you should override this, but we really don't care" theory?
[00:02:53] *** Niall has quit IRC
[00:03:15] <QbY> this is probably an IDE question but I'm not getting an answer; i'm writing an app that requires the opening of a TCP socket.  how can i get my ide to let me write as me, but run it as root for debugging
[00:03:17] <yshavit> there's a difference between "you should" and "you must." If the default behavior is one that's fine 90% of the time, why force everyone who wants to extend JComponent to declare a method that does the same thing (returning null)
[00:03:51] *** adaro has quit IRC
[00:04:03] <pr3d4k4t> QbY: You don't.
[00:04:12] <pr3d4k4t> QbY: Open a non-privileged port.
[00:04:30] <QbY> pr3d4k4t: .. and then just change it for deployment?
[00:04:33] *** sepult has quit IRC
[00:05:10] <pr3d4k4t> QbY: Then use something sensible for deployment like a load balancer or a proxy.  Exposing apps through privileged ports is a no-no.
[00:05:26] <pr3d4k4t> QbY: Which port is it?
[00:05:28] <QbY> hrm.. i'm building a fake pop3  server
[00:05:28] *** sepult has joined ##java
[00:05:34] <thefalling> how do i make it to where if a user types 1 on the keyboard, it presses a button
[00:06:25] <pr3d4k4t> QbY: I see.  Try debugging it on port 11000 or whatever.
[00:06:47] *** lvh has left ##java
[00:06:49] <pr3d4k4t> QbY: Now to run that on 110 for real, you have a few options.
[00:06:50] <QbY> yeah,  i just  changed it to 10254
[00:06:52] <QbY> 1024
[00:07:14] <IvoryZion> yshavit: I see your point.  I would submit that a method that returns null should be wholly absent from the interface.  If it does nothing, then it probably shouldn't be included and overriders can implement their own.
[00:09:05] <yshavit> IvoryZion: But that would make it more difficult for the look-and-feel to use that method. It would have to use reflection to first find out if the method exists. For whatever reason, the Swing people thought this is important enough to declare the behavior, but that the default behavior of "do whatever you want" is good enough, and safe enough, to be the default implementation.
[00:09:08] *** Ilod has joined ##java
[00:09:56] <pr3d4k4t> QbY: The safest thing to do once you deploy for real is to run this setuid.  Google for that and you'll get lots of infos.  You'll need to write a shell program that starts Java with the appropriate permissions for accessing resources.
[00:10:29] <QbY> could always just use iptables i guess too
[00:10:45] <pr3d4k4t> QbY: Heh - and that's supposed to be easier for him?
[00:10:46] <yshavit> IvoryZion: it's a judgment call to put that method in that kind of a gray area, I'll grant that. In another universe, that might be an interface method. :)
[00:10:57] <pr3d4k4t> QbY: It'll certainly teach him a lot more about how to configure his system's network :)
[00:11:03] <QbY> i'm essentally building a server that our subscribers will connect to -- since we've moved -- when they connect it sends a single "email" advising them on what they need to do
[00:12:08] <pr3d4k4t> QbY: Why not just send them an email? ;;)
[00:12:18] <QbY> old mail servers are gone; and we did
[00:12:21] <QbY> tons of emails
[00:12:23] <QbY> and they ignored htem
[00:12:24] <QbY> :)
[00:12:41] <pr3d4k4t> QbY: And what makes you think that they'll pay attention to this?
[00:12:47] <c_axis> does anyone else not like the way ui event listening works in java?
[00:12:58] <c_axis> coming from obj-c where i can have different methods called directly for different events
[00:13:16] <pr3d4k4t> c_axis: Yeah, coming from Objective-C/Cocoa Java's event handlers suck.
[00:13:42] <pr3d4k4t> c_axis: Coming from Windows/KDE/Gnome, they look like the greatest thing since sliced bread.
[00:13:54] <yshavit> IvoryZion: anyway, it's nice to chat about. Some people don't have that kind of curiosity, they just say "that's how it is!" and get angry at the question "why"
[00:14:03] <pr3d4k4t> c_axis: If you are willing to overlook their lack of dynamism they're quite nice.
[00:15:19] <pr3d4k4t> c_axis: The real missing feature is the lack of delegates.  Otherwise you've got everything you need.  Think of the time when you hard-coded handlers to components in IterfaceBuilder; that's more or less how Java works.
[00:16:17] <IvoryZion> yshavit: I agree, the "why" of it, is typically very important.  At least in my opinion.  I can't say that I would never design software that way, but I can say, in 15 years I've never seen it clear to use a method that does nothing.  My experience doesn't preclude the need may exist.
[00:16:28] <IvoryZion> Thanks for your input.  I appreciate it.
[00:17:30] <yshavit> IvoryZion: My first reaction was actually that it was a mistake from an earlier rev, but javadoc says it's new in 1.5
[00:17:46] <yshavit> Maybe it's something that third-party vendors (JIDE etc) specifically requested?
[00:17:49] <c_axis> pr3d4k4t: yes, delegation would be lovely ; ). anyway, thanks
[00:19:54] <pr3d4k4t> c_axis: You're welcome.
[00:22:39] *** goki__ has quit IRC
[00:23:35] *** Niall has joined ##java
[00:25:55] *** BfrOv3rfl0w_ has joined ##java
[00:29:19] *** BfrOv3rfl0w has quit IRC
[00:31:05] <yshavit> IvoryZion: I was thinking about it as I was taking the trash out just now, and I agree with you. If it's that unimportant for most classes (I couldn't find a single class on google that overrides it), just declare it as a separate interface. Instanceof isn't so hard.
[00:31:46] <_W_> I don't see the need for even instanceof
[00:31:49] *** PowerJC has joined ##java
[00:32:11] <_W_> but then, spring would probably look quite different if I got to design it ^^
[00:32:12] *** PowerJC has left ##java
[00:32:15] <_W_> *swing
[00:32:59] * pr3d4k4t shakes his head.
[00:33:16] * pr3d4k4t leaves the channel before he gets the Java willies.
[00:33:22] <yshavit> _W_: if more than a couple classes would use it, but they don't have a common ancestor that also uses it, why not interface?
[00:33:44] <SEcki> instanceof is handy sometimes
[00:33:45] <yshavit> erm, s/interface/interface and instanceof/
[00:34:42] *** CodeWar has quit IRC
[00:34:45] <_W_> I don't think implementing an interface should have a functional effect
[00:35:09] <ojacobson> Indeed. Java's been moving away from magical tag interfaces since 1.5 (if not before that).
[00:35:13] <_W_> it muddies the waters, makes cause and effect harder to trace and keep track of
[00:35:32] <ojacobson> Annotations are okay, if only because they *don't* participate in the type system (extending an annotated class doesn't annotate your class, for example)
[00:35:35] *** Razorigga has quit IRC
[00:35:46] <ojacobson> Overuse of magic annotations can be just as bad, but it takes more
[00:35:50] <yshavit> ojacobson: this is an interface that would actually provide a method
[00:35:59] *** exobyte has quit IRC
[00:36:09] <ojacobson> Further, the need to "recover" type information (by using instanceof/casting) is a fairly major design smell
[00:36:13] <pr3d4k4t> ojacobson: To me that's more complexity on top of the language that it doesn't need.
[00:36:28] <ojacobson> If you need to use an object as a specific type, you shouldn't lose track of the fact that it's that type in the first place, and you shouldn't force your clients to do it for you, either
[00:36:36] <pr3d4k4t> ojacobson: And if Java didn't have a Pascal-like typing system you wouldn't need instanceof ;)
[00:36:40] <_W_> yshavit, I am fond of composition; if you want to send the library a component that provides a functionality, you should do so by sending an instance to a method
[00:36:41] <ojacobson> heh
[00:36:46] <ojacobson> nominative interfaces wbni
[00:36:53] <_W_> pr3d4k4t, I don't need instanceof
[00:37:42] <_W_> (and if I ever get around to making my own language for the JVM, it won't have such features)
[00:37:44] *** EricInBNE has joined ##java
[00:38:25] <yshavit> _W_: difference in style, I guess. That seems like it'd be messier to me, but to be fair I haven't done it much.
[00:39:20] <IvoryZion> This is my most recent, unsolved, Swing dilemma.  Right-clicking a JList brings up a JPopupMenu.  Selecting an option from the menu fires the associated actionPerformed() method.  In actionPerformed() I need to know the original JList item that was right-clicked on.
[00:40:02] <IvoryZion> The popup menu covers multiple list items when show.
[00:40:03] *** LouisJB has quit IRC
[00:40:40] <yshavit> IvoryZion: I forget, at the time that actionPerformed is called, is the JPopupMenu still open?
[00:40:45] <IvoryZion> Therefore getting the mouse location can of a clicked menu item may or may not return the JList item that was right-clicked.
[00:40:56] <IvoryZion> yshavit: good question.  No
[00:41:54] <Rainier> Add a mouse listener to the JList, catch which item was right clicked before the popup is shown (hopefully)
[00:42:06] <yshavit> IvoryZion: have you considered convincing your clients that CLI is the way to go? I'm not saying it'll be easier... but it'll be easier than dealing with the mess that is Swing. ;-)
[00:42:28] *** thefalling has quit IRC
[00:42:59] <ojacobson> Does right-clicking a list somewhere that isn't a selected item change the selection?
[00:43:07] <IvoryZion> yshavit:  I wish I could, but my client is my professor who's teaching a GUI programming class.  Hard sell maybe... :-)
[00:43:14] <ojacobson> If so, the right thing to do is to ask the list's selection model what was selected and operate on that/those
[00:43:28] <Rainier> IvoryZion, to determine whether or not the mouse click on the JList is a popup-able can be done via mouseEvent.isPopupTrigger();
[00:43:31] <yshavit> Real programmers don't use GUIs!
[00:43:41] <IvoryZion> ojacobson: Right click does fire a selection.
[00:43:45] <IvoryZion> *not
[00:43:49] *** rchern has quit IRC
[00:43:52] *** Insane8675309 has joined ##java
[00:43:55] *** okae has joined ##java
[00:43:57] *** Insane8675309 has left ##java
[00:44:05] <SEcki> yshavit: real programmers use ed!
[00:44:12] <Rainier> IvoryZion, right, that's why you use the isPopupTrigger() plus your own mouse listener on the JList to determine which item was right clicked, store it, then use that value later.
[00:45:03] <yshavit> SEcki: real programmers use the butterfly! Or possibly the butterfly shortcut in emacs.
[00:45:04] <Rainier> If that makes sense to you.
[00:45:24] <Rainier> ugh, can we just focus on helping IvoryZion and not unoriginal XKCD references?
[00:45:33] <Rainier> Good comedy is spontaneous
[00:45:41] *** lilalinux is now known as lilalinux_away
[00:45:57] * Rainier returns to his C program :-/
[00:46:11] <SEcki> yshavit: he, where is that xkcd about real programemrs ...
[00:46:28] *** rchern has joined ##java
[00:47:31] <IvoryZion> Rainier: So my ActionListener on JMenuItem needs a reference to the MouseListener on the JList.  The MouseListener will save the Point of the most recent right-click.  The actionPerformed() method will query the MouseListener for this Point.
[00:47:37] <IvoryZion> Is that correct?
[00:48:00] <yshavit> SEcki: http://xkcd.com/378/
[00:48:02] <Rainier> uh ... yeah, I think so.
[00:48:34] <yshavit> Rainier: sorry, I'll stop now.
[00:48:36] <Rainier> sorry, a bit distracted, but yeah, store the point (or better yet, the index calculated frrom that point!) somewhere accessible by both listeners.
[00:49:04] <IvoryZion> Rainier:  I think I can make that work.  Seems like quite a bit of scaffolding for something that could be much easier.
[00:49:22] <Rainier> the isPopupTrigger thing I mentioned isn't exactly necessarily, but it makes sure the points you store are only for events triggering the popup
[00:49:50] <SEcki> ~yshavit++
[00:49:50] <javabot> yshavit has a karma level of 2, SEcki
[00:50:59] *** c_axis has quit IRC
[00:51:15] <IvoryZion> The more I work with JLists, the more I feel they should have the option to be created as containers that maintain their contents rather than just paint them.  This would be heavier yes, but would simplify the programming model for people willing to trade size for ease.
[00:51:54] *** CheerBear_ has joined ##java
[00:52:01] <Rainier> I don't quite get how that would be better ...
[00:52:07] <FauxFaux> IvoryZion: I guarntee you someone will have wrapped that up for you.
[00:52:08] <IvoryZion> Then event listeners on the JLists could receive a reference to the element in question rather than juggle mouse coordinates and hoping for the best.
[00:52:20] <Rainier> That doesn't scale
[00:52:28] <Rainier> That's why they did JList and JTable the way they did
[00:52:40] <Rainier> It also destroys the easy separation between the view and the model.
[00:52:52] <IvoryZion> Rainier:  It should be an option in the ctor.
[00:52:57] <IvoryZion> Not necessarily.
[00:53:02] <FauxFaux> Or you could wrap it.
[00:53:06] <yshavit> IvoryZion: now that I think about it... this might be overly convoluted, but what if right-clicking the JList brought up the popup via an anonymous class (a Runnable or such), which the right-click action could initialize to store the JList?
[00:53:13] <Rainier> So now something that just you want should be an option for everyone?
[00:53:43] <Rainier> They created JLists and JTables to cover a pretty good base that everyone would be able to use.
[00:54:51] <IvoryZion> Rainier: I just think providing the option makes the client programming model more intuitive.
[00:55:19] *** CheerBear has quit IRC
[00:55:24] <Rainier> I don't think so ... I'd say that I understand how to get what I want very well because I also understand the fundamentals of how JList and JTable work.
[00:55:48] <Rainier> JList shouldn't behavior shouldn't be changed just because some people don't take time to get it.
[00:55:53] <yshavit> IvoryZion, Rainier: Then again, nothing precludes someone from writing such a self-managing component that uses JList...
[00:56:50] <Rainier> I really don't get how adding panels to another panel in a sequential grid is easier than a JList for this purpose. If I wanted that, I'd use a GridLayout parent panel and go from there.
[00:57:02] <Rainier> If all items were not the same height, then I'd try wrangling with SpringLayout or GroupLayout.
[00:57:55] <Rainier> (though in reality, I've found it pretty not-so-nice to get either to do a single column list of non-same-height panels that stretch from west to east ... maybe I should write another layout manager for that)
[00:58:23] <Rainier> (writing layout managers is relatively easy and, different from conventional thoughts, actually fun)
[00:58:40] <Rainier> StackLayout :)
[00:58:44] <Rainier> anyway ...
[00:58:44] <IvoryZion> Rainier: Having a Component maintained with a reference to it's model element doesn't break MVC.  I'm certainly not an MVC expert, but I don't see any imposed difficulty.
[00:59:12] <Rainier> You're managing it twice essentially though.
[00:59:34] <IvoryZion> Yes, but by choice because you, as the programmer, are given the option.
[00:59:48] <Rainier> You might as well replace those stacked components with an instance of a special class that directly contains the data it's worried about and how to paint it.
[01:00:13] *** CheerBear has joined ##java
[01:00:16] *** digitaloktay has quit IRC
[01:00:35] <Rainier> Besides the fact that it would use more memory, the model then has to either know which component is associated with what, or when the List is told to update, the List then has to tell that component, there's now 3 hops.
[01:00:58] <IvoryZion> Rainier: I guess we'll have to agree to disagree.  Although I understand your perspective.
[01:01:25] *** digitaloktay has joined ##java
[01:01:41] <Rainier> Not to be "mean" but I'm just saying this from (what I consider to be) a view of a person who knows how certain components in Swing work, and thus work with them, not against them.
[01:03:03] <Rainier> hmm, stacklayout doesn't seem like it'd be all that hard.
[01:03:26] *** CheerBear_ has quit IRC
[01:03:28] <Rainier> panel.add(panel, StackLayout.CENTER & StackLayout.FILL_HORIZONTAL);
[01:03:37] <shingoki> JList and JTable aren't awful, but they really aren't designed THAT well
[01:03:43] <shingoki> there are clear flaws with big parts of them
[01:03:48] <Rainier> Like what?
[01:04:09] <shingoki> Well, ListModel should be very similar to TableModel, but isn't
[01:04:17] <Rainier> I used to think they were quite awful (well, JTable anyway), but I've gotten much better at Swing and find them not to be all that terrible.
[01:04:39] <shingoki> For example as far as I can find, there is no neat way to fire an event that a list has changed completely
[01:04:45] <Rainier> shingoki, they serve different purposes, but I do find it a bit odd that the fire+ methods are public for DefaultTableModel but not DefaultListModel.
[01:05:00] <shingoki> They're not terrible, especially compared to every other table/list implementation I've ever seen
[01:05:08] <shingoki> they could just do with a version 2 ;)
[01:05:28] <Rainier> I don't think it would be that hard to add "list changed" fire method, though, if you wanted.
[01:05:30] <shingoki> Well, DefaultTableModel isn't really much use anyway, the Abstract stuff is all you need
[01:05:43] <shingoki> It's more a problem with the actual events
[01:05:50] <Rainier> DefaultTableModel is nice if you don't want to implement one yourself and need add/remove
[01:06:25] <shingoki> I guess, but I don't really like it, and implementing a TableModel is about the easiest bit of tables :)
[01:06:29] *** skbohra_ has joined ##java
[01:06:53] *** skbohra has quit IRC
[01:08:31] <shingoki> ListDataEvent only has "changed", "added" and "removed" types, which technically is enough, but it's needlessly messy to tell a listener that you have completely new contents
[01:09:13] <Rainier> then extend DefaultListModel, and add a method that tells it all the rows up to the previous amount changed and the rest are added.
[01:09:21] <shingoki> the "neatest" way I could find was to make the model temporarily appear to be empty, and fire a "removed" event for all rows, then appear to be full again and fire an "added" method for all rows
[01:09:36] *** nfrs has joined ##java
[01:09:37] <shingoki> yeah I guess you can chose that pair of events as well, instead of a remove then add
[01:09:43] *** Soliah has joined ##java
[01:09:44] <Rainier> which requires duplicate repaints :)
[01:09:49] <shingoki> but either way you end up with two events and possibly two updates
[01:09:50] <shingoki> yup
[01:09:59] <nfrs> is there a variant of File.createTempFile() to create a temporary directory?
[01:10:00] <shingoki> either one gives two repaints
[01:10:17] <shingoki> that's my point - there is no equivalent of the TableModel "everything has changed" event
[01:10:20] <Rainier> no, the "current rows need updating, then add the rest" doesn't
[01:10:31] <Rainier> that does one repaint per row
[01:10:35] <shingoki> yes it does, there is no event for "some changed and some added", you need two events
[01:10:47] <yshavit> I gotta head out, good night guys!
[01:10:52] <Rainier> right, but that's still only one repaint per row
[01:11:02] <Rainier> removing them all then readding them results in possibly two repaints
[01:11:13] *** yshavit has left ##java
[01:11:37] <shingoki> yes that's true. But of course it requires me to pointlessly work out whether I am bigger or smaller, then send either an added or removed to make the size change and a "changed" for the rest
[01:11:57] <IvoryZion> hmmm.... Even though JPopupMenu is no longer showing once my actionPerformed() method fires, it does have the properties desiredLocationX and Y which appear to contain the remnants of it's upper left corner.  Anyone know how to acquire these?
[01:11:59] <shingoki> if a single event for that made sense for table, which it definitely did, why did they not bother for lists?
[01:12:05] <Rainier> meh, them having a method for it would just mean they'd be doing that work for you anyway ... but whatever.
[01:12:10] <shingoki> not really
[01:12:13] *** Insane8675309 has joined ##java
[01:12:31] <shingoki> since a table can be told to just forget any internal state etc. and start again, which is exactly what you want to happen
[01:12:41] <Rainier> Well, they could repaint the whole thing entirely, true, but for whatever reason they didn't quite do it, besides the fact that that wouldn't be waht you wanted anyway.
[01:13:00] *** Stephmw has joined ##java
[01:13:05] <Rainier> because I've found when you tell a JTable that everything has changed, it seems to forget all the cell renderers you told it to use for columns.
[01:13:06] *** jcp has quit IRC
[01:13:20] <shingoki> plus it doesn't risk getting out of sync - I think that's why I went for the complete erase/replace approach, since I don't really want to trust every JList to always track everything, and I don't really see why whoever designed it wanted to have to track state in the model and also the view.
[01:13:20] *** jcp has joined ##java
[01:13:53] <shingoki> Rainier: It probably depends which event you give it - you need to make sure you send the one for "number of rows and row contents changed, but columns haven't"
[01:14:08] <shingoki> you might have given it the one where columns change as well, so columns would be rebuilt and renderers lost
[01:14:26] <Rainier> it doesn't matter, if you tell it rows 0 to end updated, it repaints them. if you tell it "table data changed" it forgets *everything*
[01:14:49] <Rainier> Anyway, I've figured out most of this stuff because I do stuff like this: http://www.asmcbain.net/projects/quickview/quickview.png
[01:14:56] <shingoki> no, there are at least 3 options. Some set of rows changed, Number of rows changed, rows and columns changed.
[01:15:17] *** CodeWar has joined ##java
[01:15:32] <shingoki> Well, I've also figured out at least that last one from doing jpropeller.googlecode.com ;)
[01:15:39] <Nickwiz> free UML tools for windows. Dia best?
[01:16:14] <Rainier> I'm talking about TableModel.fireTableDataChanged(), I think or fireTableStructureChanged(), unless I'm not recalling it correctly, I believe they both forgot cell renderers.
[01:16:34] <shingoki> fireTableStructureChanged is equivalent to setModel and will lose your columns. fireTableDataChanged specifically does NOT lose the columns. I don't think it should lose the renderers, but it might do ;)
[01:16:52] <shingoki> it certainly doesn't lose for example column width, etc. so it would be odd if it lost renderers, not sure though
[01:16:54] *** CodeWar has quit IRC
[01:17:14] <Rainier> that's what I mean, I think it loses the renderers, but I don't have anything handy with which to check, nor do I really want to spend time digging something up,
[01:17:41] *** rchern has quit IRC
[01:17:41] <shingoki> no that's fine, but it is still useful to have the extra options in table model that are missing in list model
[01:18:17] <Rainier> I think I already agreed to that, just for completeness, even if I wouldn't use them :P
[01:18:41] * Rainier should add his TreeTable code to his Swing Addendum project, rather than keep it separate.
[01:19:12] <shingoki> ah right, sorry to go on, I just remember that list thing as a face-palm moment when I realised what I had to do ;)
[01:19:23] <shingoki> I don't actually ever use JList myself, I always use a JTable with one column, since frankly that gives you the same thing with less duplication, but I needed a ListModel to use combo boxes
[01:19:30] *** rchern has joined ##java
[01:19:44] <Rainier> You can use ComboBoxes with a JTable
[01:19:47] *** geri has quit IRC
[01:19:58] * Rainier finds it neat that his TreeTable *doesn't* use JTree :)
[01:19:59] <shingoki> Ah can you? I must have missed that ;)
[01:20:24] *** allquixotic has joined ##java
[01:20:28] <Rainier> Well, it's not different than a JList in tha trespect, just make a renderer that handles that.
[01:20:58] <shingoki> Ah hang on do you mean displaying a combobox in a table, or using a tablemodel for the contents of a combobox?
[01:21:20] <Rainier> oh. if you mean the former, then yes. the latter, no.
[01:21:27] *** magn3ts has joined ##java
[01:21:43] <shingoki> ah well :(
[01:21:54] *** t0rc has joined ##java
[01:22:07] <Rainier> You could write an adapter, but you probably don't want to do that, given the discussion we've just been through :P
[01:22:10] <shingoki> it was the latter - I wanted nice combo boxes with a custom model, but the model has to be a listmodel, more or less. It's the only place where you actually have to use a listmodel
[01:22:13] <shingoki> yup
[01:22:13] <Rainier> s/given/knowing/
[01:22:32] <shingoki> the listmodels and tablemodels I use are all adapters from a more sane model anyway
[01:22:53] <allquixotic> Hi, I am running Sun JDK 1.6.0_18 on Ubuntu 9.10. I have a Swing JComboBox with an ItemListener. I set a breakpoint on the ItemListener's itemStateChanged method. Then I tried changing the selected value using the drop down. As a result, my entire X11 input system is locked up, and I have to drop to a TTY to kill Java to regain keyboard/mouse control.
[01:23:02] <Rainier> I don't see what's so insane about them, I use them directly ...
[01:23:10] *** Iszak has joined ##java
[01:23:18] <IvoryZion> Rainier:  I'm attempting to implement your idea on a JList.  I'm running into a bit trouble.  If I set JList.setComponentPopupMenu( my JPopupMenu ), any MouseListeners are not called.
[01:23:33] <shingoki> I should clarify I don't really dislike jtable/jlist though, I just think they could be better, which is not surprising given they are pretty old now. For reference, I looked at SWT, wxWidget and GTK tables/lists and none of them are particularly better
[01:23:48] <Rainier> IvoryZion, erm ... that shouldn't happen.
[01:24:14] <IvoryZion> Rainer: I've tried setComponentPopupMenu() before and after adding additional listeners, with the same result.
[01:24:18] <Rainier> IvoryZion, okay, in that case, you'll have to not do setComponentPopupMenu and have your mouse listener show the popup after it's gotten the information it requires.
[01:24:22] <shingoki> Rainier: They're not terrible, just not that great. For example, a Collections List is a much nicer "list" than a ListModel, so I more or less use a List for my model, then an adaptor to a ListModel or TableModel
[01:24:25] <IvoryZion> If I don't call setComponentPopupMenu(), the listeners are called.
[01:24:50] <Rainier> shingoki, I believe they were created before List
[01:24:52] *** goki__ has joined ##java
[01:25:13] <Rainier> and it attempts to be closer to JTable (though not the same as), so making it a List would make it quite different from TableModel.
[01:25:18] <shingoki> Rainier: Yup that's what I mean - the swing models aren't bad at all, for the time, but it's clear now that there are better ways to do the same thing
[01:25:56] <shingoki> Rainier: Yes my model is only for tables that actually display a "list of rows", which covers a lot of table use but obviously not all
[01:26:01] *** EnginA has joined ##java
[01:26:29] <Rainier> hmm, I'm not sure what a Table would do if not for listing rows with items in them ... ;)
[01:26:38] <shingoki> well yeah, so it covers most options ;)
[01:26:39] *** Ilod has quit IRC
[01:27:03] <shingoki> just a List, then a RowView that will convert an element of that list into a set of columns
[01:27:27] <shingoki> it's just a little easier to work with than a TableModel, because you don't need to reimplement the row handling every time, just the column handling
[01:30:11] *** andy^ has quit IRC
[01:30:41] <Rainier> hm, if I did put the TreeTable junk into Swing Addendum, I'd have to clean it up and move my dependence on DefaultTableModel on up to TableModel so I don't have methods that still update/work with internal DefaultTableModel data (I only overwrote / implemented what I used/needed)
[01:31:06] <Rainier> Which results in some wacky usage of stuff like addRow(*)
[01:31:40] <Rainier> great ... now I've got 3 extra things on my todo list I didn't expect.
[01:32:06] <shingoki> yay
[01:35:56] *** ankylose has joined ##java
[01:40:33] *** skillz2billz has quit IRC
[01:41:09] *** psyvenrix has joined ##java
[01:41:18] *** IvoryZion has quit IRC
[01:42:39] *** joet3ch has quit IRC
[01:44:34] *** IvoryZion has joined ##java
[01:45:36] *** piksel has joined ##java
[01:47:02] *** kmh_afk has quit IRC
[01:47:15] <IvoryZion> I wonder if anyone else has seen this.  I'm using NetBeans 6.8 and have the following line of code in a mouseClicked() method ---> JpopupMenu_menu.show( Jlist, e.getX(), e.getY() );
[01:47:37] <IvoryZion> If I set a breakpoint on that line, then step.  My entire Linux machine locks.
[01:47:38] *** DWSR has quit IRC
[01:48:14] <IvoryZion> I have to reboot.
[01:49:06] *** Willy has quit IRC
[01:50:52] *** nfrs has left ##java
[01:50:57] *** IvoryZion has quit IRC
[01:51:33] *** IvoryZion has joined ##java
[01:51:47] *** Magnastash has quit IRC
[01:51:50] <IvoryZion> Sorry if anyone responded and I missed it.
[01:51:52] *** EnginA has quit IRC
[01:51:55] <IvoryZion> Could you repost?
[01:52:11] *** mooglenorph has joined ##java
[01:52:16] *** korin43 has joined ##java
[01:52:53] <mooglenorph> Hi. I'm having .jar file problems: a jar that works on my home system with a blank classpath gives a NoClassDefFoundError on the system I'm trying to deploy to
[01:53:46] <mooglenorph> http://pastie.org/868526 is the MANIFEST.MF
[01:53:54] *** CheerBear_ has joined ##java
[01:54:26] *** Cymage has joined ##java
[01:54:28] <mooglenorph> I've verified that all those files are actually in the jar,
[01:54:41] *** luneff has quit IRC
[01:54:58] *** Theravadan has quit IRC
[01:55:27] <mooglenorph> And don't know what to try after that.
[01:56:41] <IvoryZion> mooglenorph: what are the OS's of the systems you're using?
[01:56:56] <mooglenorph> IvoryZion: linux and linux, one is debian, the other is a ROCKS cluster
[01:56:59] *** Zaidwi has quit IRC
[01:57:27] <mooglenorph> IvoryZion: the working one (my desktop) is debian. I have sun java 5 installed. I've even tried making the jar on the cluster, no dice, I get the same error.
[01:57:55] *** CheerBear has quit IRC
[02:00:38] *** vladimirs has joined ##java
[02:01:46] <mooglenorph> Okay, curiosier and curiosier: it works if I make the jar on the cluster, but not if I move the jar out of the directory it was made in.
[02:01:58] <IvoryZion> mooglenorph: Sometimes the current directory doesn't end up in the class path on some systems.
[02:02:46] <mooglenorph> http://pastie.org/868526
[02:03:07] <mooglenorph> I updated my paste with relevent info, am I doing anything obviously wrong there that would cause the behavior I listed?
[02:03:20] *** CheerBear has joined ##java
[02:03:26] <mooglenorph> Ideally I'd like to be able to make the jar on my home computer, copy it over the the cluster, and go.
[02:03:34] *** bojo_ has joined ##java
[02:03:35] *** bojo has quit IRC
[02:03:53] *** jottinger has quit IRC
[02:05:25] <mooglenorph> I may be totally misunderstanding this: does it look for support-jars INSIDE the jar I'm making, or in the directory that the jar is in in the filesystem upon invocation?
[02:06:20] *** CheerBear_ has quit IRC
[02:06:24] <Nickwiz> free UML tools for windows. Dia best?
[02:06:37] *** teralaser has quit IRC
[02:06:38] *** UnNaturalHigh has joined ##java
[02:07:52] *** BfrOv3rfl0w_ has quit IRC
[02:08:49] *** c_axis has joined ##java
[02:09:49] *** korin43 has quit IRC
[02:09:56] *** DWSR_ has joined ##java
[02:10:08] <UNIX107> what is necessary tools for compiling an classe on tomcat server ? thnks
[02:10:42] <impl> well
[02:10:46] <impl> first you need a Java compiler
[02:10:50] <impl> and then you need Tomcat
[02:10:55] <impl> and yeah that's pretty much it.
[02:11:07] <FauxFaux> And a clue, don't forget that.
[02:11:32] <impl> mm, yeah, that always slips my mind for some reason :(
[02:11:42] * impl pokes himself in the eye with a fork
[02:11:45] <hiredman> well, if you have a jvm you can use a java compiler written in java
[02:12:00] *** shingoki has quit IRC
[02:12:06] *** armyriad has joined ##java
[02:12:18] <impl> and if you write a little JSP script to upload the Java file and compile it for you
[02:12:21] <impl> all you need is Tomcat!
[02:13:13] <UNIX107> impl tomcat is installed !
[02:13:25] <impl> go you! *high five*
[02:13:26] <UNIX107> and run without problem
[02:13:34] *** seanthegeek has joined ##java
[02:13:34] *** DWSR_ is now known as DWSR
[02:13:57] <UNIX107> i have an small application run in local without prob but when i upload it to th server
[02:13:58] *** Iszak has quit IRC
[02:14:09] <UNIX107> i have probleme with compilation of classes
[02:14:37] <UNIX107> if some one interessted can see all page error in pastbin
[02:14:42] *** fadax has quit IRC
[02:14:47] <seanthegeek> I know a little C++, Python, and VB.NET. But, I have never worked with java, Where would be a good place for me to start?
[02:15:37] <UNIX107> in short thes is th pb : org.apache.jasper.JasperException: Unable to compile class for JSP:
[02:15:41] *** Stephmw has quit IRC
[02:15:59] <Rainier> seanthegeek, well, anywhere you like! but I'd suggest learning the basics first then working on simple apps and going on up.
[02:16:32] <seanthegeek> rainier: Thanks!
[02:16:41] *** seanthegeek has left ##java
[02:18:00] *** IvoryZion has quit IRC
[02:21:38] *** convivial has quit IRC
[02:23:24] *** DWSR has quit IRC
[02:23:43] *** andy^ has joined ##java
[02:23:54] *** convivial has joined ##java
[02:24:18] *** platzhirsch has quit IRC
[02:24:51] *** mpiechotka has joined ##java
[02:25:19] *** mpiechotka has left ##java
[02:25:47] *** SEcki has quit IRC
[02:25:57] *** Descra has joined ##java
[02:26:32] *** geaaru has quit IRC
[02:27:36] *** lilHermit has quit IRC
[02:29:20] <allquixotic> Does anyone know of an IDE or similar tool that generates an implementation of an interface that encapsulates another instance of the same interface, and forwards the calls and re-throws exceptions? I'm trying to get console output of all the methods called, their parameters and their return values for a fairly hairy interface. I can do it by hand, but it'd be nice to know if there's a tool for next time.
[02:30:26] *** ndouba has joined ##java
[02:30:31] <ndouba> hi all
[02:30:38] <vladimirs> allquixotic: NetBeans has a tool to generate GUIs
[02:30:39] *** NoobFukaire has joined ##java
[02:31:12] <allquixotic> vladimirs, No, I mean an "Interface", hehe, not a [Graphical User] Interface :)
[02:31:25] <allquixotic> as in: public interface Blah { ...
[02:31:28] <vladimirs> ah
[02:31:30] <NoobFukaire> a software contract
[02:31:50] <ndouba> I have a producer-consumer model written up using the Executors framework in java.util.concurrent. I took a look at the application's execution behaviour using visualvm (profiler) and noticed that only two threads are being engaged in parallel instead of 6 when i submit 6 parallel tasks.
[02:31:53] *** Magnastash has joined ##java
[02:31:58] <ndouba> any ideas what could be causing this behaviour?
[02:32:44] <NoobFukaire> sounds like you didn't make the pool large enough
[02:33:16] <ndouba> i have a pool of 10
[02:33:16] *** Brklyn has quit IRC
[02:33:24] <allquixotic> ndouba, your producer-consumer model has a bounded buffer, right?
[02:33:24] <NoobFukaire> pastebin
[02:33:28] <ndouba> isn't that enough for 6 parallel tasks?
[02:33:58] <ndouba> ~pastebin
[02:33:58] <javabot> http://mysticpaste.com - Paste the final url after you've pasted your stuff there.
[02:34:07] <allquixotic> ndouba, is it just that the tasks are sitting in the queue and not being started at all, or are the tasks being started and then blocking waiting for the buffer?
[02:34:13] <vladimirs> ndouba: are they waiting on some input? maybe there's a deadlock
[02:34:35] <NoobFukaire> lol mystic coders
[02:34:59] <ndouba> http://mysticpaste.com/view/2171
[02:35:05] *** UnNaturalHigh has quit IRC
[02:35:17] <ndouba> no all the tasks are completing
[02:35:26] <ndouba> but the problem is that only two threads are being engaged
[02:35:50] <ndouba> it seems like there is some sort of "thread affinity"
[02:35:54] *** terabit has quit IRC
[02:36:11] <NoobFukaire> that's usually an os thing, attaching an execution context to a specific cpu resource
[02:36:23] <NoobFukaire> so that way the memory stays coherent
[02:37:15] <ndouba> the second thing i find strange is that the second time i execute the method with the same inputs, the result gets returned 60% faster
[02:37:28] <vladimirs> caching?
[02:37:42] *** amr has joined ##java
[02:37:53] <ndouba> but results are being fetched from the internet
[02:38:05] <ndouba> how could caching come into play?
[02:38:06] <NoobFukaire> you are supplying enough tasks to use that may threads right?
[02:38:16] <amr> anyone here used the genady rmi plugin?
[02:38:19] <ndouba> i am supplying 6 threads at the same time
[02:38:31] <ndouba> s/threads/tasks
[02:39:40] <ndouba> i'll paste the output log
[02:39:44] <allquixotic> even if you had a uniprocessor, it should still at least use the available threads in the pool to start each of the 6 tasks, then interleave them... I don't think the hardware is really relevant unless you expect them to run literally at the same time on a system with SMP < 6
[02:40:07] <allquixotic> what SMPness is your CPU though, out of curiosity?
[02:41:38] <ndouba> http://mysticpaste.com/view/2174 <--- timing logs
[02:42:14] <ndouba> allquixotic: it is an intel core 2 duo
[02:42:29] <allquixotic> hmm :)
[02:43:42] <ndouba> allquixotic: that doesn't really explain why only two of the 10 threads are being used at any point in time
[02:44:02] *** NoobFukaire has left ##java
[02:44:19] *** v0n has quit IRC
[02:44:22] <ndouba> i understand that SMPness would allow me to run more processes in true parallel
[02:44:35] <ndouba> but i should see some staggered activity in each thread no?
[02:45:35] <vladimirs> ndouba: if i were u, id trace the control execution but with system.out messages
[02:45:57] <allquixotic> ndouba, have you tried using something like ScheduledThreadPoolExecutor? I see that you're using FixedThreadPool but you could also use another implementation of ExecutorService
[02:46:27] <ndouba> allquixotic: the events are invoked by user actions (unfortunately). they're not scheduled events.
[02:46:34] <hiredman> ndouba: do you have the visualvm output somewhere?
[02:47:12] <allquixotic> ndouba, you don't _have_ schedule anything with ScheduledThreadPoolExecutor, it's just another implementation != the Executors.newFixedThreadPool one. I don't know how much code they share under the hood, but I suppose that'd also depend on your JVM and platform
[02:47:24] <hiredman> are you really sure only two threads are running?
[02:47:52] <allquixotic> I suppose it's possible that, for some reason, your JVM says "Oh, you have SMPness of 2, so I'm only going to run two tasks at a time" -- but that would just about defeat the purpose of the ExecutorService
[02:48:44] *** joet3ch has joined ##java
[02:49:22] <allquixotic> it's certainly not that way on my platform -- I just wrote something using ScheduledThreadPoolExecutor a couple weeks ago, and had 20 threads interleaving tasks on an 8-way Core i7
[02:50:11] *** whaley has joined ##java
[02:50:38] *** BeholdMyGlory has joined ##java
[02:50:48] <ndouba> hmm
[02:50:52] <ndouba> sorry i was absent for a while
[02:50:57] <ndouba> i was trying to profile the code again
[02:50:58] <allquixotic> if I were you I'd set a breakpoint or suspend your program while it's running in an IDE like netbeans or eclipse, and use the threads window to see what the state of all the threads in the JVM is
[02:51:34] <ndouba> ok so i took a look again
[02:51:35] <vladimirs> allquixotic: i second that
[02:52:18] <ndouba> alright..
[02:52:19] <ndouba> one second
[02:53:09] *** UnNaturalHigh has joined ##java
[02:53:30] <allquixotic> vladimirs, but now that I think about it, I'm not exactly clear on how ndouba would distinguish between a thread that's blocked because of his application logic, and a thread that currently does not have a task from the executor
[02:53:53] <allquixotic> a blocked thread (e.g. waiting on I/O) would probably be in the "sleeping" state, right?
[02:54:01] <allquixotic> but a thread that currently has _no_ task associated would also be sleeping?
[02:54:17] <allquixotic> can probably walk the individual thread stack traces to see though :)
[02:54:46] <vladimirs> using system.out.println would still show any blocks IMO
[02:55:27] *** UnNaturalHigh has quit IRC
[02:56:25] *** SudoKing has quit IRC
[02:57:32] *** SudoKing has joined ##java
[02:59:24] <ndouba> hi all
[02:59:28] <ndouba> did what you suggested
[02:59:34] <ndouba> 3 tasks are running concurrently only
[02:59:42] <marcosroriz> guys do you think this name is too stupid? getSortedValidFields();
[02:59:43] <marcosroriz> ?
[03:00:05] <_W_> yes
[03:00:21] <marcosroriz> anyidea of a better name?
[03:00:33] <marcosroriz> I want to express that I'm getting the valid fields of a given class in a sorted way
[03:00:34] <_W_> something more specific
[03:00:36] <ndouba> sortValidFields?
[03:00:37] <ndouba> :P
[03:00:48] *** dfas has quit IRC
[03:00:49] <_W_> also, the "sorted" part might be part of the return type (e.g. SortedSet)
[03:01:01] <_W_> "fields" is meaningless
[03:01:05] *** karter has joined ##java
[03:01:27] <marcosroriz> ndouba, I liike this name
[03:01:29] <marcosroriz> sortValidFields
[03:01:46] *** karter has left ##java
[03:02:04] <ndouba> so back to my threadpool problem:()
[03:02:05] <ndouba> :)
[03:02:20] <ndouba> 7 threads are suspended and 3 are running
[03:03:07] *** nmx has quit IRC
[03:03:46] <allquixotic> are you able to get a stack trace on the threads that are suspended?
[03:04:42] *** zed_DX has joined ##java
[03:05:40] *** Niall has quit IRC
[03:06:44] *** piksel has quit IRC
[03:08:58] <ndouba> allquixotic: hmmm
[03:08:58] <ndouba> ok
[03:09:00] <ndouba> i see it now
[03:09:05] <ndouba> 6 threads
[03:09:53] <ndouba> but now my problem is this... if we are interleaving then how come the time it takes to execute 5 tasks in parallel =~ 5 tasks in sequence on the first try but on the second try it's 60% faster?
[03:10:37] *** vladimirs has left ##java
[03:12:20] <allquixotic> ndouba, might be caching somewhere between you and the remote host
[03:13:22] <allquixotic> send different data and it shouldn't be any faster
[03:13:31] <ndouba> true
[03:13:44] <ndouba> but allquixotic: the response time from the remote host is always consistent
[03:13:48] <ndouba> ~200ms per request
[03:13:48] <javabot> ndouba, I have no idea what 200ms per request is.
[03:13:56] <ndouba> lol
[03:13:56] <allquixotic> what JVM and OS?
[03:14:08] <ndouba> debian java 6se
[03:14:23] <allquixotic> Sun Java?
[03:14:32] <ndouba> yes
[03:14:38] <allquixotic> hmm, very similar to my environment then
[03:15:20] <allquixotic> have you tried replacing the "guts" of your code with just some simple print statements or producing random integers? in other words, throw out your app logic and just try basic stuff using the same executor pattern. I might be able to save you time on that actually
[03:15:32] <allquixotic> I did something for a programming assignment, but since it's all over and I got a 100%, I guess I can share with you :)
[03:15:42] *** okae has quit IRC
[03:15:50] <ndouba>   lol
[03:15:59] <ndouba> graduated from university for some 10 years now;0
[03:16:20] <ndouba> i dont think you need to worry about programming assignments:)
[03:16:21] <allquixotic> it uses a ScheduledThreadPoolExecutor to push sequential integers into a buffer (producers), and print them out (consumers)
[03:16:33] <allquixotic> if you run it, and it only starts two threads, then we know it's your platform
[03:16:42] <allquixotic> I'll jar it up and send it over
[03:21:00] <armyriad> Is there anyway that I can view the code that makes up the default classes? For example, could I see the code in the ArrayList class?
[03:22:29] *** dawciobiel has joined ##java
[03:23:02] <FauxFaux> armyriad: The JDK contains the code, in the cunningly disguised "src" jars.
[03:23:10] <FauxFaux> Your IDE will show you them if you haven't failed at setting it up.
[03:24:05] *** bulletxt has joined ##java
[03:24:17] *** dawciobiel has quit IRC
[03:24:37] <bulletxt> hi, is it somehow possible to have a portable jvm? So I can put it together with my app and use it instead of making the user have to install jvm?
[03:25:36] *** setz has quit IRC
[03:26:41] <SeriousWorm> http://portableapps.com/node/903 ?
[03:26:54] <FauxFaux> bulletxt: There's no sensible way to do that.  gcj is the most popular but it sucks unbelievably terrible.
[03:27:07] <bulletxt> ok.... :) thanks
[03:27:12] <bulletxt> that's what I thought
[03:27:14] <SeriousWorm> http://portableapps.com/apps/utilities/java_portable
[03:27:28] <bulletxt> SeriousWorm: thanks Ill check it out
[03:27:32] <SeriousWorm> np
[03:28:35] *** emehrkay has joined ##java
[03:29:43] *** servo has quit IRC
[03:31:17] *** mreggen has joined ##java
[03:31:31] *** ndouba has quit IRC
[03:36:42] *** joed has joined ##java
[03:40:14] *** askhl_ has quit IRC
[03:41:59] <donthitme> PYTHON SUPREMACY
[03:44:02] *** askhl_ has joined ##java
[03:47:25] * armyriad hits donthitme
[03:48:43] *** Angel-SL has joined ##java
[03:49:03] *** jasecrucial has joined ##java
[03:53:11] *** sepult has quit IRC
[03:54:57] <tiemonster> is there a way to put focus on a text field after processing an actionPerformed?
[04:02:09] *** anaconda has quit IRC
[04:02:51] *** samferry is now known as sam_
[04:03:34] *** anaconda has joined ##java
[04:05:13] *** domX_ has joined ##java
[04:06:49] *** Iszak has joined ##java
[04:06:58] *** ndouba has joined ##java
[04:09:52] *** domX has quit IRC
[04:12:15] *** joet3ch has quit IRC
[04:13:03] *** SudoKing has quit IRC
[04:13:04] *** SudoKing_ has joined ##java
[04:13:46] *** SudoKing_ is now known as SudoKing
[04:14:02] *** daN-R-G has quit IRC
[04:14:38] *** amr has quit IRC
[04:16:24] *** meling2 has quit IRC
[04:16:46] *** meling2 has joined ##java
[04:17:53] *** joet3ch has joined ##java
[04:21:38] *** yshavit has joined ##java
[04:22:13] *** tiemonster has quit IRC
[04:23:01] *** Rainier is now known as AMcBain
[04:25:35] <oorza> In an abstract class, is there a way to define it such that child classes must implement an abstract inner class?
[04:25:49] <joed> ~tias
[04:25:49] <javabot> Try it and see. You learn much more by experimentation than by asking without having even tried.
[04:27:15] *** Furyhunter has joined ##java
[04:28:11] *** kater_ has quit IRC
[04:28:18] *** forneus has joined ##java
[04:28:44] <FauxFaux> I'm confused by the question.
[04:28:58] *** ankylose has quit IRC
[04:29:09] <joed> As is he.
[04:29:18] <joed> That is why I asked him to try it.
[04:29:51] *** kater has joined ##java
[04:29:56] <oorza> Alright, I have an abstract class, and I want all children to define some methods inside an inner class.
[04:30:08] <oorza> abstract class foo { abstract class bar { } }
[04:30:40] <FauxFaux> It would be kind of cool to be able to do abstract class A { static abstract class Q { abstract void foo(); } static Q newQ() { return new Q(); } }; not that I can think of a sensible use.
[04:30:46] *** emehrkay has quit IRC
[04:31:30] <FauxFaux> You can't do that.  Why do you want to?  As I said, I can't think why.
[04:32:16] *** alek_b has quit IRC
[04:32:20] <Soliah> Is it bad style to do while (true) { ... break } ?
[04:32:37] <AMcBain> Not necessarily.
[04:32:53] *** bojo_ has quit IRC
[04:33:05] <AMcBain> Which is the best way of saying yes and no at the same time while not expressing an opinion on it (which everyone has sooner or later).
[04:33:15] <Soliah> Hah.
[04:33:24] <yshavit> Soliah: It's not *always* bad, but it often is :)
[04:33:28] <FauxFaux> What else are you going to write?   while (somebool) { if (cond()) somebool = false; else { ... ? } };
[04:36:52] *** poseidon has quit IRC
[04:37:42] <Soliah> Actually it was bad. Just needed to think about it differently :\
[04:37:59] *** Mavrik- has quit IRC
[04:39:36] *** CodeWar has joined ##java
[04:39:51] *** vsync has quit IRC
[04:40:17] *** alek_b has joined ##java
[04:40:21] <yshavit> Soliah: that's usually the case :) while(true) is almost always (but not always always) due to not thinking about it right.
[04:41:44] *** c_axis has quit IRC
[04:42:40] <Soliah> I guess most of the time if you have while(true) { if (cond()) ... } you can probably move cond() to while (cond()).
[04:46:50] <FauxFaux> Yeah.  Obviously ...; if(cond()) ... ; ...; } ...
[04:47:15] <yshavit> and conversely, most of the time if you have while(true) { ... if(cond()) {break;} } then it's better to do while(!cond()) {...}
[04:47:55] <yshavit> or possibly a do-while, though I may get yelled at for saying that. ;-)
[04:48:05] *** CodeWar has quit IRC
[04:48:26] <AMcBain> why?
[04:48:38] <yshavit> AMcBain: why would I get yelled at for it?
[04:48:40] *** juan--d-_-b has joined ##java
[04:48:46] <AMcBain> yes
[04:49:09] *** Magnastash has quit IRC
[04:49:20] <yshavit> AMcBain: there are those who say it's A Bad Thing and implies code smell, though I (and I guess you) aren't among them.
[04:49:49] <AMcBain> I use what makes sense and is logical to use at the time, unless there's some other significant reason not to use it.
[04:50:20] <yshavit> Ditto. :-)
[04:52:18] *** juan--d-_-b has quit IRC
[04:52:37] *** juan--d-_-b has joined ##java
[04:52:48] *** bojo_ has joined ##java
[04:55:36] *** digitaloktay has quit IRC
[04:56:14] *** xerora has joined ##java
[04:59:26] *** CheerBear_ has joined ##java
[05:02:16] *** dj_segfault has quit IRC
[05:02:46] *** CheerBear has quit IRC
[05:07:09] *** c_axis has joined ##java
[05:07:14] <joed> yshavit: Nothing wrong at all with a do while, a BREAK might be another question, same as a continue, document it.
[05:07:50] *** digitaloktay has joined ##java
[05:07:59] *** CheerBear has joined ##java
[05:09:11] <joed> yshavit: Out of context and unless we did peek at your code combined with the comments I don't think we should comment.
[05:10:46] *** CheerBear_ has quit IRC
[05:14:32] *** [Justice] has quit IRC
[05:15:14] *** UNIX107 has quit IRC
[05:21:44] *** enav has joined ##java
[05:23:31] <enav> hello
[05:24:30] *** andy^ has quit IRC
[05:25:28] <yshavit> hello, enav
[05:25:58] <enav> ^_^
[05:28:46] *** ldam has quit IRC
[05:29:53] *** meatmanek has joined ##java
[05:32:46] <QbY> what's the easiest way to backup to prevent destruction from updateS?
[05:33:00] <QbY> i have a second drive---i'd like to make a mirror image..
[05:33:16] *** jottinger has joined ##java
[05:33:30] <enav> i use a program called syncnow
[05:33:39] <meatmanek> regularly back up your data
[05:33:41] <yshavit> I use hopes and prayers.
[05:33:44] <yshavit> or a VM
[05:33:55] <meatmanek> make
[05:34:01] <meatmanek> whoops wrong window =P
[05:34:09] *** marcosroriz has quit IRC
[05:34:36] <yshavit> "make" is an anagram of a subset of the characters of "meatmanek." Coincidence?
[05:34:38] <QbY> well this is the first time i've installed updates since getting my video system working right
[05:35:04] <QbY> i guess i could always just back up / to my second drive
[05:35:11] <QbY> and if x won't start, restore it
[05:35:26] <meatmanek> you should probably ask for this kind of advice in your distro's channel
[05:35:27] <the_birdman> ~javadoc AttributedString
[05:35:28] <javabot> the_birdman: http://is.gd/ayzto [JDK: java.text.AttributedString]
[05:35:29] <meatmanek> instead of #java
[05:35:39] <QbY> fuck
[05:35:45] <QbY> sorry just realized the window
[05:35:46] *** rjohnson19 has quit IRC
[05:36:03] <meatmanek> it happens
[05:36:11] <QbY> i joined it--just didn't switch
[05:36:14] <QbY> long day
[05:40:54] *** bojo_ has quit IRC
[05:41:25] *** ldam has joined ##java
[05:43:26] *** joet3ch has quit IRC
[05:43:44] *** t0rc has quit IRC
[05:43:54] *** _mutex has joined ##java
[05:43:58] <_mutex> hey guys
[05:44:04] <_mutex> i have a question regarding bytecode validation
[05:44:13] <_mutex> is the following case valid:
[05:44:40] <_mutex> having an exception entry whose handler_pc points to an 'aload' instruction, which is followed by a 'moniterexit' instruction
[05:45:50] *** mvfranz has quit IRC
[05:47:21] *** rjcarr has joined ##java
[05:48:06] <rjcarr> i'm using a buffered image to composite two images together, where the top image has transparent portions
[05:48:45] <rjcarr> however, sometimes, the top image doesn't have transparent portions, and in this case, I'd like to not also create the bottom image (since it won't be seen)
[05:49:18] <rjcarr> and the top image is created with a huge collection of various paths (basically, i'm contouring data)
[05:49:42] <rjcarr> so ... is there any way to know if the image has an alpha portion, without querying each pixel?
[05:51:17] *** bojo_ has joined ##java
[05:52:32] <AMcBain> not really, unless it's loaded up as a format that doesn't support transparency, then you would be able to possibly tell by checking the format.
[05:53:30] <AMcBain> but depending on what sizes you consider to be significant, you don't have to check /every/ pixel.
[05:54:23] <AMcBain> just the verticies of a grid that leaves cells just smaller than an area size you consider significant.
[05:57:36] *** mr_danie1 has joined ##java
[05:59:49] <rjcarr> AMcBain: The images are always 256x256 but the transparency can occur anywhere
[06:00:30] <rjcarr> e.g., http://raptor.apl.washington.edu/eis/gebcosat/1/0/0.png
[06:00:49] *** mr_daniel has quit IRC
[06:01:19] <rjcarr> The contoured area is only for the water, but if water is the only thing in the image, then I don't need to include the satellite background
[06:01:27] *** yogione has quit IRC
[06:01:56] <rjcarr> Your first suggestion is interesting ... could you explain a bit more about that?
[06:02:51] <enav> i can see my home on that picture
[06:06:04] *** convivial has quit IRC
[06:06:07] *** Sulis has quit IRC
[06:06:14] *** convivial has joined ##java
[06:09:23] *** joet3ch has joined ##java
[06:09:34] *** rjcarr has quit IRC
[06:09:34] *** ryan-g has joined ##java
[06:12:10] *** ryan-g has quit IRC
[06:13:26] *** vncntd has joined ##java
[06:15:22] <armyriad> What source lookup path should I enter into Eclipse on Linux?
[06:16:25] <QbY> anyone have a good tutorial for creating threads based on serversockets?
[06:20:25] <_mutex> QbY, you mean a thread-per-client design?
[06:20:47] <_mutex> that is quite an awful choice to be quite frank
[06:20:58] <QbY> _mutex: ..yes
[06:21:18] <_mutex> not really much of a tutorial needed
[06:21:27] <_mutex> ServerSocket ss = new ServerSocket(..);
[06:21:58] <_mutex> while(..) { new ClientThread(ss.accept()).start(); }
[06:22:26] <_mutex> assuming ClientThread is a java.lang.Thread subclass
[06:23:03] *** nikhil_ has joined ##java
[06:23:09] <QbY> k
[06:28:09] *** harmaz has joined ##java
[06:28:15] *** goddard has joined ##java
[06:28:47] <goddard> I am trying to make my first jar file or exectuable type of file and it isn't working I am using BlueJ
[06:28:55] *** yshavit has quit IRC
[06:29:52] <harmaz> hi i've only developed java in IDEs. whats the simplest way to build and compile via command line? Makefiles?
[06:31:50] <the_birdman> ~ant
[06:31:51] <javabot> the_birdman, ant is a tool for building Java programs, found at http://ant.apache.org
[06:32:03] <the_birdman> ~javac
[06:32:04] <javabot> Here is some information about javac that you may find useful: http://java.sun.com/javase/6/docs/technotes/tools/solaris/javac.html
[06:35:17] *** bearded_oneder has left ##java
[06:36:08] <goddard> dose anyone know how to create a exectuable
[06:37:04] *** ndouba has quit IRC
[06:40:38] *** joop_ has left ##java
[06:41:59] *** juan--d-_-b has quit IRC
[06:47:47] <the_birdman> ~~goddard izpack
[06:47:48] <javabot> goddard, izpack is an installer for java apps - http://izpack.org
[06:47:56] <the_birdman> ~~goddard jsmooth
[06:47:56] <javabot> goddard, I have no idea what jsmooth is.
[06:48:44] <the_birdman> ~jsmooth is <reply>JSmooth is a Java Executable Wrapper. It creates native Windows launchers (standard .exe) for your java applications. See http://jsmooth.sourceforge.net/
[06:48:44] <javabot> OK, the_birdman.
[06:49:09] *** chewed-on has joined ##java
[06:49:31] <the_birdman> ~makeself is <reply>Makeself is a small shell script that generates a self-extractable tar.gz archive from a directory. See http://megastep.org/makeself/
[06:49:31] <javabot> OK, the_birdman.
[06:49:32] <chewed-on> What does it mean again when I use the keyword 'this' after a class name ?
[06:49:43] <chewed-on> e.g. MyClass.this
[06:50:44] <_mutex> is it possible to produce exception entries with javac whose handler_pc's point to an instruction that is not ASTORE?
[06:55:38] *** jasecrucial has left ##java
[06:56:47] <allquixotic> Does anyone know if javax.swing.table.TableModel.getRowCount() should count the column header row in the row count?
[06:57:53] *** bindaas has joined ##java
[07:00:46] *** vncntd has quit IRC
[07:01:02] *** Junior has joined ##java
[07:01:08] <FauxFaux> (Oh heart, zsh completes javap -c arguments)
[07:01:08] *** vncntd has joined ##java
[07:03:27] *** pavan_ has joined ##java
[07:04:09] <the_birdman> allquixotic: , no
[07:04:36] *** AMcBain has quit IRC
[07:05:13] *** nikhil_ has quit IRC
[07:06:42] *** Cymage has quit IRC
[07:08:58] *** c_axis has quit IRC
[07:09:50] *** goddard has quit IRC
[07:17:05] *** w00tz_ has joined ##java
[07:18:57] <w00tz_> Hello, I'm largely a C++/Python developer that has dabbled in a few projects for Java (nothing too serious), I was wondering if there's a programming reference (book and/or online reference is fine) that can quickly get me up to speed regarding various advanced java topics as well as java's toolchains (e.g. ant, etc).
[07:20:29] *** vmhobbes has quit IRC
[07:21:05] <pr3d4k4t> w00tz_: Not really.
[07:22:35] <pr3d4k4t> w00tz_: There are multiple sources of information.  Java comprises so many technologies that you may want to fine tune the scope of what you're looking for.
[07:23:14] <pr3d4k4t> w00tz_: The same applies to the toolchain.  You start with getting the JDK and then must make choices based on what you're trying to accomplish.  You'll find strong biases toward Maven or Ant, depending on who you ask.
[07:23:29] <pr3d4k4t> w00tz_: Same about ancillary development tools like IDEs.
[07:25:53] <w00tz_> pr3d4k4t: I use emacs for almsot all development, but I've used Netbeans before
[07:26:06] *** totex has quit IRC
[07:26:08] <w00tz_> pr3d4k4t: interestingly enough, that's the sort of answered I feared, but thanks.
[07:26:33] <pr3d4k4t> w00tz_: Don't feel bad.
[07:26:57] <pr3d4k4t> w00tz_: I use Vim/MacVim for all my Java development, Maven, JDK.  It's all about what you want to accomplish.
[07:27:26] <pr3d4k4t> w00tz_: I don't like any of the IDEs out there except for Xcode, and I learned to like that one only for Mac development, non-Java.
[07:27:41] <pr3d4k4t> w00tz_: If I were going to use a Java IDE, though, I'd go for IDEA.
[07:29:02] <_mutex> eclipse is good as well
[07:32:22] *** emehrkay has joined ##java
[07:35:15] <chewed-on> w00tz_: want to try android development like me ? :D
[07:35:20] <chewed-on> I got 0 programming experience too lol
[07:35:27] <chewed-on> you got an advantage :)
[07:35:46] <chewed-on> w00tz_: it uses Java
[07:36:27] <chewed-on> Eclipse + Java
[07:37:08] *** psyvenrix has quit IRC
[07:37:22] *** respecting has joined ##java
[07:37:25] <respecting> hi please i have a big problem making my asp.net with more than one language(i want it in french and english).The problem is that in JAva world there is somehting called Internationlisation i had to use RessourceBundle but in dotnet i have made a search on google i don't know what must i use please can some body help me :( ? and thanks in advance
[07:40:07] *** Greyhound- has quit IRC
[07:40:40] *** Nachturnal has joined ##java
[07:41:34] <FauxFaux> respecting: Um, you're in the wrong channel for asp.net help.
[07:41:46] <respecting> ah ok thanks
[07:42:01] <pr3d4k4t> w00tz_: Eclipse is good if you don't mind dealing with an endless learning curve.  Professional developers gravitate toward IDEA because it's a much better product.  The Java version is free to use; enterprise development requires paying for a license.
[07:42:40] <respecting> by the way i have a question what's the future of J2EE i have heard it will disapear or it will not be Free coz oracle have bought sun
[07:42:41] <pr3d4k4t> w00tz_: Based on all the projects I led and the development budgets I managed, if you give developers the option of getting IDEA they'll chose that over any other tool.
[07:43:08] <karstensrage> ~emacs++
[07:43:08] <javabot> emacs has a karma level of 7, karstensrage
[07:43:11] <pr3d4k4t> w00tz_: Remember that I don't use any of those IDEs anyway, so I don't care either way.
[07:43:35] <pr3d4k4t> w00tz_: But people I managed do, and they unwaveringly go for IDEA.  So do most hardcore guys here in ##java.
[07:43:52] <w00tz_> I'll give it as hot
[07:44:30] <chewed-on> Eclipse is industry standard no ? :P
[07:46:10] <Nachturnal> I don't even know how to begin explaining this without showing my code. Basically I'm trying to test some java concepts with a program that tests whether CLI input matches a string. But I can't get it working correctly. Link: http://etherpad.com/nachturnal
[07:46:37] <Nachturnal> Even when I type the correct response, I get the "else" output.
[07:46:39] *** emehrkay has quit IRC
[07:46:39] *** yshavit has joined ##java
[07:47:20] *** _KY_ has joined ##java
[07:47:21] *** chewed-on has quit IRC
[07:47:33] <_KY_> How can I convert an object into JSON?
[07:48:05] <pr3d4k4t> ~tell _KY_ about Gson
[07:48:05] <javabot> _KY_, gson is an Apache 2.0 licensed JSON processing library written by Google.  It uses annotations and reflection to serialize/dseralize JSON objecs to and from POJOs. It can be found here: http://bit.ly/LOCU1 . See also ~json.
[07:48:28] <Nachturnal> Can anyone point out what I'm doing wrong?
[07:49:37] *** Stericson has joined ##java
[07:50:00] <Stericson> hello!
[07:50:22] *** Insane8675309 has quit IRC
[07:50:35] *** adaro has joined ##java
[07:50:43] <Nachturnal> hi
[07:50:56] <FauxFaux> Nachturnal: Your problem is related to the fact that you seem to think an ajax pastebin is a good idea.
[07:51:48] <FauxFaux> ~~ Nachturnal string comparison
[07:51:48] <javabot> Nachturnal, string comparison is http://mindprod.com/jgloss/string.html
[07:52:00] <Stericson> whats the best way, to have java browse a directory on a server and return files one by one (these files would be images) Im not looking for the answer per say but a starting point will get melooking in the right direction
[07:52:20] <Nachturnal> FauxFaux, thanks. Is it really so bad to use Etherpad, though?
[07:52:24] <FauxFaux> ~~ Stericson javadoc File
[07:52:24] <javabot> Stericson: http://is.gd/3okU3 [JDK: java.io.File]; http://is.gd/isoT [Wicket: org.apache.wicket.util.file.File]; http://is.gd/3okTU [Wicket1.4: org.apache.wicket.util.file.File]
[07:52:42] <FauxFaux> Nachturnal: I normally open pastebins in links.
[07:52:49] <Stericson> Fantastic thanks :)
[07:53:34] <enav> how do you guys compress those links???
[07:53:49] <Iszak> ...
[07:54:09] <FauxFaux> Assumably is.gd has an api.
[07:54:49] <enav> how do you make a normal link short  like this  http://is.gd/3okU3
[07:54:51] <Nachturnal> FauxFaux, Nice, that link is just what I needed. Thanks again.
[07:54:59] <enav> is some kind of Md5 compression
[07:55:19] <FauxFaux> Nachturnal: That would have been covered by any beginners documentation / lectures on about page one... just so you know.
[07:57:55] *** yshavit has left ##java
[07:58:04] <enav> thanks   that is a nice tool
[07:58:36] *** respecting has quit IRC
[08:00:05] <pr3d4k4t> FauxFaux: He wants to do it on a server.
[08:00:44] <pr3d4k4t> Stericson: When you say "on a server" do you mean connecting to the server over something other than NFS or SMB/CIFS or talking to the file system?
[08:00:56] <FauxFaux> pr3d4k4t: Mmm, I didn't read it that way.  But yes, I may have jus tscrewed him a little.
[08:00:58] <pr3d4k4t> Stericson: If so, you want to look at WebDAV and see if it's supported by the server.
[08:01:05] <pr3d4k4t> FauxFaux: ;)
[08:01:21] <pr3d4k4t> FauxFaux: Let's hope he meant local file system, or locally-accessible file system ;)
[08:01:22] <Stericson> yea...I mean like going through http :)
[08:01:32] <Stericson> not locally available
[08:01:43] <pr3d4k4t> Stericson: OKi, then check this out:
[08:01:50] <pr3d4k4t> ~tell Stericson about HttpClient
[08:01:50] <javabot> Stericson, httpclient is a deprecated http client package for Java by Jakarta. It can be found at http://hc.apache.org/httpclient-3.x/index.html - note that it has dependencies like commons-codec, commons-logging, and possibly the other 18,000 jakarta dependencies that tend to accompany any single jakarta lib. Otherwise, great stuff. See ~httpcomponents for more current stuff.
[08:01:51] <FauxFaux> There's no such thing s a list of files for plain http.  You get back a web page.  You get to look at the web page.
[08:02:06] <pr3d4k4t> Stericson: There are also a couple of WebDAV clients.
[08:02:10] <pr3d4k4t> ~WebDAV
[08:02:10] <javabot> pr3d4k4t, I have no idea what WebDAV is.
[08:02:17] <pr3d4k4t> Stericson: Google for that.
[08:02:20] <FauxFaux> Nor should anyone else. /o\
[08:02:23] <the_birdman> ~webdavclient4j
[08:02:23] <javabot> the_birdman, I have no idea what webdavclient4j is.
[08:02:41] <Stericson> Thanks, ive used that to download files, just so far I havent figured out how I can browse for files...etc, but I will google it, thanks :)
[08:03:12] *** epure has joined ##java
[08:03:45] <Stericson> Thanks again guys :)
[08:03:47] <enav> lol so nice http://is.gd/azkzy
[08:04:01] <the_birdman> ~webdavclient4j is <reply>webdavclient4j is a generic WebDAV client for Java born after the death of jakarta slide. See http://sourceforge.net/projects/webdavclient4j/
[08:04:01] <javabot> OK, the_birdman.
[08:05:23] *** yshavit has joined ##java
[08:06:56] *** Insane8675309 has joined ##java
[08:08:07] *** zed_DX has quit IRC
[08:08:53] <Stericson> web
[08:09:15] <Stericson> webDav looks more like an extension for writing to files on a server, or writing to a server
[08:09:22] <Stericson> is that a correct statement?
[08:09:46] <Stericson> (im still reading, but making sure I'm understanding it)
[08:13:02] *** X-Scale has left ##java
[08:13:43] *** _mutex has quit IRC
[08:14:58] <FauxFaux> Yeah, it's terrible, don't use it. ¬_¬
[08:15:13] * pr3d4k4t smacks FauxFaux.
[08:15:18] <pr3d4k4t> Stericson: WebDAV is fine.
[08:15:19] *** yokai has joined ##java
[08:15:30] <yokai> hay, good evening
[08:15:31] <pr3d4k4t> Stericson: Just assume that you do all the heavy lifting.
[08:15:36] <pr3d4k4t> ~tell yokai about welcome.
[08:15:36] <javabot> yokai:  http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome
[08:15:39] <FauxFaux> She's writing a spider, not a well-defined client. :p
[08:16:09] <pr3d4k4t> FauxFaux: That doesn't mean it's fine to dis WebDAV ;)
[08:16:15] *** QbY has left ##java
[08:16:22] <yokai> sorry, i'm from brazil, o'clock is now 4:19am
[08:16:33] <pr3d4k4t> FauxFaux: Pretty large apps use it all the time, and it's been stable for 12 years or so.
[08:17:18] *** pavan_ has quit IRC
[08:17:24] <FauxFaux> Yeah, I'm kind of biased by having tried to work with subverison.  Calling something fail because it's associated with the official subversion implementation is hardly fair.
[08:17:54] <pr3d4k4t> FauxFaux: If it's good enough for .Mac/MobileMe and it's hundreds of thousands of users, it's probably fine.
[08:19:04] *** Tniffoc has left ##java
[08:19:28] *** Xianny has quit IRC
[08:20:49] *** rellis has quit IRC
[08:21:18] <Stericson> lol
[08:21:22] *** the_birdman has quit IRC
[08:22:07] *** harmaz has quit IRC
[08:22:13] *** rellis has joined ##java
[08:22:15] <FauxFaux> pr3d4k4t: Doesn't it require some stupidly large number of roundtrips for some simple operations?
[08:22:31] <pr3d4k4t> FauxFaux: It requires whatever it requires.  Look at the WebDAV spec :)
[08:22:47] <pr3d4k4t> FauxFaux: It'll require at least an OPTIONS and  GET if you're fetching files.
[08:22:55] <FauxFaux> I can't remember what I was reading.
[08:23:15] *** yokai has quit IRC
[08:24:49] <Stericson> well
[08:25:00] <Stericson> Ill read up on both suggested methods
[08:25:08] <Stericson> FauxFaux what do you recommend?
[08:25:27] <FauxFaux> UrlConnection and a ton of regexes. *runs*
[08:25:41] <Stericson> *jaw drop*
[08:27:14] *** freeone3000 has joined ##java
[08:27:18] <Stericson> I'll read up on both, it will be beneficial at any rate :)
[08:27:36] <Stericson> thanks to you both.
[08:31:12] *** Peej has quit IRC
[08:33:32] <pr3d4k4t> Stericson: Use a WebDAV client.
[08:33:39] <pr3d4k4t> ~tell Stericson about regex
[08:33:39] <javabot> Stericson, Please see the tutorial at http://java.sun.com/docs/books/tutorial/essential/regex/ -- If you know what you're doing, go to http://javachannel.net/wiki/pmwiki.php/FAQ/Regexp ; otherwise ask me about javadoc Pattern or javadoc String.split(*)
[08:34:14] <Stericson> ok
[08:34:18] <Stericson> Reading up on that as well
[08:34:47] <pr3d4k4t> FauxFaux: http://rifers.org/paste/show/541 ;)
[08:35:06] <_KY_> gson.toJson() is supposed to convert any object?
[08:35:24] <pr3d4k4t> _KY_: Converter tool = new Converter();
[08:35:38] <pr3d4k4t> _KY_: tool.toJson(yourObject);
[08:35:48] <FauxFaux> pr3d4k4t: Ew mac!
[08:35:56] <pr3d4k4t> _KY_: Or, more aptly:  String payload = tool.toJson(yourObject);
[08:35:58] <oorza> Is there anyway to use byte[] as keys in a Hashset?
[08:36:26] <_KY_> pr3d4k4t: where is Converter imported from?
[08:36:29] <freeone3000> List<Byte>, but be sure to wrap it with Collections.unmodifiableList() first.
[08:36:56] *** vy has joined ##java
[08:37:28] <pr3d4k4t> _KY_: Oh, wait.
[08:37:34] <pr3d4k4t> _KY_: I think it's Gson, yes.
[08:37:38] <oorza> freeone3000, is that me?
[08:37:40] <oorza> for me*
[08:37:42] <pr3d4k4t> _KY_: import com.google.gson.Gson;
[08:37:52] <_KY_> Well.. I did that
[08:37:54] <pr3d4k4t> _KY_: I haven't used it in a few weeks.
[08:37:58] <_KY_> But it failed
[08:38:01] <oorza> well let me explain
[08:38:02] <freeone3000> oorza: Yes.
[08:38:02] <pr3d4k4t> _KY_: ?
[08:38:07] * pr3d4k4t checks the code.
[08:38:10] <_KY_> The convertion got an error
[08:39:32] <oorza> I have a binary field in a database that's stored non-binary (not my requirement) as distorted UTF-8 and I need to compare it to a query string parameter. :x
[08:40:18] <pr3d4k4t> _KY_: Then something must be fux'd with your object.
[08:40:24] <oorza> And since there's like 350,000 entries, I figured a HashSet would be the fastest/best way to do that but...
[08:40:24] <adaro> oorza: that wont work
[08:40:25] <oorza> :\
[08:40:28] <pr3d4k4t> _KY_: Check that all member references are serializable, for starters.
[08:40:37] *** mr_daniel has joined ##java
[08:40:40] <_KY_> The error is "circular reference exception"
[08:40:48] *** KDE4000 has quit IRC
[08:40:50] <adaro> oorza: you'll get illegal ut8 sequences if you store binary data in there
[08:41:03] <adaro> codepage encodings will work, not utf8
[08:41:08] <oorza> adaro, I know
[08:41:14] <pr3d4k4t> _KY_: All you need is:  private static Gson converter = new Gson();
[08:41:26] *** mr_danie1 has quit IRC
[08:41:31] <pr3d4k4t> _KY_: Then, every time you need to convert you just issue:  String s = converter.toJson();
[08:41:37] <pr3d4k4t> _KY_: Then, every time you need to convert you just issue:  String s = converter.toJson(myObject);
[08:41:39] <pr3d4k4t> _KY_: :)
[08:42:12] * pr3d4k4t ponders scaring _KY_ a little :)
[08:42:51] <_KY_> Heh... I'm not scared... but the conversion fails for some reason... =)
[08:42:58] <adaro> oorza: your whole question makes little sense then :)
[08:43:14] <pr3d4k4t> _KY_: http://eugeneciurana.com/musings/dynamic_mule_updates/muleservice.py.html - this is what might scare you ;)  Line 48.  That's all you need to do, really.
[08:43:16] *** markcl has joined ##java
[08:43:33] <adaro> you can always base64 encode itm
[08:43:43] <oorza> adaro, I can get the byte sequence out of the database (duh) and get the byte sequence from the query string, but I'm not sure if there's a fast way to compare them.
[08:43:44] <pr3d4k4t> _KY_: What error does it give you?
[08:43:51] <oorza> adaro, I can't change the database at all.
[08:44:00] <_KY_> The error is "circular reference exception"
[08:45:05] <adaro> oorza: Arrays.equals
[08:45:05] <adaro> but i doubt you'll get the correct bytes from the database
[08:45:43] *** mr_danie1 has joined ##java
[08:45:46] <oorza> So there's no way for me to get the correct bytes out of the database without converting the way the information is stored?
[08:45:55] <pr3d4k4t> _KY_: That means one of your references is referring to the object that you want to serialize.
[08:46:02] <pr3d4k4t> _KY_: Something is pointing at this within that object.
[08:46:08] <pr3d4k4t> _KY_: Fix that and you're set.
[08:46:29] <adaro> oorza: you can store it as base64 encoded data
[08:46:42] <_KY_> It's not really my object...
[08:46:47] <oorza> adaro, then I'd have to change the way it was stored, no?
[08:46:53] <adaro> thats kinda verbose tho
[08:47:01] *** mr_daniel has quit IRC
[08:47:25] <adaro> oorza: the column type stays the same,but you'd have to convert existing data (its probably corrupted anyway)
[08:47:54] <pr3d4k4t> _KY_: Then you need to serialize it manually.
[08:48:12] <oorza> It's not corrupted because the existing app, which is written in PHP and thus not character safe aware, works.
[08:48:17] <pr3d4k4t> _KY_: I assume that it has some kind of accessor for the attributes that you care about.  You build the JSON representation manually.
[08:48:33] <pr3d4k4t> _KY_: And you bitch to the retards who built the object in the same place to fix their code ;)
[08:48:36] <oorza> character-set aware*
[08:49:10] *** Theravadan has joined ##java
[08:49:46] <pr3d4k4t> _KY_: http://sites.google.com/site/gson/gson-user-guide#TOC-Using-Gson
[08:50:37] <_KY_> Pr3d4k4t: thanks... maybe I don't need to do that anyway... but thanks
[08:50:39] <adaro> oorza:  if you can somehow get the raw bytes by all means do
[08:50:51] <pr3d4k4t> _KY_: You're welcome.  May the Source be with you.
[08:51:04] <adaro> but if you fetch it as a string then call getBytes() it will be corrupt
[08:51:10] <oorza> adaro, I would think getBinaryStream() and ByteArrayOutputStream would work?
[08:51:56] <adaro> oorza: try it and see
[08:54:58] <oorza> nope
[08:54:58] <oorza> :X
[08:56:09] *** asnark has joined ##java
[09:00:04] *** Determinist has quit IRC
[09:04:33] *** jcp has quit IRC
[09:10:39] *** Razorigga has joined ##java
[09:13:42] *** pastyhermit has quit IRC
[09:16:14] *** lars_bauer has joined ##java
[09:23:32] *** Xianny has joined ##java
[09:27:07] *** Rayne has joined ##java
[09:27:51] *** LouisJB has joined ##java
[09:29:24] <enav> I wonder if there is any easy way to encrypt / decrypt a string using a key
[09:30:18] *** Gracenotes has joined ##java
[09:31:41] *** sphenxes has joined ##java
[09:32:46] <armyriad> The MessageDigest class can encrypt a string.
[09:33:24] <enav> i will google it
[09:33:29] <enav> thanks mate
[09:36:16] *** kriko has quit IRC
[09:36:46] *** asnark has left ##java
[09:38:56] <adaro> MessageDIgests are for oneway hashing. eg non reversable
[09:38:59] <adaro> if you also need to be able to read the data back then you probably need something like javax.crypto.Cipher
[09:40:06] <enav> yep i need to code a message send the message to another computer and decode that message at recipient
[09:41:32] <enav> (String)--->(Codification)---->[Send over TCP/IP]--->(decodification)---->(String)
[09:42:21] <adaro> then messageDigest is useless to you
[09:42:22] <enav> i want to do something easy like this    method(String, key)
[09:43:26] <enav> hum
[09:43:34] *** Furyhunter has quit IRC
[09:44:16] *** yshavit has quit IRC
[09:44:25] <enav> i made long time ago a encryption method but this works like a trick   not like a real encryptator
[09:44:57] *** Iszak has quit IRC
[09:45:16] *** skoskav has quit IRC
[09:45:23] <adaro> enav:  why not use SSLSocket then
[09:45:53] *** alleyrat has joined ##java
[09:46:23] <enav> i need to read about "Sockets Direct Protocol"  to finish the java trial
[09:47:04] <enav> maybe on that topic is the solution
[09:47:53] <oorza> adaro, alright, I got it converted to a blob, but I still need to compare the binary data in the blob field (20 bytes) to a GET parameter and I'm having no luck :\
[09:49:16] *** BeholdMyGlory has quit IRC
[09:49:43] <adaro> oorza: how are you encoding the get parameter
[09:51:09] <oorza> adaro, it's URL encoder
[09:51:13] <oorza> encoded*
[09:51:55] <oorza> %f1%a8%db%3a_%b4m%05%11Cu-%e5s%7d%82%c1%1b%81%f3
[09:51:57] <oorza> There's an example
[09:51:59] <adaro> oorza: urlencoder takes a string not a byte array
[09:52:13] <oorza> I'm not sending these requests, just receiving them!
[09:54:03] <oorza> I can iterate over the lsit of results, using ArrayUtils.isEquals (from apache commons, with request.getParamter().getBytes("ISO-8859-1") and blob.getBytes()) and get a find, but I can't afford to iterate over everything
[09:55:24] *** vncntd has quit IRC
[09:55:56] *** Stericson has quit IRC
[09:56:18] *** taras has joined ##java
[09:57:24] *** ldam has quit IRC
[09:57:35] <adaro> sigh.. just about everything you are trying to do seems wrong on so many different levels
[09:57:59] <oorza> :X
[09:58:06] <oorza> Well it *is* 4 AM :P
[09:58:55] <adaro> what exactly are you trying to build
[09:59:11] <adaro> because whatever it is you are probably doing it wrong
[09:59:13] *** rburton- has quit IRC
[10:00:10] *** Nachturnal has quit IRC
[10:01:05] <oorza> A bittorrent tracker :P
[10:01:21] <oorza> And no, the spec is just that retarded.
[10:01:57] <oorza> info_hash, the hash that identifies the unique content, is a raw binary hash that's sent URL encoded over the wire as a get parameter and every database implementation on the planet stores them the same way.
[10:04:05] <oorza> WEll, not url encoded, but as binary crap.
[10:05:48] <enav> soo   SSLSocket  is secure enough to transmit sensitive data?
[10:06:23] *** Peteris has joined ##java
[10:06:55] <Peteris> how to disable newlines in JTextAreas?
[10:07:00] <Peteris> or maybe there is another component for that?
[10:07:16] <enav> yep
[10:07:20] *** skoskav has joined ##java
[10:07:31] <enav> jtextfield
[10:07:37] *** Determinist has joined ##java
[10:07:42] <enav> have no newlines
[10:07:46] <Peteris> thank you!
[10:08:14] <jottinger> ~documentation++
[10:08:14] <javabot> documentation has a karma level of 2, jottinger
[10:09:29] *** lilalinux_away is now known as lilalinux
[10:11:02] <enav> Peteris: http://is.gd/azUef
[10:11:41] <enav> look at the char
[10:11:45] <enav> chart
[10:11:48] <adaro> oorza: how long is the hash, either store it as a number in the database or hex encode it and save it as a string , then just use where
[10:12:42] <oorza> adaro, it's a sha1 hash.  Is there a method somewhere to convert byte arrays to hex strings?
[10:13:16] *** tom17bombadil has joined ##java
[10:13:22] *** ldam has joined ##java
[10:13:24] *** _KY_ has left ##java
[10:14:46] *** Peteris has quit IRC
[10:15:23] <enav> im f*** tired    bay bay
[10:15:28] *** enav has left ##java
[10:15:58] *** adaro has quit IRC
[10:16:54] *** Kestrel-029 has joined ##java
[10:18:30] *** skbohra_ has quit IRC
[10:19:02] *** skbohra_ has joined ##java
[10:21:12] *** adaro has joined ##java
[10:24:36] *** bindaas has quit IRC
[10:25:10] *** Rayne has left ##java
[10:25:40] *** Matic`Makovec has joined ##java
[10:39:58] *** nikhil_ has joined ##java
[10:40:10] *** kriko has joined ##java
[10:44:30] *** tom17bombadil has quit IRC
[10:46:23] *** deSilva has joined ##java
[10:52:55] *** Kestrel-029 has quit IRC
[10:53:19] *** adaro has quit IRC
[10:55:03] *** skbohra_ has quit IRC
[10:55:42] *** skbohra_ has joined ##java
[10:55:47] *** elfgoh has joined ##java
[10:57:14] *** geri has joined ##java
[10:58:42] *** PygoscelisPapua has quit IRC
[10:59:47] *** mr_danie1 has quit IRC
[11:00:14] *** PygoscelisPapua has joined ##java
[11:03:24] *** alleyrat has quit IRC
[11:04:15] *** akira13 has joined ##java
[11:04:29] *** e1n85 has joined ##java
[11:04:34] *** Crushpest has joined ##java
[11:08:01] *** meatmanek has quit IRC
[11:11:31] *** kane77 has joined ##java
[11:12:29] *** mr_daniel has joined ##java
[11:14:53] *** magn3ts has quit IRC
[11:14:55] *** mr_danie1 has joined ##java
[11:15:08] *** platzhirsch has joined ##java
[11:18:32] *** akira13 has left ##java
[11:20:11] *** mr_danie1 has quit IRC
[11:20:11] *** mr_daniel has quit IRC
[11:23:46] *** forneus has quit IRC
[11:27:19] *** Gravitron has quit IRC
[11:27:24] *** bojo_ has quit IRC
[11:30:03] *** bojo_ has joined ##java
[11:32:28] *** genesiss has joined ##java
[11:32:42] *** magn3ts has joined ##java
[11:37:48] *** teralaser has joined ##java
[11:38:44] *** luneff has joined ##java
[11:40:35] *** Ilod has joined ##java
[11:40:44] *** darrend has joined ##java
[11:45:52] *** lilHermit has joined ##java
[11:46:09] *** magn3ts has quit IRC
[11:50:00] *** lilHermit has quit IRC
[11:57:34] *** meatmanek has joined ##java
[11:58:06] *** pavan_ has joined ##java
[11:58:45] *** bojo_ has quit IRC
[11:59:07] *** daN-R-G has joined ##java
[12:01:31] *** ThJ has joined ##java
[12:01:45] <ThJ> In what situations would you get a NullPointerException without a stacktrace in it?
[12:01:56] *** tom17bombadil has joined ##java
[12:02:00] <ThJ> Because I am apparently getting that.
[12:02:12] <jottinger> ThJ: using callables?
[12:02:34] *** gigasoft has joined ##java
[12:03:18] *** Obeliks has quit IRC
[12:03:25] <ThJ> jottinger: hmm, not that I am aware of...
[12:03:36] <jottinger> pastebin it, then.
[12:04:07] <ThJ> if I knew where the exception happened, i would, but the possible source spans dozens of source files...
[12:05:04] <selckin> log the thread name
[12:06:34] <selckin> run in a debugger with break on all nullexceptions
[12:08:11] <ThJ> Couldn't do that since it only happens live, after running for a few hours, not under testing. But I think I found one of them that -does- have a stack trace. For some odd reason it doesn't always -give- me one...
[12:08:28] <selckin> more likely you don't log it
[12:08:58] <selckin> and log the thread names with and, and name them properly in executors etc
[12:09:04] <ThJ> Odd, since there's a blank line where the stack trace should be
[12:09:19] <ThJ> I do name threads but I'm using NIO, so...
[12:10:20] <ThJ> Odd... This exception is happening in a place where it shouldn't...
[12:10:33] *** BenMCOB has joined ##java
[12:11:24] <ThJ> connection.getSendQueue().offer(new CommandEntry(e.getKey(), new SetLayerCommand(server.getCanvas().getLayerMap().getKeyForValue(u.getLayer()))));
[12:11:31] <jottinger> heh
[12:11:44] <jottinger> chaining fail :)
[12:11:59] <ThJ> connection is always initialized there, layer is checked for null, any canvas has a layermap...
[12:12:17] <jottinger> key for value is always set?
[12:12:27] *** sbohan has joined ##java
[12:12:35] <selckin> 'e' and 'u' ?
[12:12:51] <BenMCOB> I'm a little out of practice with Java and having a brainfart moment.  Can anyone see what's wrong with this code?  Best I can tell it should work fine http://eugeneciurana.com/pastebin/pastebin.php?show=42580
[12:12:54] <ThJ> Even if it is not, SetLayerCommand's constructor doesn't care about null values.
[12:13:45] <ThJ> e = Map.Entry<Integer, Connection>
[12:13:48] <selckin> BenMCOB: the error is clearly irrelevant
[12:13:50] <ThJ> Wait... I think I see something here.
[12:14:04] <ThJ> u = e.getValue().getUser() could potentially be null
[12:14:05] <BenMCOB> selckin, how so?
[12:14:24] <ThJ> no wait
[12:14:25] <ThJ> if(u != null && u != connection.getUser()) {
[12:14:26] <selckin> BenMCOB: it's not related at all, so don't provide it in the question
[12:14:26] <ThJ> Damn it!
[12:14:37] <ThJ> I'm checking everything
[12:14:44] <jottinger> BenMCOB: what error are you getting
[12:15:01] *** bojo has joined ##java
[12:16:02] *** Crushpest has quit IRC
[12:16:40] <BenMCOB> Doesn't specify it.  It's an android application and force quits when that particular method is called during the inital setup.
[12:17:30] <BenMCOB> If I comment out that one line where it add's the Context object to the list collection, it doesn't have a problem
[12:19:53] *** Mavrik- has joined ##java
[12:20:03] <BenMCOB> wait, I think I'm seeing it
[12:20:39] <BenMCOB> It looks like Context also refers to an Interface in the Java API
[12:25:23] <BenMCOB> nope, still get the error
[12:26:10] *** smorg has quit IRC
[12:26:14] *** okae has joined ##java
[12:26:52] *** styx_ has joined ##java
[12:27:24] <jottinger> hmm, the topic shoudl probably specify android is like j2me and applet
[12:28:14] <selckin> also it will give you an error, run it in a debugger or emulator or whatever
[12:28:21] <selckin> notting every fails without telling you why
[12:28:28] <selckin> if it does, you're doing it wrong
[12:28:32] *** seisatsu has joined ##java
[12:29:15] <seisatsu> how should I go about learning java if I already know C++?
[12:29:26] <ztj> first, forget C++
[12:29:30] <d1b> ztj: lies
[12:29:41] <selckin> spend 5min learning the syntax, and done?
[12:29:42] <d1b> seisatsu: do some more ooo stuff / see  the sun java doc
[12:29:54] <selckin> the rest will come as you go
[12:29:59] <seisatsu> derp
[12:31:56] *** edi_99 has joined ##java
[12:34:08] *** rawbk has joined ##java
[12:34:23] <edi_99> Hi guys. I've got a JFrame with lot's of JComponents on it. Among them, there is JList. Every time the values in the JList are cleared, all the components of the JFrame are slightly resized, which is a bit annoying. Is there any way I can avoid that?
[12:37:15] <jottinger> seisatsu: it's pretty easy
[12:37:32] <seisatsu> yeah I know
[12:37:43] <seisatsu> the conventions and syntax are just a bit different
[12:38:07] <seisatsu> but just enough that I might need a little briefing
[12:39:05] *** Ilod has quit IRC
[12:39:39] <jottinger> nah, just flick your way through the first cup tutorial and you'll have most of it
[12:39:45] <jottinger> which version of C++ are you used to?
[12:39:52] <seisatsu> version?
[12:39:55] <seisatsu> GCC
[12:40:00] <jottinger> yes, which rev of C++
[12:40:03] <jottinger> not compiler
[12:40:07] <seisatsu> revision...
[12:40:20] <seisatsu> I guess the current one
[12:40:21] <jottinger> you do know that C++ has revisions, right? It's ANSI specified?
[12:40:24] <seisatsu> yes
[12:40:39] <jottinger> okay. If you're used to the pre-ANSI/ISO revisions, java's trivial.
[12:40:47] <seisatsu> I only started C++ several months ago
[12:41:08] <jottinger> If you're used to C++0x, it's a little more involved, because C++0x suffers from perl's keyboard-vomititis.
[12:41:21] <jottinger> So it kinda depends on how deeply you nest your templates, etc.
[12:41:23] <seisatsu> nope
[12:41:29] <seisatsu> GCC doesn't support it yet
[12:41:29] <jottinger> nope what?
[12:41:33] <seisatsu> C++0x
[12:41:49] <jottinger> ah, well, GCC supports boost, and boost was part of the keyboard vomit bit
[12:42:03] <seisatsu> I don't use boost.
[12:42:05] <seisatsu> too big.
[12:42:07] <jottinger> I *totally* dig boost, but it led to common and idiomatic C++ syntax that's horrible.
[12:42:16] <jottinger> seisatsu: heh, you'll hate java then on the same basis :)
[12:42:41] <seisatsu> yeah... but, all those libraries are packed with the standard runtime
[12:42:54] <jottinger> and boost isn't? :)
[12:43:01] <seisatsu> my issue was with packaging huge external libraries with my programs
[12:43:12] <seisatsu> well, boost doesn't come with the compiler :/
[12:43:25] <jottinger> if only there were dynamic libs supported on popular OSes.
[12:43:26] <selckin> you'll soon be including huge java libaries don't worry
[12:43:27] <jottinger> :)
[12:43:35] *** vy has quit IRC
[12:43:35] <seisatsu> yes, I know
[12:43:49] <seisatsu> 100mb of runtime
[12:44:00] <seisatsu> or is it more now?
[12:44:09] <seisatsu> I remember when java was 60mb
[12:44:10] <jottinger> the C++ STL is largely built from Boost, so you still haven't escaped it
[12:44:23] *** kezz has joined ##java
[12:44:33] <seisatsu> I did not realize this. :<
[12:44:48] <jottinger> anyway, java's syntax is WAY simpler than ISO C++
[12:44:59] <jottinger> so it shouldn't be difficult to pick up.
[12:45:15] <seisatsu> well, actually, boost probably isn't a problem, if your linker is smart enough to only grab functions you use.
[12:45:27] <jottinger> the type system is also more strict; the compiler helps a lot. (The runtime gets in the way, mind, but the COMPILER helps.)
[12:45:33] <seisatsu> yeah
[12:45:42] <seisatsu> I've heard it makes everything easy
[12:45:56] <jottinger> Java also favors composition to inheritance, since inheritance is expensive (single inheritance only)
[12:45:58] <seisatsu> I'm working with a friend to write a game engine
[12:46:07] <jottinger> oh, you're doomed then
[12:46:13] <seisatsu> and he spontaneously decided to switch from C++ to Java
[12:46:32] <seisatsu> we hadn't really done anything yet.
[12:46:50] <selckin> the main thing is probably that generics aren't templates and not types
[12:46:54] *** Willy has joined ##java
[12:47:24] <jottinger> seisatsu: what kind of game?
[12:47:43] <seisatsu> tile-based 2D engine
[12:47:49] <seisatsu> in the style of Yume Nikki
[12:48:00] <seisatsu> we're writing a client/server
[12:48:08] <jottinger> NOOOOO
[12:48:10] *** Razorigga has quit IRC
[12:48:14] <jottinger> DAMN YOU WHITE UNICORN
[12:48:16] <seisatsu> NOOOOO?
[12:48:23] <seisatsu> wait what
[12:48:24] <jottinger> (nethack.)
[12:48:28] <seisatsu> derp.
[12:48:38] <jottinger> what does "derp" mean?
[12:49:05] <seisatsu> http://img.photobucket.com/albums/v211/ninjachan/Humor/DERP-megaman.jpg
[12:49:11] <seisatsu> kinda like "doh"
[12:49:24] <SeriousWorm> [12:49:16] [jottinger]: Java also favors composition to inheritance, since inheritance is expensive (single inheritance only)
[12:49:28] <SeriousWorm> what do you mean by expensive?
[12:49:38] <jottinger> SeriousWorm: you only get one ancestor.
[12:49:47] <SeriousWorm> why is that expensive in cpu/memory terms?
[12:49:52] <jottinger> It isn't.
[12:50:04] <SeriousWorm> then your definition of "expensive" is different that mine. :)
[12:50:16] <jottinger> sure. Mine refers to scarcity of resources.
[12:50:21] <SeriousWorm> ok.
[12:50:24] <SeriousWorm> then your definition of "resource" is different that mine. :)
[12:50:33] <jottinger> So "it takes a lot of CPU" is "expensive" and "you only get one ancestor" is "expensive."
[12:51:12] <jottinger> SeriousWorm: I don't see any reason to add unnecessary and unimplied restrictions to the definition.
[12:51:27] <jottinger> "That watch is EXPENSIVE!" "No, it's not. It takes 0% of my cpu and RAM."
[12:53:25] <jottinger> OTOH, if you use 'expensive' in the 'uses more of a scarce resource' then the statement makes sense.
[12:53:35] <SeriousWorm> money is a resource :/
[12:53:50] <jottinger> object ancestry is expensive because you get ONE ancestor, compared to N interfaces.
[12:53:57] <jottinger> One would think it was, yes.
[12:54:28] *** adaro has joined ##java
[12:56:16] *** BeholdMyGlory has joined ##java
[12:57:38] *** vmhobbes has joined ##java
[12:59:09] *** Razorigga has joined ##java
[13:03:43] *** Imaginativeone has joined ##java
[13:04:14] *** Bartron has quit IRC
[13:05:54] *** Submarine has joined ##java
[13:13:45] *** tom17bombadil has quit IRC
[13:14:07] *** psst has joined ##java
[13:15:59] *** _kmh_ has joined ##java
[13:16:29] *** hrehf has joined ##java
[13:16:52] *** Bartron has joined ##java
[13:17:54] *** tom17bombadil has joined ##java
[13:18:08] *** Theravadan has quit IRC
[13:23:07] *** yolkaplexus has joined ##java
[13:27:02] *** vy has joined ##java
[13:28:03] *** Bartron has quit IRC
[13:30:44] *** Iszak has joined ##java
[13:31:38] *** LouisJB has quit IRC
[13:32:41] *** jtheuer has joined ##java
[13:36:11] *** Iszak has quit IRC
[13:36:39] *** Iszak has joined ##java
[13:37:40] *** s_n has joined ##java
[13:37:42] <s_n> hi
[13:39:28] *** Nurbs has quit IRC
[13:39:45] *** bindaas has joined ##java
[13:41:32] *** Bartron has joined ##java
[13:42:00] *** jmarsman has joined ##java
[13:42:05] *** adaro has quit IRC
[13:43:03] <s_n> after reading the topic i assume it's not the right place to ask about jnlp?;>
[13:43:12] <ztj> that's fine
[13:43:17] <ztj> as long as it's for JWS :)
[13:43:45] *** luneff has quit IRC
[13:45:39] *** okae has quit IRC
[13:48:40] <s_n> there is a jnlp file (xml), which has some <jar href="">s definitions. i want to download these jars, which are on the remote server. if i want to access them directly via browser or curl i get information that the GET method is not supported. maybe java can download these jars to the local hard disk and cache them? or maybe there is another way?
[13:49:17] <ernimril> s_n: you are most probably just using the wrong url
[13:49:29] *** Nurbs has joined ##java
[13:50:14] <ernimril> s_n: normal webstart uses a standard URLClassLoader to get the jars and that means normal GET on a http and/or https resource
[13:50:35] <s_n> hm
[13:51:14] *** Rayne has joined ##java
[13:51:30] <ernimril> s_n: you can of course always use wireshark or a similar network sniffer to see what really happen on the wire
[13:51:37] *** Peej has joined ##java
[13:51:59] <s_n> that's a good idea.
[13:52:01] <s_n> http://pastebin.com/JLbYjeTV
[13:52:14] <s_n> this is part of the jnlp file content
[13:53:01] <s_n> i tried to access https://foo.tld/path/application/client/foo.jar but without success.
[13:53:27] <s_n> anyway, sniffer is a good point to start
[13:53:44] <ernimril> s_n: well, start wireshark tell it to record the network traffic to that host, start the program and see the traffic
[13:53:50] <s_n> however, it's https so i'm not sure if i'll be able to see the requests
[13:54:08] <ernimril> s_n: ok, then you will not
[13:55:15] <s_n> maybe some ssl proxy will do the work however i must google for such solution. that why i was wondering if there is any other way to do it.
[13:55:51] <ernimril> s_n: you are doing it correctly, but you may have messed the url up in some way, hard to say
[13:57:38] <s_n> ok, got it!
[13:57:54] <s_n> should omit the "application" part and it works:)
[13:57:58] <s_n> thanks ernimril :-)
[13:58:30] *** jtheuer has quit IRC
[13:58:56] *** Rayne has left ##java
[13:59:12] *** sbohan has quit IRC
[13:59:15] *** Soliah has quit IRC
[13:59:30] <rawtaz> s_n: did you mean the successful url was https://foo.tld/path/client/foo.jar?
[14:01:48] <s_n> yup
[14:05:35] *** Ilod has joined ##java
[14:11:00] *** andy^ has joined ##java
[14:14:40] <rawtaz> oki :)
[14:15:45] *** BeholdMyGlory has quit IRC
[14:22:51] *** yolkaplexus has quit IRC
[14:22:57] *** randoms has joined ##java
[14:24:24] <randoms> hey guys. if i want to check if an Object is of class Address, how should i do that? i thought about if (obj.getClass() == new Address().getClass()). whould that be the "right" way to do it. or is there some other way to specify Address without creating a new object?
[14:24:53] *** _kmh_ has quit IRC
[14:25:01] <selckin> ~instanceof
[14:25:01] <javabot> selckin, instanceof is a way for checking if a given object is of a certain type. See http://mindprod.com/jgloss/instanceof.html for examples.
[14:25:04] *** styx_ has quit IRC
[14:25:45] *** Ilod has left ##java
[14:25:52] <randoms> ah sweet, thnx.
[14:25:58] *** BenMCOB has left ##java
[14:28:13] *** randoms has quit IRC
[14:29:11] *** rajesh has joined ##java
[14:31:37] *** jmarsman has left ##java
[14:32:24] *** Kedare has joined ##java
[14:32:32] *** mvfranz has joined ##java
[14:32:37] *** pavan_ has quit IRC
[14:33:59] *** sbohan has joined ##java
[14:34:07] *** sbohan has left ##java
[14:35:26] *** bulletxt has left ##java
[14:44:56] *** MrGerjo has joined ##java
[14:45:08] *** RLa has joined ##java
[14:46:38] *** assertsmart has joined ##java
[14:49:27] *** geri has quit IRC
[14:51:48] *** Gravitron has joined ##java
[14:53:00] *** yogione has joined ##java
[14:54:33] *** kezz has quit IRC
[14:54:51] *** s_n has left ##java
[14:55:16] *** BfrOv3rfl0w has joined ##java
[15:00:32] <RLa> wow, reflection defeats language access controls?
[15:00:48] *** keks_ has joined ##java
[15:01:13] <RLa> i always though that you can only access methods and fields that are accessible through normal ways
[15:01:20] *** Micketh has joined ##java
[15:01:26] <selckin> nope, you can do anything you want
[15:01:42] <RLa> uh oh
[15:01:51] <selckin> kinda what makes it usefull too
[15:01:53] <ernimril> RLa: unless there is a security manager installed
[15:02:06] <ernimril> RLa: access control is mostly there to help the programmer
[15:02:28] <ernimril> RLa: you are supposed to use this method, it is public, you are not supposed to touch this method, it is private
[15:04:06] <paulweb515> RLa: to make reflection useful, they had to allow it (SecurityManager permitting) free reign
[15:04:12] <RLa> but why reflection breaks it?
[15:04:21] <RLa> oh
[15:04:38] *** andy^ has quit IRC
[15:05:53] <paulweb515> RLa: say you're implementing injection via reflection.  The consumer wants to write: "@Inject @Named("id") private String id;"  The injection framework implementers can do this now, they just need to override the access
[15:06:38] <RLa> paulweb515, another (correct) solution would be to use public setter for injection?
[15:07:24] <RLa> anyway
[15:07:36] <RLa> i have security manager not permitting reflection
[15:07:58] <RLa> now, i want to find out why i get reflection error
[15:07:59] <paulweb515> RLa: if that was your only option, yes.  but then the injection framework is placing visibility requirements on the consumer ... they might not want users of their code to be able to set that value, and use private void setId(*) etc
[15:08:10] *** Fleugma has joined ##java
[15:08:49] <RLa> will i get security exception when i try to use reflection for accessing *public* method?
[15:08:59] <paulweb515> RLa: you're security manager doesn't permit it?  Or you're getting an access error?
[15:09:15] <RLa> or will i get security exception when i try to use *any* reflection at all?
[15:09:32] *** rjohnson19 has joined ##java
[15:09:33] <RLa> no, it's permission error
[15:09:55] <selckin> fairly sure you can configure it both ways
[15:10:08] <ernimril> RLa: you should be able to use public methods with reflections without problems
[15:10:23] <RLa> ernimril, that's what i wanted to know
[15:10:27] <paulweb515> RLa: the docs say that security can be configured to prevent *any* reflection or simply prevent access level  changes (i.e. accessing private)
[15:10:31] <ernimril> RLa: for private ones you need to call setAccessible(true) first and that might cause a security exception
[15:10:48] <RLa> paulweb515, got a link for that?
[15:11:08] <RLa> no, i have no intentions to access private fields
[15:11:15] <RLa> or methods
[15:11:37] *** styx_ has joined ##java
[15:12:24] *** Ivellina has quit IRC
[15:12:35] *** cutout has joined ##java
[15:12:51] <paulweb515> RLa: http://java.sun.com/j2se/1.4.2/docs/guide/reflection/spec/java-reflection.doc.html
[15:12:58] <paulweb515> security model
[15:14:10] <RLa> paulweb515, thanks
[15:15:02] <cutout> Hi, I want to make a scheduling mechanism for my web applications to run reporting jobs! this needs to be long term jobs and re auccre
[15:15:52] <cutout> is there APIs to do that?
[15:16:03] <ernimril> ~quartz
[15:16:03] <javabot> An open source job scheduling system, jobs can be defined as standard Java components or EJBs.  You find more at http://www.opensymphony.com/quartz/ also see http://is.gd/nHz9 for a core java solution.
[15:16:43] *** markcl has quit IRC
[15:17:12] <cutout> thanks I'll check it :)
[15:17:20] *** cutout has left ##java
[15:17:52] *** styx_ has quit IRC
[15:18:06] *** mrenouf has joined ##java
[15:18:21] <jottinger> ernimril: if he's using java ee, ejb timer beans are better
[15:19:03] *** Johannes13 has joined ##java
[15:19:07] <ernimril> jottinger: if you say so, I do not really do jee
[15:19:25] *** styx_ has joined ##java
[15:19:26] <ernimril> jottinger: (a few servlets now and then, but that is about it)
[15:19:29] <RLa> there is no source of sun.* packages in jre available?
[15:19:47] <RLa> is that closed source part of java?
[15:20:01] <paulweb515> RLa: maybe in the SDK?  Yes, those are internal implementation classes
[15:20:30] <ernimril> RLa: try the openjdk sources
[15:20:38] <ernimril> RLa: they are not in src.zip
[15:20:56] <RLa> crap, ReflectionManager happens to be in this package
[15:21:05] *** mnabil_work has joined ##java
[15:21:23] *** TMinus36 has quit IRC
[15:21:46] <RLa> of course, security stuff must be hidden from eyes
[15:23:25] *** hexmare has joined ##java
[15:23:43] <hexmare> morning all
[15:23:59] *** hexmare is now known as Hexmare
[15:24:28] <ThJ> I'm wondering what's best... do your own audio mixing, or try to get multiple SourceDataLines...
[15:24:51] <Hexmare> ThJ , I would reccomend doing your own
[15:25:31] <Hexmare> multiple sources = more resources.
[15:25:58] <Hexmare> plues the headache of making sure everything is in sync
[15:26:10] <ThJ> True...
[15:26:48] *** gelignite has joined ##java
[15:27:13] <Hexmare> not to mention with the good freeware sound mixing and mastering software out there , diy programmers at home can do audio work relatively easy now
[15:27:15] <ThJ> I'll have to make some sort of wrapper for it that sees when blocks come in and outputs them when all blocks are present for mixing, I guess.
[15:27:29] <ThJ> This is for voice conferencing
[15:27:34] <ThJ> I'm using JSpeex and UDP.
[15:27:44] <Hexmare> oh thats a whole other story
[15:28:04] <Hexmare> I thought you were talking about a static sound library
[15:28:16] <ThJ> Nope, did I say that? ;)
[15:28:48] <Hexmare> < Assumed like an idiot ... first thing I saw in the channel was < ThJ> I'm wondering what's best... do your own audio mixing, or try to get multiple
[15:28:51] <Hexmare>              SourceDataLines...
[15:29:01] <ThJ> Hehe
[15:29:04] <ThJ> Easy to do
[15:29:20] <ThJ> I've got it working at the stage where a test tone from the server ,even with high jitter and packet loss, plays back pretty smooth.
[15:29:35] <Hexmare> ok I will shutup now , before I remove all doubt of my dumbassedness ;)
[15:29:40] <ThJ> And packets may arrive out of order as long as the server hasn't stopped waiting for them (the audio  buffer must be kept full after all)
[15:30:15] <ThJ> Quite an elaborate scheme. You'd think you could use TCP, but it can't do "drop a packet in the middle if we've got the other packets and playback's getting urgent."
[15:30:40] <Hexmare> true
[15:31:31] *** preflex has quit IRC
[15:31:37] <Hexmare> although it can be done
[15:31:55] <Hexmare> TeamSpeak operates on TCP ,
[15:32:00] <Hexmare> and it uses speex
[15:32:14] <ThJ> I guess they simply accept the delay.
[15:32:45] *** [Justice] has joined ##java
[15:32:46] <Hexmare> Its been a while since I used it
[15:32:59] <Hexmare> My Gaming team uses it
[15:33:11] * Hexmare doesn't game much any more
[15:33:21] <ThJ> Which is nice, never drop a packet, but my programmers will not be used by gamers who have deliberately chosen ISPs with low ping times.
[15:33:27] <ThJ> Uhm
[15:33:30] <Hexmare> LOL
[15:33:31] <ThJ> My PROGRAM will not be used.
[15:34:28] <Hexmare> I see your point , however a lot of the teams members were on 56k dialup ....
[15:34:38] <ThJ> It'll be used by some random 15 year old who likes to draw on their computer, and it's some god-awful DSL line on old copper...
[15:34:53] *** preflex has joined ##java
[15:34:54] <Hexmare> still faster then 56k
[15:35:03] *** Obeliks has joined ##java
[15:35:05] <ThJ> True, true.
[15:35:42] <Hexmare> are you scratch building this , or are you looking at open source solutions for ideas?
[15:35:44] <ThJ> I'd still take scratchy audio over long delays, hehe
[15:35:55] <ThJ> The voice chat, or the whole thing?
[15:36:01] <Hexmare> voice chat
[15:36:06] <ThJ> This is a feature of a program basically.
[15:36:11] <ThJ> And it's a closed source program, so...
[15:36:33] <Hexmare> ok so your program is closed source
[15:36:41] <ThJ> Well, the system I've got now could be adapted to internal mixing, not a biggie.
[15:36:54] <Hexmare> doesnt mean that you can't get ideas from open source systems
[15:37:01] <ThJ> True, I misread what you said.
[15:37:21] <ThJ> However, I'm no good at reading other people's source code XD
[15:37:28] <Hexmare> LOL
[15:37:31] <Hexmare> I feel you there
[15:37:48] <Hexmare> so many times I look at things and am like WTF were they thinking
[15:37:54] <ThJ> "What the... why...oh...no wait, what's...GAH, 9 files to reach this tiny function?"
[15:38:02] <Hexmare> yup
[15:38:25] <ThJ> "And it wasn't the function I was even looking for, where exactly is the *action* in this program, all I see is formalities?"
[15:38:26] <Hexmare> the company I work for is going through that with their OWN code right now
[15:38:50] <ThJ> I had that experience reading GIMPs source code trying to figure out where on earth it renders brushes...
[15:38:54] <ThJ> Never found it, so I gave up
[15:39:09] <Hexmare> well have you ever used doxygen?
[15:39:18] <ThJ> Nope
[15:39:27] <Hexmare> its pretty slick
[15:39:52] <Hexmare> you feed it the source of a program , and it will map all functions , classes , source etc
[15:40:04] <Hexmare> output to RTF , PDF , HTML , XML
[15:40:04] <ThJ> Ah
[15:40:25] <Hexmare> maps the whole shooting match. If there is documenting comments in the code it will extract them too
[15:40:35] <Hexmare> and it WILL do huge projects
[15:40:47] <RLa> what if there are no comments
[15:41:12] <ThJ> Hehe
[15:41:18] <ThJ> I have to write comments.
[15:41:28] <Hexmare> RLA , then it will simply list the classes, members , function calls and who inherits / calls thems
[15:41:28] <ThJ> I know that if I don't, then I'll be like "Huh?" if I get back to the code later.
[15:41:44] <Hexmare> Comments = maintainable code
[15:41:47] <ThJ> Or, well, the mental effort will be greater.
[15:42:07] <Hexmare> let me rephrase ... GOOD COMMENTS = maintainable code
[15:42:13] <ThJ> I comment every line in some places just because it's not obvious what it does at first glance.
[15:42:23] <CheerBear> :(
[15:42:49] <Hexmare> I like the quote , Comment your code like the person who will maintain it is a homicidal maniac..... who has your home address
[15:43:10] <ThJ> http://pastebin.com/V1XCdgB8 - how's this?
[15:43:34] *** Determinist has quit IRC
[15:43:34] *** kekeke has joined ##java
[15:43:53] *** Imaginativeone has quit IRC
[15:44:05] <Hexmare> LOL
[15:44:21] <ThJ> It's funny? XD
[15:44:40] <Hexmare> no just laughing cause I see what you were saying
[15:44:47] *** frangiz has joined ##java
[15:44:58] <Hexmare> you follow the same rules I do , when in doubt comment
[15:45:27] <ThJ> If a somewhat slow person, like me for instance, can't understand it, comment, yes.
[15:45:27] <ThJ> XD
[15:45:44] *** eci has joined ##java
[15:47:00] *** Chinorro has quit IRC
[15:49:03] *** Junior has quit IRC
[15:49:09] <ThJ> Hexmare: What I think I'll do to that code to support mixing is simply to make a wrapper around a single SourceDataLine that can receive multiple audio streams.
[15:49:54] <ThJ> Hexmare: It'll still have stuff like .available() and .write() but will behave differently, and write() would accept an additional parameter, something like streamId.
[15:50:23] *** Fuco has joined ##java
[15:50:35] *** srm has joined ##java
[15:50:41] *** Tniffoc has joined ##java
[15:50:52] *** fornix has joined ##java
[15:51:13] <ThJ> Might also have to rename the class, VoiceClient will have one instance per incoming stream, after all
[15:51:41] <ThJ> It solves another problem too: gain control.
[15:52:14] <ThJ> If the final mix is gonna clip I'll limit it.
[15:52:26] <Tniffoc> Is there a way to get a procedure pointer in Java? Basically can I have a pointer that points to a method so that I can call arrayList.get(object).pointer()
[15:52:48] <ThJ> No, but you can do a Runnable()
[15:53:00] <ThJ> Usually in Java you wrap single methods in an object to get a "procedure pointer"
[15:53:43] *** fornix has quit IRC
[15:53:50] <ThJ> SomeAbstractClassOrInterface foo = new SomeAbstractClassOrInterface() { methods go here };
[15:53:54] <ThJ> Then you pass that along.
[15:54:46] <Tniffoc> Well I could also do it by a String then use reflection.'
[15:54:50] <Tniffoc> I think I"ll do that.
[15:55:10] <ThJ> If you're doing a callback, you can either do that, or simply implement an interface...
[15:55:21] <ThJ> Reflection? Well, ugh, I suppose.
[15:55:29] <ThJ> Hope you're not doing something that requires speed.
[15:55:42] <jottinger> you can make reflection fast.
[15:55:59] *** fornix has joined ##java
[15:57:26] *** Bartron has quit IRC
[16:00:09] *** AMcBain has joined ##java
[16:05:38] *** Hexmare has quit IRC
[16:08:49] *** dob1 has joined ##java
[16:09:49] *** ZwEnN has joined ##java
[16:09:50] *** Bartron has joined ##java
[16:10:06] *** Nurbs has quit IRC
[16:10:16] *** EnginAy has joined ##java
[16:11:33] *** lilalinux is now known as lilalinux_away
[16:12:56] *** ZwEnN has quit IRC
[16:17:47] *** skbohra_ has quit IRC
[16:18:00] *** emehrkay has joined ##java
[16:18:14] *** skbohra_ has joined ##java
[16:20:08] *** Nurbs has joined ##java
[16:20:25] *** fornix has quit IRC
[16:23:54] *** emehrkay has quit IRC
[16:29:49] *** jtheuer has joined ##java
[16:29:53] *** ThJ has quit IRC
[16:30:46] *** t0rc has joined ##java
[16:31:23] *** r1nu- has joined ##java
[16:33:09] *** Matic`Makovec has quit IRC
[16:34:15] *** nikhil_ has quit IRC
[16:37:33] *** sheepz has joined ##java
[16:37:48] <sheepz> ~pastebin
[16:37:48] <javabot> http://rifers.org/paste - Paste the final url after you've pasted your stuff there.
[16:39:53] *** Bombstone has joined ##java
[16:41:22] <sheepz> http://rifers.org/paste/show/542 i'm reading from a file line by line, why does this piece of code include empty or "null" lines?
[16:41:47] *** JumperDump has quit IRC
[16:42:21] <ernimril> ~~sheepz javadoc BufferedReader.readLine(*)
[16:42:22] <javabot> sheepz: http://is.gd/4MtOA [JDK: java.io.BufferedReader.readLine()]
[16:42:37] <ernimril> sheepz: the file does not contain null lines
[16:43:07] *** mreggen has quit IRC
[16:43:49] *** Ivellina has joined ##java
[16:44:50] *** bn` has joined ##java
[16:45:09] <sheepz> ok, but shouldn't the while loop terminate if it encounters EOF?
[16:45:18] *** SEcki has joined ##java
[16:45:55] <dmlloyd> it does
[16:46:05] <dmlloyd> the question is, what is the line "rows[counter];" supposed to do?
[16:46:09] <dmlloyd> I'm not even sure that compiles
[16:46:11] <ernimril> sheepz: what do you think the null indicates?
[16:46:24] <sheepz> well. i'm trying to save the lines in array of strings
[16:46:32] <dmlloyd> you forgot about the "save" part
[16:46:42] <ernimril> sheepz: _read_ the javadocs javabot gave you, what is the return type of the readLine method?
[16:46:58] <sheepz> a string
[16:47:00] <sheepz> :P
[16:47:10] *** the_birdman has joined ##java
[16:47:21] *** rajesh has quit IRC
[16:47:27] <dmlloyd> you actually have to put the string into your array
[16:48:25] <sheepz> well, I'm not really familiar with Java and quick googling didn't get me an append function
[16:48:27] *** EnginAy has quit IRC
[16:48:45] <dmlloyd> ~~ sheepz arrays
[16:48:45] <javabot> sheepz, arrays is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
[16:49:12] <dmlloyd> arrays are fixed size, and don't contain anything unless you put things in them
[16:49:55] <sheepz> I did this... String[] rows = {};		     rows = new String[30];
[16:50:35] <dmlloyd> the first statement creates an array of length zero and then puts it into rows
[16:50:52] <dmlloyd> the second statement creates an array of length 30 and then replaces the value of rows with a reference to the new array
[16:51:00] <dmlloyd> so the first "= {}" is redundant
[16:51:10] <dmlloyd> so that's an array of 30 nulls
[16:51:22] <sheepz> oh...
[16:51:39] *** luneff has joined ##java
[16:51:54] <kekeke> hi i'm using multiple JRadioButtonMenuItem(string, boolean) as part of a ButtonGroup and i want to have a set of if statements which depend on which button is selected, how would i do this?
[16:51:59] <dmlloyd> the next step is to replace the null values with something useful
[16:52:00] *** notk0 has joined ##java
[16:52:08] <sheepz> ok, but would this approach even be appropriate?
[16:52:33] <sheepz> i mean I'm just trying to read line by line and later use string functions on the lines...
[16:52:43] <dmlloyd> it might make more sense to use a List
[16:52:47] <dmlloyd> ~~ sheepz collections
[16:52:47] <javabot> sheepz, The Collections API is available at http://java.sun.com/javase/6/docs/technotes/guides/collections/index.html
[16:52:59] <dmlloyd> because those can grow as items are added.
[16:53:10] *** EricInBNE has quit IRC
[16:53:22] <sheepz> ok, thanks for your help :)
[16:53:33] <dmlloyd> no charge
[16:53:37] *** sly007 has joined ##java
[16:54:02] <sly007> Hello, I am in a Thread run() method. How do I call back a method on the main Thread?
[16:54:26] <dmlloyd> methods don't exist on threads
[16:54:29] <dmlloyd> they exist on classes
[16:54:58] <dmlloyd> if you want the main thread to do something, the main thread has to be waiting for things to do
[16:55:54] <dmlloyd> ~~ sly007 jcip
[16:55:54] <javabot> sly007, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java.  http://jcip.net/
[16:55:56] *** metaphys has joined ##java
[16:56:04] <dmlloyd> and with that, I'm outta here for now
[16:56:08] <sly007> dmlloyd: When my code in run is finished, I want the method of some class to be called in the main thread
[16:56:30] <mrenouf> sly007, is your main thread essentially idle?
[16:56:48] <mrenouf> ie: do you do anything after Thread.start()?
[16:56:58] <sly007> mrenouf: i do something
[16:58:02] <mrenouf> absolute simplest way, in java6+ you can use a volatile boolean to signal the work is done.
[16:58:04] *** Blarumyrran has joined ##java
[16:58:07] <kekeke> i'm using multiple JRadioButtonMenuItem(string, boolean) as part of a ButtonGroup and i want to have a set of if statements which depend on which button is selected, how would i do this?
[16:58:26] <ernimril> ~~kekeke repeat
[16:58:26] <javabot> kekeke, Please don't repeat yourself, it annoys people and rarely produces results. Try rephrasing or, failing that, come back in a good while when there are different people here. Meanwhile, google is your friend.
[16:58:28] <mrenouf> sly007, your main thread would check this variable (lets say "isFinished")
[16:58:31] <SEcki> mrenouf: but then you need to check it regularialy, of course
[16:58:37] <ernimril> ~~kekeke if
[16:58:37] <javabot> kekeke, to learn about the if statement, see http://java.sun.com/docs/books/tutorial/java/nutsandbolts/if.html
[16:58:39] *** Blarumyrran has left ##java
[16:58:52] <kekeke> ernimril: thanks, but i wasn't asking how to form if statements
[16:59:23] *** Fleugma has quit IRC
[16:59:34] <mrenouf> SEcki, that's why i asked if the main thread is idle. if it does other useful work, the check is ok. otherwise you want to wait() on a lock (or better yet use use conditions from j.u.c)
[17:00:25] <ernimril> kekeke: then consider rewriting your question so that it is clear what you want
[17:00:45] <mrenouf> sly007, see: http://www.ibm.com/developerworks/java/library/j-jtp06197.html#2.0
[17:00:57] <SEcki> mrenouf: we are in full agreement I guess, I should have directed it at sly007, sorry (also be aware of things that block the main thread for a while, sly007, so oyu can have arbitary time gaps before the main thread does something)
[17:03:15] <kekeke> ernimril: thanks for the advice, but i think it was clear enough (obviously not for all, though)
[17:04:12] <ernimril> kekeke: how much help did you get? how clear was your question, really?
[17:04:15] *** broyles has joined ##java
[17:04:38] *** werdan7 has quit IRC
[17:04:49] *** broyles has quit IRC
[17:05:48] <kekeke> ernimril: not getting help is not equivalent to clear wording, thanks for the advice, again
[17:06:25] *** keks_ has quit IRC
[17:07:15] *** Angel-SL has quit IRC
[17:07:37] *** keks_ has joined ##java
[17:08:26] *** enav has joined ##java
[17:09:10] *** BSWolf has quit IRC
[17:09:21] *** psst has quit IRC
[17:11:44] *** BSWolf has joined ##java
[17:12:42] <enav> good morning vietnam
[17:12:43] *** werdan7 has joined ##java
[17:13:04] *** megaTherion has quit IRC
[17:13:07] <the_birdman> kekeke: register the radiobutton items to the same itemlistener, if event.getsource == buttonA => dosomething
[17:13:42] <kekeke> the_birdman: thanks so much
[17:15:53] *** sly007 has quit IRC
[17:18:52] *** Sergio` has quit IRC
[17:19:14] <dob1> in this code http://pastebin.com/Pa8xGbxV , i have the SwingWorker class that set the dialog to not visible in the done() method, but the worker is executed before i set the dialog visible (i have to do that or the worker doesn't start), can happen that it terminates before the dialog is visible?  i think is impossible
[17:19:51] <Copter> jottinger: hire meh !
[17:20:03] <enav> i cant fully understand something here.... RMI-IIOP   is to remote method invocation of another OO Langs?
[17:20:23] <enav> others*
[17:20:48] <the_birdman> dob1: set the dialog visible before work.execute()??
[17:20:53] <mrenouf> I could be wrong but I'm pretty sure RMI is intended for Java->Java only
[17:20:54] *** johnny_boy has quit IRC
[17:21:03] <dob1> the_birdman: the worker doesn't start, is a modal dialog
[17:21:25] *** KingOfKarlsruhe has joined ##java
[17:21:33] <enav> RMI is java only  but RMI-IIOP  looks to be fr other Java equivalents
[17:21:41] <enav> i mean OO langs
[17:22:10] *** Sergio` has joined ##java
[17:22:22] <paulweb515> enav: isn't RMI_IIOP the rmi over (something CORBA)?
[17:22:45] <enav> yes
[17:22:47] <paulweb515> enav: http://en.wikipedia.org/wiki/RMI-IIOP
[17:23:02] <enav> i came from that site
[17:23:13] <enav>  thanks anyway
[17:23:17] *** MichielH has joined ##java
[17:23:46] <paulweb515> enav: it's a java link into CORBA (with some caveats)
[17:24:29] *** blue_feint has joined ##java
[17:24:31] *** Sergio`_ has joined ##java
[17:24:31] *** Sergio` has quit IRC
[17:24:39] *** the_birdman has left ##java
[17:24:48] *** blue_feint has left ##java
[17:25:38] *** LadySerena has joined ##java
[17:25:49] *** bojo has quit IRC
[17:28:21] *** tozi has joined ##java
[17:28:28] *** lolsuper_ has quit IRC
[17:28:29] *** tozi has left ##java
[17:28:45] <LadySerena> I have but one quick question: In my base class I have "protected ServiceBase() { this.init(); }" and I was wondering if another class (which extends ServiceBase) will use that as its constructor, or do I need to write a new protected constructor with the same this.init(); in it?
[17:28:50] *** lolsuper_ has joined ##java
[17:29:17] *** Deeewayne has quit IRC
[17:31:54] *** bojo has joined ##java
[17:32:08] <ernimril> LadySerena: if you do not explicitly call a constructor a call to the super() constructor will be added automatically
[17:32:28] <ernimril> LadySerena: do you provide any other constructors to Base?
[17:32:47] <LadySerena> no, I don't, its just that one constructor
[17:33:09] <ernimril> LadySerena: then the subclasses have to use that constructor
[17:33:18] <LadySerena> awesome!
[17:33:20] *** Determinist has joined ##java
[17:33:27] * LadySerena hugs ernimril
[17:33:58] <ernimril> LadySerena: do you plan on overriding init() in subclasses? (it is a bad idea to do so)
[17:34:14] <LadySerena> no, not with my app
[17:35:10] *** assertsmart has quit IRC
[17:35:43] <LadySerena> I have two base classes - one for modules (ModuleBase) and one for services (ServiceBase), both get their init() from another class called BaseConfigurator which does all the reflection magic in loading and setting configuration settings
[17:36:12] <LadySerena> very bad idea to override init() in my app's classes
[17:36:50] *** Cymage has joined ##java
[17:36:51] *** deSilva has quit IRC
[17:37:02] *** dawciobiel has joined ##java
[17:37:47] *** RdeWilde has joined ##java
[17:40:21] *** tom17bombadil has quit IRC
[17:43:16] *** sheepz has quit IRC
[17:44:00] <jottinger> Copter: ?
[17:44:02] *** metaphys has quit IRC
[17:44:21] *** _kmh_ has joined ##java
[17:44:29] *** genesiss has quit IRC
[17:44:50] *** bojo has quit IRC
[17:44:59] *** Chinorro has joined ##java
[17:46:17] *** exbio has joined ##java
[17:47:25] *** dawciobiel has quit IRC
[17:50:02] *** yshavit has joined ##java
[17:50:51] * jottinger hands LadySerena @PostConstruct
[17:51:14] <LadySerena> hmm, is this a tasty new annotation?
[17:51:18] <jottinger> no.
[17:51:27] <LadySerena> is it chocolate?
[17:51:31] <jottinger> nope.
[17:51:37] <LadySerena> is it catnip?
[17:51:43] *** bojo has joined ##java
[17:52:15] * LadySerena googles
[17:52:37] <jottinger> LadySerena: are you using spring or anything like it?
[17:52:45] <LadySerena> no, I'm not
[17:53:11] *** chaz has joined ##java
[17:53:15] <jottinger> so you're using new()?
[17:53:15] *** trsh has joined ##java
[17:53:21] <jottinger> i.e., the constructor?
[17:53:25] <LadySerena> well, kinda
[17:53:36] <jottinger> hmm, thought that was a yes/no question
[17:53:48] <LadySerena> all the services and modules in my app are single-instance classes
[17:54:09] <jottinger> standalone app, I guess
[17:54:19] <LadySerena> like for the Session service: Session s = Session.getInstance();
[17:54:49] <yshavit> "singleton" is the lingo
[17:54:53] <LadySerena> ohs
[17:54:54] *** dawciobiel has joined ##java
[17:55:04] <LadySerena> in PHP they're just called "global classes"
[17:55:13] <dmlloyd> ~php
[17:55:13] <jottinger> so this is a standalone app?
[17:55:14] <javabot> dmlloyd, php is the solution of choice for relaying mysql errors to web users.
[17:55:25] <LadySerena> LAWL!
[17:55:34] <LadySerena> no, its a webapp
[17:55:46] <jottinger> then why the hell are you pretending to use singletons?
[17:55:49] <jottinger> they're not, you know
[17:56:07] <jottinger> what container are you using?
[17:56:11] <LadySerena> GlassFish
[17:56:18] <jottinger> yeesh, then use EJBs
[17:56:29] *** Sergio`_ has quit IRC
[17:56:55] *** Sergio` has joined ##java
[17:57:06] *** SEcki_ has joined ##java
[17:57:39] <LadySerena> I'm not familiar with EJBs and I'm afraid if I try that tech I'll break something really badly
[17:57:55] <LadySerena> which is almost always the case when I try new toys
[17:58:32] <yshavit> LadySerena: depending on how much time you have, breaking something really badly is often a great way to learn how to use it
[17:58:38] <yshavit> Sounds very zen, right?
[17:58:43] <LadySerena> ya
[17:59:34] *** KingOfKarlsruhe has quit IRC
[18:00:52] *** SEcki has quit IRC
[18:01:06] *** styx_ has quit IRC
[18:01:32] <LadySerena> okay, so what advantages do EJBs offer over the standard webapp?
[18:01:49] <jottinger> you know that stupid Service service=Service.getInstance() thing you're doing?
[18:01:57] <LadySerena> ya
[18:02:10] <jottinger> it goes away.
[18:02:34] <LadySerena> o.o
[18:02:59] <yshavit> jottinger: are EJBs better than Swing, in your experience? I've never worked with EJB and hardly with Spring, so I'm not trying to pick a fight, just asking. :)
[18:03:08] *** Rednaxela has joined ##java
[18:03:13] <jottinger> yshavit: well, I often DO find that oranges are better than rubber tires.
[18:03:13] <yshavit> s/Swing/Spring/;
[18:03:31] *** Alice has joined ##java
[18:03:39] <jottinger> yshavit: and it really depends.
[18:04:05] *** SEcki_ is now known as SEcki
[18:04:08] <Rednaxela> Hmm, quick question: I know one can determine java_home from inside java (via system properties), but is there any way to find the full path to the jvm executable? (i.e. whether it's java, or java.exe, or javaw
[18:04:12] <yshavit> jottinger: oranges/tires was for Swing, right?
[18:04:17] <jottinger> yes
[18:04:20] <yshavit> :)
[18:06:32] <AMcBain> Well, the greenhouse here on campus has an orange tree with some exquisit sour oranges.
[18:06:50] <AMcBain> They're quite nice, but it's funny to give somone a piece of one and watch the face they make :)
[18:07:13] <ernimril> AMcBain: why do they make a face for a sour orange?
[18:07:26] <AMcBain> for? no ... after eating a piece! ;)
[18:07:41] <AMcBain> Normal oranges aren't sour, so they don't expect it :)
[18:07:55] * pr3d4k4t trolls jottinger.
[18:08:21] <ernimril> AMcBain: I would find it a tasty surprise, but then I really like lemons :-)
[18:08:28] <AMcBain> ernimril, haha
[18:08:33] <pr3d4k4t> jottinger: array('l'); if I want a shorter initialization time then I use the generator you saw.  It's still a lot smaller than the Java code, now using arrays.
[18:08:55] *** e1n85 has quit IRC
[18:09:05] *** skbohra_ has quit IRC
[18:10:02] *** daN-R-G has quit IRC
[18:10:02] *** skbohra_ has joined ##java
[18:11:19] *** prc33 has joined ##java
[18:11:34] *** prc33 has left ##java
[18:12:21] *** bitterman has joined ##java
[18:12:56] *** dawciobiel has quit IRC
[18:13:27] *** luneff has quit IRC
[18:14:01] *** Alice has quit IRC
[18:16:40] *** Determinist has quit IRC
[18:21:25] *** vncntd has joined ##java
[18:22:33] *** rburton- has joined ##java
[18:24:27] *** tombee has joined ##java
[18:24:42] *** bearded_oneder has joined ##java
[18:26:05] *** Zaidwi has joined ##java
[18:26:46] *** rburton- has quit IRC
[18:26:48] *** Furyhunter has joined ##java
[18:27:25] *** jcp has joined ##java
[18:28:47] *** vitdo82 has joined ##java
[18:31:05] *** jcp has quit IRC
[18:32:16] *** rburton- has joined ##java
[18:32:39] *** jcp has joined ##java
[18:33:22] *** styx_ has joined ##java
[18:36:06] *** c_axis has joined ##java
[18:38:31] *** poseidon has joined ##java
[18:39:33] *** c_axis has quit IRC
[18:39:34] *** bitterman has quit IRC
[18:39:47] *** mrenouf has quit IRC
[18:41:41] *** vncntd has quit IRC
[18:45:10] *** Iszak has quit IRC
[18:49:52] *** keks_ has quit IRC
[18:49:53] *** eci has quit IRC
[18:50:45] *** BfrOv3rfl0w has quit IRC
[18:54:07] <RLa> how do i create enum value from enum class?
[18:54:37] <RLa> Class<?> clazz
[18:55:07] *** Zaidwi has quit IRC
[18:55:12] <RLa> Enum.valueOf(clazz, name) <- gives type error
[18:56:16] <ernimril> RLa: uh?
[18:56:29] <ernimril> RLa: what do you want to do? YourEnum.valueOf(String)?
[18:56:50] <RLa> i need to create that in custom serialization thing
[18:56:56] *** psst has joined ##java
[18:57:22] <selckin> clazz.isEnum is true?
[18:57:25] <RLa> yes
[18:57:32] *** Cymage has quit IRC
[18:57:54] <RLa> clazz is the parameter type of a known setter method
[18:57:55] <selckin> what error?
[18:58:24] <RLa> Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture#2-of ?>, String). The inferred type capture#2-of ? is not a valid substitute for the bounded parameter <T extends Enum<T>>
[18:58:55] <selckin> oh compile error
[18:58:58] <selckin> heh
[18:59:11] <RLa> so i think clazz should be Class<T extends Enum<T>>
[18:59:24] <selckin> just cast it
[18:59:25] <RLa> but i have no value for T?
[18:59:35] <RLa> wait
[19:00:51] <selckin> is (clazz.isEnum()) { Class<Enum<?>> enum = (Class<Enum<?>)clazz;
[19:01:22] <ernimril> RLa: I still fail to see what you are really trying to do, using reflection and serialization makes me suspect that you are doing something silly
[19:01:36] <selckin> ^ probably
[19:01:37] <RLa> ernimril, do you know gson?
[19:01:47] *** Cymage has joined ##java
[19:01:58] <RLa> i accesses values through fields (including private)
[19:02:11] *** Ilod has joined ##java
[19:02:15] <ernimril> RLa: no I do not, but it seems like another json lib
[19:02:15] <RLa> i extend it to access values through public getters/setters
[19:02:29] *** flfuf has joined ##java
[19:02:39] *** Immutable7 has joined ##java
[19:02:57] <selckin> why?
[19:03:05] <RLa> every json lib i tried wants to set all members accessible (defeats language access modifiers)
[19:03:19] <RLa> (even when it's not needed)
[19:03:47] <RLa> but that action of setting everything accessible triggers security error in my environment
[19:05:24] <RLa> so i just avoid it and access values though public getters/setters which do not need to defeat language access modifiers
[19:06:38] <flfuf> Hi, I'm practicing inheritance, and I'm tyring to make a program that will show a menu (in DOS, i'm a noob) with the switch statement. Asking which of the following operations you want to do (Calculate factorials, divisions, and some other stuff). I'm doing all the factorials code and sums and stuff in separate files and classes of course since it's inheritance what I'm trying to practice. And what I don't know how to do, is, how once that I pick an option, get
[19:06:43] <_kmh_> RLa : not quite
[19:06:57] <RLa> _kmh_, what?
[19:07:04] *** `moebius` has quit IRC
[19:07:43] <_kmh_> RLa: i mean getters/setters provide more than java's modifiers
[19:07:55] <selckin> i think json-lib can do the setter thing
[19:08:04] <selckin> but i'd fix my enviroment :/
[19:09:02] *** alkos333 has joined ##java
[19:09:24] <RLa> jackson json libs can do getter/setter too but tries to set everything accessible too
[19:09:59] *** danielCraig has joined ##java
[19:10:45] <RLa> selckin, Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<Enum<?>>, String). The inferred type Enum<?> is not a valid substitute for the bounded parameter <T extends Enum<T>>
[19:11:13] <selckin> Class<? extends Enum<?>>
[19:11:34] *** jtheuer has quit IRC
[19:11:47] *** tiemonster has joined ##java
[19:11:54] <RLa> Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture#5-of ? extends Enum<?>>, String). The inferred type capture#5-of ? extends Enum<?> is not a valid substitute for the bounded parameter <T extends Enum<T>>
[19:12:00] <tiemonster> ~pastebin
[19:12:01] <javabot> http://pastie.org - Paste the final url after you've pasted your stuff there.
[19:12:09] <selckin> it works
[19:12:32] <RLa> hm
[19:12:45] *** Furyhunter has quit IRC
[19:12:52] *** bindaas has left ##java
[19:13:07] <tiemonster> Am I using ImageIcon wrong? http://pastie.org/869232
[19:13:20] *** bindaas has joined ##java
[19:14:18] <ernimril> tiemonster: seems correct
[19:14:31] <ernimril> tiemonster: but hard to say if you use the correct resource
[19:15:11] <tiemonster> I did java.net.URL imgURL = getClass().getResource("images/acespades.png"); and it returned not null
[19:16:06] <tiemonster> ah
[19:16:18] <tiemonster> Eclipse separates bin and src
[19:16:27] <tiemonster> let me copy the images over and see if that works
[19:17:29] <ernimril> tiemonster: start using a build system that _you_ control, do not rely on the ide to build your apps (but feel free to use ant/maven intergration in your ide)
[19:17:48] <tiemonster> I don't even know that that means
[19:18:05] <ernimril> tiemonster: use a build system like ant/maven/make
[19:19:02] <tiemonster> ernimril: there's a setting when you create a project to build the classes in place, or in a separate directory. I never had a reason to build them in place before now.
[19:19:04] <RLa> Enum.valueOf((Class<Enum>) clazz <- that was it!
[19:19:58] *** vladimirS has joined ##java
[19:20:13] *** vladimirS has left ##java
[19:20:14] <ernimril> tiemonster: so what do you do when you want to try to use other tools than your current ide?
[19:20:33] <ernimril> tiemonster: or if a friend want to help you with your project? do you force that friend to use eclipse?
[19:20:34] *** X-Scale has joined ##java
[19:20:58] <ernimril> tiemonster: what do you do when you want to set up a continous intergration server? do you want to run eclipse on that CI server?
[19:20:58] <tiemonster> ernimril: I'm like 2 months into java - a first year CS student. Let me crawl before I walk. ;-)
[19:21:31] *** Niall has joined ##java
[19:21:42] <ernimril> tiemonster: you really should do 1) learn basic java without any ide, 2) learn some basic build system 3) try ide:s and see if they work well for you
[19:22:03] <ernimril> tiemonster: trying to go for 3 directly tends to give people lots of problems
[19:22:56] <RLa> i would argue that
[19:22:59] <nuvolari> on the topic of "basic build system"... I don't get maven :/
[19:23:11] *** BadQuanta has joined ##java
[19:23:17] <tiemonster> ernimril: we did java for a while in notepad. I like Eclipse a lot better then that, for obvious reasons. I use Netbeans for other languages, but at this point in my learning I need to stick to one environment and learn java first.
[19:23:19] <RLa> you can use ant which is simpler but also does less
[19:23:20] *** Incubuss has joined ##java
[19:23:38] <BadQuanta> Is there an efficent way to initailze a Hash with data in java other than doing that within the constructor or a static block?
[19:23:48] <ernimril> tiemonster: so you try to do 1, 3 instead of 1, 2, 3
[19:24:02] <ernimril> BadQuanta: efficient?
[19:24:16] <RLa> BadQuanta, anonymous constructor block?
[19:24:18] <BadQuanta> Something similar to: Hashtable<String, Integer> bla = new Hashtable("One"=>new Integer(1));  <-- Something like that.
[19:24:21] <nuvolari> :/ When I studied, they did a poor job at number 2, that's why I struggle now
[19:24:22] <tiemonster> ernimril: we haven't learned *any* build system yet
[19:24:27] <ernimril> BadQuanta: there is no other one-line trick than the anonymous constructor block
[19:24:39] *** dawciobiel has joined ##java
[19:24:48] <BadQuanta> ernimril: Ok..  I thought that was the case.
[19:25:01] *** the_birdman has joined ##java
[19:25:04] <ernimril> tiemonster: well, you are on irc, that means you currently have lots of spare time. Use google and find a tutorial for ant or maven
[19:25:10] <yshavit> I would actually argue that for starting out Java, you don't really need to understand build tools that well. Probably not dealing with a whole lot of 3rd party dependencies, different projects, etc.
[19:25:18] *** mcastro has joined ##java
[19:25:18] <ernimril> tiemonster: feel free to try make or scons or ... if you prefer
[19:25:21] <tiemonster> ernimril: lol. spare time.
[19:25:25] <BadQuanta> ernimril: So if I have a public static Hashtable I should just initialize it in a static {} block?
[19:25:34] <mcastro> Hi all.
[19:25:46] <the_birdman> ~~mcastro yo
[19:25:46] <javabot> mcastro, http://tinyurl.com/lq74k3
[19:25:52] <tiemonster> ernimril: I'm on IRC because I need help. I'm a father, a part-time student, and I work full time.
[19:25:55] *** vladimirS has joined ##java
[19:26:02] *** vladimirS has left ##java
[19:26:12] <ernimril> BadQuanta: I would probably start by making it not static and then I would just init it with as many "htab.put(foo, bar)" as needed
[19:26:22] *** vladimirS has joined ##java
[19:26:52] <mcastro> I have a quick quesiton :) What certification is worthy for JAVA (J2EE etc)?
[19:26:55] <ernimril> tiemonster: learning the basics of a build system does not take long
[19:27:03] *** vladimirS has left ##java
[19:27:08] <tiemonster> ernimril: hey! that works! thanks for getting me on the right track. I even appreciate your alternate view of proper Java pedagogy.
[19:27:09] *** joet3ch has quit IRC
[19:27:17] <mcastro> the_birdman: hey
[19:27:23] <ernimril> tiemonster: if you are reasonably smart you can probably get a working build.xml in 15 minutes
[19:27:24] *** joet3ch has joined ##java
[19:27:35] <ernimril> mcastro: none
[19:27:37] <tiemonster> ernimril: for maknig jars, I suppose?
[19:27:40] <tiemonster> *making
[19:27:45] <ernimril> tiemonster: yes
[19:28:03] <ernimril> tiemonster: you can do more than that, but then you probably need to spend a few more minutes
[19:28:10] <mcastro> ernimril: OK, I see. Sun one was valuable?
[19:28:12] *** Lone_Rifle has joined ##java
[19:28:17] *** psst has quit IRC
[19:28:23] <tiemonster> ernimril: we haven't even covered jars yet. I am only aware of them because of my exposure to Pentaho.
[19:28:26] <tazle> possibly quite a few more minutes, depending on what exactly you want to accomplish
[19:28:44] *** Hydrant has joined ##java
[19:28:46] <yshavit> tiemonster: jars are pretty simple in concept. They're zips of class files.
[19:28:48] <mcastro> Are there any certification or training program that means something in the professional arena?
[19:28:49] <yshavit> and resources.
[19:28:59] <Hydrant> is there a sane way to take some object I'm given and make a copy of it
[19:29:09] <tiemonster> ernimril: when we get that far in the coursework, I'll have to drop in to get the "real story" ;-D
[19:29:13] <ernimril> mcastro: if you apply for a job where I will read your resume and I see that you have lots of certs I will think "ok, this guy/gal takes certs all the time instead of doing any real work"
[19:29:16] <BadQuanta> ernimril: Its going to contain some formatting information, I'd like the format to be customizeable, but consistant between all instances..  Would you still set it up that way?
[19:29:31] *** digitaloktay has quit IRC
[19:29:42] *** enav has quit IRC
[19:29:53] <ernimril> BadQuanta: yes, I really do not like static state
[19:30:02] <mcastro> ernimril: :) I see your point. I have some years of experience, and I am IDLE now, so I was thinking about investing some time in it.
[19:30:05] *** psst has joined ##java
[19:30:07] <BadQuanta> ernimril: Hmm.. Ok. :)
[19:30:12] <srm> ~~Hydrant clone
[19:30:12] <javabot> Hydrant, Making deep copies of objects: http://java.sun.com/developer/JDCTechTips/2001/tt0410.html#making  Cloning Objects: http://java.sun.com/developer/JDCTechTips/2001/tt0306.html#cloning  Making defensive copies of objects: http://java.sun.com/developer/JDCTechTips/2001/tt0904.html#tip1 also see: http://mindprod.com/jgloss/clone.html
[19:30:18] *** enav has joined ##java
[19:30:20] <mcastro> ernimril:  Any idea on where to invest my time?
[19:30:24] <ernimril> BadQuanta: I have had too much problems where I have programs and want to run several instances in the same jvm
[19:30:44] <BadQuanta> ernimril: If thats best practice, I'll move the format to the container object and it'll just apply it to all sub objects.
[19:30:44] <yshavit> srm, javabot: lots of 404s there....
[19:30:47] <mcastro> ernimril: I have 10 years of experience, mainly in Java, SOA and AJAX.
[19:30:51] <srm> *doh*
[19:30:58] <yshavit> blame Oracle.
[19:31:00] <ernimril> BadQuanta: sure, _I_ know enough of classloaders to actually be able to handle it if I need to, but it is better if I can just run the extra instances directly
[19:31:07] <srm> *damn you oracle!*
[19:31:22] <srm> Hydrant, you get the idea...
[19:31:40] <ernimril> mcastro: ok
[19:32:05] <ernimril> mcastro: I would suggest that you find some project (possibly some open source one if you are currently not employed)
[19:32:15] <Hydrant> srm: the first link doesn't exist
[19:32:27] <Hydrant> srm: or the second
[19:32:36] <Hydrant> or third
[19:32:45] <yshavit> Hm, you know, you can read all you want about Java syntax, threading, construction patterns... but they never teach you how to efficiently write Java with a cat sitting on your keyboard. Hrmph.
[19:32:50] <ernimril> mcastro: sure, you can do certification, if you have one or two courses/certs on your resume and 10+ years of work I do not think it will look bad
[19:32:54] <mcastro> ernimril: Yeah, I thought of that (joining an open source project)
[19:32:54] <srm> so what, there's enough plain text in javabot's answer to get you on track.
[19:33:01] <srm> @Hydrant
[19:33:10] <mcastro> ernimril: I am lost about which certification is good.
[19:33:26] <mcastro> ernimril: I have seen very bad comments on certs
[19:33:34] <ernimril> mcastro: I just do not do them, so I do not really know
[19:33:42] *** gdoko has joined ##java
[19:33:56] *** mreh has joined ##java
[19:33:58] *** Stericson has joined ##java
[19:34:02] <Hydrant> srm: well... other than overcomplicated / silly ways of doing copies... is there no standard sane way to just make a simple copy without resorting to serialization or other dumb tricks
[19:34:03] <ernimril> mcastro: I value real experience more (and it seems like a lot of other people who hire in here do to)
[19:34:11] <mcastro> ernimril: Apart sun's one can you remember another one? (BTW thanks for all the great feedback)
[19:34:16] <srm> Hydrant: what is silly in your terms?
[19:34:28] <srm> Hydrant: and what is a simple copy?
[19:34:29] <Hydrant> srm: serialization... the fact clone is protected
[19:34:34] <Hydrant> srm: byte-wise copy
[19:34:35] <SeriousWorm> http://java.sun.com/developer/JDCTechTips/2001/tt0410.html#making gives 404 ! update ~close
[19:34:37] <SeriousWorm> clone*
[19:34:50] <darrend> anyone recommend a very fast way to update an XML doc?  I need to add a new element to an existing JMS XML payload.  This will need to happen circa 500 times per second
[19:34:53] <yshavit> Hydrant: how many layers down are you copying, for instance? There's really not a simple definition.
[19:34:53] <SeriousWorm> http://java.sun.com/developer/JDCTechTips/2001/tt0904.html#tip1 also 404 ..
[19:34:56] <Lone_Rifle> default clone is shallow?
[19:35:31] <Hydrant> it's just a simple plain old object... I'm not trying to copy some base class of some crazy class tree
[19:35:37] * nuvolari gives maven another try and RTFM
[19:35:53] <ernimril> darrend: how big is the xml?
[19:35:57] <yshavit> Hydrant: If I have a class Foo that has a field which is a List<Bar>, does a copy of Foo contain the same reference to the original list? Or does it contain a new List with the same objects? And if the latter, is it a list of the same references, or copies? Etc etc etc.
[19:36:13] <ernimril> ~~darrend xml parsin
[19:36:13] <javabot> darrend, I have no idea what xml parsin is.
[19:36:14] <ernimril> ~~darrend xml parsing
[19:36:14] <javabot> darrend, xml parsing is best accomplished with one of - XOM @ http://www.xom.nu/ - JAXB @ http://java.sun.com/xml/jaxb/ - JDOM @ http://www.jdom.org/ - mox @ http://bit.ly/6Z15WF - JAXP (including StAX as well as the legacy SAX and DOM) @ https://jaxp.dev.java.net/
[19:36:30] <the_birdman> ~dom4j
[19:36:30] <javabot> the_birdman, dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework and with full support for DOM, SAX and JAXP. see the following for more information: http://dom4j.sourceforge.net/
[19:36:31] *** tiemonster has quit IRC
[19:36:50] *** meatmanek has quit IRC
[19:36:56] <Hydrant> yshavit: well... if you do a byte-wise copy of just the object... then it's the same list
[19:37:19] <darrend> ernimril: none of those are likely to be fast enough.  Anything based on DOM will probably fail on speed and memory requirements.
[19:37:33] <darrend> that rules out JDOM, DOM4J, W3C I think
[19:37:59] *** Rayne has joined ##java
[19:37:59] <yshavit> Hydrant: My point was, the definition of "copy" isn't actually so simple. Anyway, if you want what I think you want, it's not that hard to just create a new object and copy over its references.
[19:38:06] <ernimril> darrend: 500 times per second on what type of hardware? on a simple server you normally have 4-16 cores nowdays so that gives you 8-32 millis per document
[19:38:12] <yshavit> Hydrant: You could even use reflection to do it. :)
[19:38:28] <darrend> ernimril: 500 times per second per core
[19:38:45] <ernimril> darrend: hmm, that sounds reasonably busy.. :-)
[19:38:49] <darrend> (I've already factored that in :) )
[19:38:56] <ernimril> darrend: how big is the xml?
[19:39:01] <Hydrant> yshavit: I'm well aware of copying issues... it's Java that I'm not aware of
[19:39:20] <darrend> ernimril: not big - between 0.5kb and 1kb
[19:39:31] <ernimril> darrend: oh, that is not very big...
[19:39:37] <mcastro> What is kind in vogue now in Java?
[19:39:44] <darrend> ernimril: no, but there are lots of 'em
[19:40:19] <yshavit> Hydrant: okay. So, overriding clone() is probably your best bet.
[19:40:20] <ernimril> darrend: If I needed to do such things silly fast I might consider just doing something like "find the X:th <, grab the substring from the start to that, add the extra content and then the substring from that part"
[19:40:46] <ernimril> darrend: not doing any xml at all, it might be a bit fragile, depending on the xml content, but it will be about as fast as you can get it
[19:41:12] <yshavit> Hydrant: Actually with a very simple shallow copy, don't even need to override. Just implement Cloneable
[19:41:14] <darrend> ernimril: mmm.. I had wondered.  There is also vtd-xml (that I've never used but seems to claim to do similar sorts of processing)
[19:41:19] <ernimril> darrend: but please note that this is optimizing for speed at the cost of stability (if the xml changes)
[19:41:25] <darrend> ernimril: yep
[19:41:27] <tazle> darrend: and if you feel bad about that, stax with woodstox was the fastest way I could find of munging some Openstreemap data
[19:41:49] <darrend> tazle: I'll take a look at those, thanks
[19:41:54] <Hydrant> yshavit: implement Cloneable... funny that you have to do that... I'll take a look
[19:42:38] *** srm has quit IRC
[19:42:50] *** silver has joined ##java
[19:43:00] <yshavit> Hydrant: It's a bit odd, yeah. But Cloneable is just a tag interface that tells Object.clone() that it should do a field-to-field copy
[19:43:13] <Hydrant> yshavit: and I get back to the problem that .clone() is protected
[19:43:26] * Hydrant really doesn't like Java... and wants to go back to C++ very badly
[19:43:36] <yshavit> Hydrant: yeah, so you override it to make it public. @Override public Object clone() { return super.clone(); }
[19:44:00] <Hydrant> yshavit: didn't know I can override to change protections
[19:44:06] <ernimril> yshavit: Object.clone does not do a field-to-field copy it does a memory copy
[19:44:18] <yshavit> Hydrant: yeah, Override can always increase visibility
[19:44:53] *** IvoryZion has joined ##java
[19:44:55] <yshavit> ernimril: Hrm? Java's docs specify "A class implements the Cloneable interface to indicate to the Object.clone() method that it is legal for that method to make a field-for-field copy of instances of that class."
[19:45:09] *** bitshuffler has joined ##java
[19:45:17] *** freeone3000 has quit IRC
[19:45:54] <IvoryZion> And unfortunately, clone() is protected...
[19:45:56] <ernimril> yshavit: the end result is the same
[19:46:09] <yshavit> Hydrant: it took me a good long while to not say things like your /me, too :)
[19:46:40] <Hydrant> yshavit: and you survived?
[19:47:25] <yshavit> Hydrant: I did. Just, a word of advice... find the part of your brain that knows C++ templates, and lobotomize it. I *still* haven't gotten over how inferior Java generics are. :-P
[19:47:32] * yshavit dons asbestos suit.
[19:48:19] <Hydrant> yshavit: yah... going from C++ expert, doing TMP... to trying to figure out how the f*ck you just copy an object is pretty crazy
[19:48:39] *** donthitme has quit IRC
[19:49:45] <ernimril> Hydrant: if you want to copy objects you probably should just implement a copy constructor instead of trying to use clone
[19:49:59] <SeriousWorm> ~copy constructor++
[19:49:59] <javabot> SeriousWorm, I have no idea what copy constructor++ is.
[19:50:04] <ernimril> Hydrant: or maybe even go for immutable objects and just share them
[19:50:04] <SeriousWorm> ~copyConstructor++
[19:50:05] <javabot> copyconstructor has a karma level of 1, SeriousWorm
[19:50:07] <Hydrant> ernimril: are copy constructors actually part of java... or just some convention
[19:50:16] <SeriousWorm> convention
[19:50:22] <Hydrant> haha
[19:50:27] <ernimril> Hydrant: you have to implement them yourself
[19:50:43] *** gdoko has quit IRC
[19:50:57] <LadySerena> is it possible for the Properties class to return arrays?
[19:51:09] <Hydrant> maybe making the stupid thing immutable is the way to go
[19:51:15] <Hydrant> you just mark everything as final ?
[19:51:38] <Hydrant> or do I implement ImmutableObject
[19:51:47] <yshavit> Hydrant: there's no "const", as you probably know... so yeah, everything as final, but also, hide any reference that itself might be mutable.
[19:51:49] *** EnginAy has joined ##java
[19:51:56] <ernimril> Hydrant: you mark instance variables as final and make sure that they are immutable as well
[19:52:19] <Hydrant> yshavit: ok... so I'm returning a date object which isn't immutable... so I gotta descend into there and make it immutable?
[19:52:29] * Hydrant thinks this is overly compllicated
[19:52:43] <yshavit> Hydrant: that, or return a copy of the Date() via getDate
[19:52:51] <Hydrant> yshavit: it's actually QDate
[19:52:58] *** mreggen has joined ##java
[19:53:02] *** Deeewayne has joined ##java
[19:53:11] <yshavit> Hydrant: well, same concept. Make it immutable, or return a copy of it...
[19:53:40] <yshavit> Hydrant: I agree it's not very clean, but then, C++'s const has its own issues in practice
[19:53:47] <Hydrant> yshavit: if I mark it as final... the reference is immutable or the whole object
[19:53:55] <yshavit> Hydrant: just the reference
[19:54:08] <Hydrant> yshavit: which means someone can take it.. and make changes if they want
[19:54:18] <yshavit> final Foo foo is like const Foo* foo
[19:54:27] <Rednaxela> Which is why you make it immutable or return a copy
[19:54:58] <danielCraig> ~pastebin
[19:54:58] <javabot> http://rifers.org/paste - Paste the final url after you've pasted your stuff there.
[19:55:06] *** Furyhunter has joined ##java
[19:55:09] <yshavit> Hydrant: yeah, there's no equivalent of Foo * const foo
[19:55:19] <Hydrant> yshavit: that's what I was thinking
[19:55:27] <Hydrant> yshavit: so const-correctness is not a concept that's valid in Java
[19:55:32] <yshavit> Hydrant: right
[19:55:43] <Hydrant> yshavit: haha
[19:56:05] *** joet3ch has quit IRC
[19:56:11] <Rednaxela> It can happen by conventions of course, just not language-enforced
[19:56:13] *** Serendib has joined ##java
[19:56:17] *** sly007 has joined ##java
[19:56:22] <yshavit> Hydrant: but again, from my experience (which is admittedly pretty low), const correctness has its own issues
[19:56:22] <Hydrant> I see
[19:56:46] <Hydrant> yshavit: not that I've ever seen... but who knows
[19:56:49] <yshavit> In that it's contagious and all, so if you're using a library that hasn't done it right, now you can't do it right either.
[19:57:04] <Hydrant> yshavit: that's on purpose... and const_cast<> takes care of that issue for ya
[19:57:20] <Hydrant> yshavit: which is only there for working with libs that don't use const correctness
[19:57:28] <yshavit> Hydrant: true (on both regards).
[19:57:31] <sly007> in one of my methods (actually, the main one), I have just one line which is "new Handler();" - Do I have a design problem here? Is it common to have some instance not even stored to a variable?
[19:58:30] <yshavit> Hydrant: there are definitely things about C++ I miss in Java. Again, if you haven't gotten into Java generics yet, you're in for a reaaaal treat.
[19:58:38] <yshavit> (sarcastic)
[19:58:54] <Hydrant> yshavit: the problem in the project I'm working on here (for a course) is that a couple people I'm working with aren't so bright (random groups suck)... and literally take any stupid shortcut and destroy everything... and so I know in C++ exactly how to insulate my work from dumb people
[19:58:58] * Rednaxela coughs something about type erasure
[19:59:03] <yshavit> sly007: hard to say 100% of the time, but it's often a code smell, yeah.
[19:59:06] <danielCraig> http://rifers.org/paste/show/543 why is i=1 and not 4?
[19:59:28] <Hydrant> yshavit: I'm having a really hard time implementing things as I know how to... no friendship so I have to expose a constructor to them and they'll make dumb uses of it
[19:59:31] *** Wicked has quit IRC
[19:59:38] <sly007> Handler is a class which implements Runnable and create and start its private thread
[19:59:46] <sly007> which result I don't care
[19:59:54] *** Cymage has quit IRC
[19:59:54] <Gracenotes> danielCraig: read the docs for what ^ means
[19:59:58] <sly007> that's why I have this line "new Handler();"
[20:00:04] <ernimril> danielCraig: single line match/multi line match
[20:00:05] <Hydrant> yshavit: there are only 2 things I wish C++ had from Java... the byte type... and something else I forget about
[20:00:08] *** silver has left ##java
[20:00:13] <Hydrant> yshavit: not having destructors also made me crazy
[20:00:23] <sly007> I wonder if there's a design flaw
[20:00:23] <ernimril> sly007: starting threads from the constructor is generally bad
[20:00:24] <Gracenotes> it's not as if all regex implementations to the same thing.. it's possible to turn on multiline mode though. again, docs.
[20:00:26] <yshavit> Hydrant: destructors don't really make sense in a GC world
[20:00:31] <danielCraig> Gracenotes: " Boundary Matchers                 ^           The beginning of a line"
[20:00:34] <Gracenotes> *do the same thing, that is
[20:00:53] <sly007> ernimril: why?
[20:00:54] <yshavit> sly007: why not just do it via a static method?
[20:01:08] <Gracenotes> danielCraig: "By default, the regular expressions ^ and $ ignore line terminators and only match at the beginning and the end, respectively, of the entire input sequence."
[20:01:09] *** elfgoh has quit IRC
[20:01:14] <sly007> yshavit: do what?
[20:01:22] <yshavit> sly007: do you know about static methods?
[20:01:23] <ernimril> sly007: you publish a reference to a non-fully-built object to some other class
[20:01:34] <ernimril> sly007: s/class$/thread/
[20:01:37] *** Niall has quit IRC
[20:01:48] <ernimril> ~~sly007 jcip
[20:01:48] <javabot> sly007, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java.  http://jcip.net/
[20:01:56] <danielCraig> Gracenotes: thanks
[20:01:59] *** Niall has joined ##java
[20:02:00] <ernimril> sly007: that book tells you all you need to know about it
[20:02:05] <yshavit> ~ernimril++
[20:02:05] <javabot> ernimril has a karma level of 168, yshavit
[20:02:14] <yshavit> great book
[20:02:40] <Gracenotes> danielCraig: hm, looking at it, that section is mostly quick descriptions. anyhow, Pattern.compile(str, MULTILINE)'ll do it. And you can OR together other states, like CASE_INSENSITIVE
[20:02:43] <ernimril> it is a very good book
[20:03:04] *** LouisJB has joined ##java
[20:03:14] <ernimril> sly007: so do a "new Handler().start()" instead if you really want that
[20:03:32] <sly007> yshavit: yes I do know about static methods
[20:03:40] <ernimril> sly007: if you ever allow subclasses of your handler, then consider what will happen when you call "new SubClassOfHandler()"
[20:03:42] <Gracenotes> I wonder if Pattern.compile used EnumSet for its flags.
[20:03:55] <ernimril> Gracenotes: unpack src.zip and find out
[20:04:07] <Gracenotes> ernimril: it doesn't. But if it did.. it might be painful.
[20:04:31] <Gracenotes> I still like bitmasks over EnumSets, mostly.
[20:04:32] <yshavit> sly007: actually the static methods aren't as valid if you're spinning off a new thread, sorry. :) I thought Handler was setting some other things and then returning back.
[20:05:08] <yshavit> sly007: You can still do the new Handler().start() pattern via a static method of course, it's just not as necessary.
[20:05:24] <ernimril> Gracenotes: EnumSet is a bitmask
[20:05:39] <Gracenotes> yeah, a hell of a wrapper around one
[20:06:35] <sly007> What style is recommended ? implementint a Runnable r and then Thread(r) it, or subclassing Thread?
[20:06:42] <Gracenotes> I think it's mostly using the EnumSet creation syntax /every/ /single/ /time/ I wanted a regex that would get to me.
[20:06:55] *** Cymage has joined ##java
[20:07:01] <ernimril> sly007: implement Runnable and pass it to a thread pool
[20:07:03] <SeriousWorm> sly007: the first
[20:07:04] <SeriousWorm> yeah.
[20:07:27] *** dawciobiel has quit IRC
[20:08:44] *** Hydrant has left ##java
[20:10:34] <enav> SeriousWorm  check this http://is.gd/aCLM8
[20:12:58] *** sphenxes has quit IRC
[20:13:17] <yshavit> I gotta make like an f-22 and jet. cya all!
[20:13:42] *** Rednaxela has left ##java
[20:13:45] *** EnderMB has joined ##java
[20:14:01] *** lilalinux_away is now known as lilalinux
[20:14:43] *** nchaimov has quit IRC
[20:14:58] <RLa> nice, my public setter/getter to json serializer works well
[20:15:01] *** nchaimov has joined ##java
[20:15:25] *** yshavit has left ##java
[20:17:32] *** srm has joined ##java
[20:18:55] *** MrGerjo has left ##java
[20:18:58] *** RowCol has joined ##java
[20:19:09] <RowCol> hello
[20:19:24] *** sphenxes has joined ##java
[20:19:34] *** nchaimov_ has joined ##java
[20:20:35] *** enav has quit IRC
[20:20:49] <RowCol> I have some elements (strings) in a vector, for example the vector is:  |"elem1"|"elem2"|"elem3"|   I want to have a string containing "elem1;elem2;elem3"
[20:20:55] <RowCol> how can I do ?
[20:21:17] <ernimril> RowCol: a StringBuilder and a loop
[20:22:17] <EnderMB> I don't mean to be rude, but if you look for information on comma-delimited strings on google you'll probably find some worthwhile code
[20:22:34] * Lone_Rifle suggests the FizzBuzz test
[20:22:44] <RowCol> there are no method which is the opposite of split ? split create an array from a String
[20:22:57] <ernimril> RowCol: not in the standard api, no
[20:23:05] *** nchaimov has quit IRC
[20:23:05] *** nchaimov_ is now known as nchaimov
[20:23:05] <RowCol> ok
[20:23:07] <RowCol> thanks
[20:23:08] <ernimril> RowCol: there is such a method in many 3:rd party libs though
[20:23:29] *** sepult has joined ##java
[20:25:41] <RLa> commons-lang StringUtils should have it
[20:26:18] *** genesiss has joined ##java
[20:26:21] *** sphenxes has quit IRC
[20:26:48] *** sphenxes has joined ##java
[20:27:12] *** RowCol has quit IRC
[20:27:37] *** enav has joined ##java
[20:30:23] <EnderMB> Does anyone here know of any good Java resources for Genetic Algorithms or Neural Networks? I am working on a maze solving application and there isn't much help out there from what I've found
[20:31:18] *** sly007 has quit IRC
[20:31:25] <ernimril> ~jgap
[20:31:26] <javabot> ernimril, I have no idea what jgap is.
[20:31:46] <RLa> EnderMB, see weka
[20:32:16] *** elbeardmorez has joined ##java
[20:32:24] <flfuf> Hi, I'm trying to multiply two numbers. One is a constant, and the other is inputed by keyboard using the java scanner. However, I get errors saying that they cannot be multiplied because one is an int, and the other is a java.util.scanner type.
[20:32:37] <flfuf> What am I doing wrong?
[20:33:05] *** RdeWilde has quit IRC
[20:33:06] <RLa> you are trying to multiply wrong things
[20:33:37] <RLa> you should use a method on scanner that would return you that scanned int
[20:35:49] <EnderMB> RLa: I've taken a look at Weka, but as far as I can see it doesn't cover any genetic algorithms
[20:36:19] *** Wicked has joined ##java
[20:36:57] <RLa> hm, how would you use genetic algorithms for maze solving anyway?
[20:37:37] <RLa> does you agent has some knowledge about maze other that visited paths available?
[20:37:45] <EnderMB> I create an initial population of genes (1 to 0) and run bitwise mutation, elitism and evolve their populations to find the optimum solution
[20:37:54] <RLa> uh oh
[20:38:03] *** enav has quit IRC
[20:38:45] <EnderMB> I've got it running through a maze so far, using nearby walls to increment the fitness of the agent
[20:38:57] <EnderMB> I just need to "plug in" my GA to the maze and agent and have it run itself
[20:39:06] *** Athenon has joined ##java
[20:39:20] <EnderMB> If I could turn the int array of genes into boolean values easily it might be a bit easier
[20:39:54] <EnderMB> At the moment I have a GA that uses the gene values to define fitness and an agent and maze that has an array of boolean values set as rules
[20:40:17] <Furyhunter> flfuf, constInt*scanner.nextInt();
[20:41:22] *** sphenxes has quit IRC
[20:42:24] *** Sergio` has quit IRC
[20:42:41] <danielCraig> what is the easiest method to recive the linecount of a String?
[20:43:20] <danielCraig> string.split("\n").length  ?
[20:43:50] <Furyhunter> I'd assume so.
[20:46:18] *** Niall has quit IRC
[20:46:34] <ernimril> danielCraig: it depends on what your definition of line is
[20:47:17] <danielCraig> like  rows in a textarea
[20:50:02] *** enav has joined ##java
[20:52:10] *** groton has joined ##java
[20:52:44] <groton> to compare a long and a Long do i need to use the Long.longValue() method?
[20:53:17] <_W_> no
[20:53:20] <_W_> ~autoboxing
[20:53:21] <javabot> _W_, autoboxing is http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html
[20:53:41] <groton> _W_, thanks, i am reading it now :)
[20:53:42] <_W_> you may want to, if you want to be extra super clear
[20:54:15] *** white_gecko has joined ##java
[20:54:27] <white_gecko> hello
[20:54:34] *** zed_DX has joined ##java
[20:54:35] <enav> hi
[20:55:02] <danielCraig> but splitting the string only to count the number of lines , is a little bit slow, shall I do it with some kind of string.indexOf  and a loop?
[20:55:20] <white_gecko> if hava a "Parrent obj = new Child();" and want to call "obj.childMethod();" on it.
[20:55:40] <white_gecko> and Child extends Parrent
[20:55:54] <white_gecko> how do i validate, that obj is a Child?
[20:56:09] <_W_> danielCraig, it's trivially slower, and if you want a loop, you should just count the newlines directly
[20:56:37] <_W_> white_gecko, you misspelled "parent"
[20:56:47] <ernimril> white_gecko: if you want to do that you should not lose the information that obj is a Child
[20:56:48] *** MichielH has quit IRC
[20:57:01] * _W_ nods
[20:57:08] <white_gecko> i tried if(obj instanceof Child) {obj.childMethod();} but netbeans tells me, it doesn't know the symbol (childMethod)
[20:57:40] *** Teknoenie has joined ##java
[20:57:42] <white_gecko> hm but i did loose this information, because it is the type of the used backend
[20:57:43] *** marcosroriz has joined ##java
[20:57:43] <ernimril> white_gecko: you need to cast it
[20:57:49] <_W_> just do Child somethingMoreSensibleThanObj = new Child(); somethingMoreSensibleThanObj.childMethod();
[20:58:03] <Teknoenie> is there a way to specify the maximum thread count at runtime?
[20:58:12] <ernimril> Teknoenie: no, not really
[20:58:15] <_W_> Teknoenie, no, why would there be such a thing?
[20:58:25] <ernimril> Teknoenie: but you can make sure you do not use more than X threads
[20:58:31] <_W_> you can enforce it with a security manager I guess, but you'd break tons and tons of code
[20:58:44] <Teknoenie> i'm running in an HPC cluster and if a Java application is running on a 12 core machine it launches 12 threads for each job and 12 jobs are packed on a node
[20:58:46] *** juan--d-_-b has joined ##java
[20:58:47] <white_gecko> ernimril: thanks, I think, that was the point
[20:59:16] <_W_> Teknoenie, I don't understand - is this what you want, or what you don't want?
[20:59:24] <Teknoenie> don't want
[20:59:31] <_W_> why not?
[20:59:32] <Teknoenie> it should be 1 thread per core
[20:59:41] <_W_> presumably the application knows best how many threads are good'
[20:59:41] <Teknoenie> otherwise the machine is over subscribed
[20:59:53] <Teknoenie> that is a wrong assumption in an HPC cluster
[20:59:56] <_W_> erm, people did multithreaded apps long before multicores
[21:00:10] <_W_> ok then I have no idea what you are talking about
[21:00:21] <_W_> but chances are Java is wrong for it
[21:01:17] *** groton has left ##java
[21:01:19] <Teknoenie> I understand that, but the user application is Java, I need to be able to run it and as such being able to specify the number of threads to run based on the number of threads requested is essential
[21:01:54] <Teknoenie> Matlab has the MaxNumCompThreads(x) option to limit it's threaded behavior to X, so I was hoping Java had something similar
[21:02:25] <Teknoenie> OpenMP, MPI, etc all have this behaviour, so I'm a bit at odds as to why Java doesn't
[21:02:47] <_W_> Teknoenie, various /features/ of java have a max thread count
[21:02:58] <_W_> such as executors, database pools, network libraries, etc
[21:03:04] <Teknoenie> can it be specified at run time or only in code?
[21:03:15] <_W_> but there's no unified way of controling it, you just have to have the application configure everything right
[21:03:38] <ernimril> Teknoenie: your code can control how many threads your code want to use at runtime
[21:03:40] <_W_> and even then, it is hard to keep track of all the libraries that just spawn a new thread for the hell of it
[21:04:01] <_W_> (HttpUrlConnection, I am looking at you)
[21:04:39] <Teknoenie> so there really isn't a way in Java to specify at run time.  What about globally in the JIT compiler or through a config file?
[21:05:08] <_W_> Teknoenie, your code does new Thread().start(). What will happen with that code, if the thread count is at max?
[21:05:08] *** BfrOv3rfl0w has joined ##java
[21:06:46] <_W_> Teknoenie, is there a simple explanation for why one too many thread is a bad thing in your case?
[21:06:55] *** Deeewayne has quit IRC
[21:07:07] *** joet3ch has joined ##java
[21:07:41] <Teknoenie> yes, because there are many more than just this one application running on these nodes
[21:07:52] <Teknoenie> stepping on peoples toes is not a good thing
[21:08:28] <Teknoenie> I have to step out for a minute.  Perhaps I need to reformulate what I'm asking here
[21:08:30] <_W_> that might have been too simple. I mean, is there a simple explanation for why your situation is different from running on a regular PC?
[21:08:49] <_W_> if you run too many threads, do programs crash?
[21:08:53] <Teknoenie> all I want is the ability to say that I want Java application X to only be able to use Y # of threads
[21:09:06] <_W_> and we've told you repeatedly, there's no simple way to do that
[21:09:13] *** thepro4ever has joined ##java
[21:09:17] <Teknoenie> right, so it doesn't work
[21:09:19] <_W_> also, are you talking Java treads, OS threads, or perhaps even processes?
[21:09:22] <thepro4ever> what is the link to pastebin
[21:09:25] <thepro4ever> ~paste
[21:09:25] <javabot> Paste your code, preferably a test case, any errors, and any other relevant information into the pastebin and tell us the URL: http://eugeneciurana.com/pastebin
[21:12:37] *** mrenouf has joined ##java
[21:14:19] *** Niall has joined ##java
[21:14:33] *** okae has joined ##java
[21:14:53] *** Leemp has quit IRC
[21:15:28] *** joet3ch has quit IRC
[21:16:14] *** andy^ has joined ##java
[21:17:42] <marcosroriz> guys, why I'm gettin false for thing like. System.out.println(field[0].getName()) // Prints "hai", then I do if (field[0].getName() == "hai") I get false
[21:18:16] <ernimril> marcosroriz: because Strings are objects and not primitives
[21:18:25] <ernimril> marcosroriz: what does == do for objects?
[21:18:27] *** Kedare has quit IRC
[21:18:44] <marcosroriz> I know, but it used to work
[21:19:31] <marcosroriz> hm
[21:19:46] <ernimril> marcosroriz: what does == do for objects?
[21:19:58] <dob1> i use the derby db in embedded mode, to backup it can i simply copy the directory where the database is even if the database is in use?
[21:20:07] <marcosroriz> == means equal, if objects are the same
[21:20:11] <marcosroriz> on memory
[21:20:50] <ernimril> marcosroriz: == checks if the reference points to the same objects, it is not an equality test
[21:21:01] <marcosroriz> yeah, that
[21:21:06] <ernimril> marcosroriz: so how do you check for equality?
[21:21:18] *** vladimirS has joined ##java
[21:21:18] <marcosroriz> I hate the compareTo and equals methods >.<
[21:21:41] <vladimirS> marcosroriz: they sometimes don't work
[21:21:49] *** c_axis has joined ##java
[21:22:00] <vladimirS> ive had a case where string1.compareto(string2) are equal but it says they arent
[21:22:13] <vladimirS> so i had to swap and make it string2.compareto(string1)
[21:22:35] *** mreggen has quit IRC
[21:25:43] *** vladimirS has left ##java
[21:26:41] *** alkos333 has quit IRC
[21:27:14] *** Kedare has joined ##java
[21:27:32] *** vladimirS has joined ##java
[21:27:36] *** vladimirS has left ##java
[21:27:38] <Yivz> Does the main() method being declared synchronized have any significant? When main() is invoked, does it even belong to any class? Since a normal static method belongs to a particular Class.
[21:29:05] *** enav has quit IRC
[21:30:12] *** enav has joined ##java
[21:31:40] *** dmb has joined ##java
[21:31:55] *** Sergio` has joined ##java
[21:32:13] <dmb> hey
[21:32:15] *** fedito has joined ##java
[21:32:21] <dmb> any of you use the grizzly framework?
[21:32:24] <ernimril> Yivz: all methods belong to one class
[21:32:53] <BadQuanta> So.. is the Observable/Observer models ideal for monitoring changes to data so that a Swing object can update?
[21:33:06] *** _kmh_ has quit IRC
[21:33:26] <the_birdman> BadQuanta: It depends, I personally don't use those classes anymore
[21:33:29] <ernimril> Yivz: adding synchronized to a static method means that you synchronize on the class of that method, so it is more or less the same as "class MyClass {public static void main(String[] args) { synchronized(MyClass) {... }}}"
[21:33:29] *** Baldurgon has joined ##java
[21:34:02] <BadQuanta> the_birdman: Do you just re-implement the logic yourself or is there a better (standard library) way of doing it?
[21:34:02] <the_birdman> BadQuanta: consider jgoodies binding or custom listeners, etc.
[21:34:53] <the_birdman> BadQuanta: there are just plenty of ways, observer/observable is fine anyway, however you might want to extend something else other than observable in your model, etc.
[21:35:14] <BadQuanta> the_birdman: I ask because I worry that observer/observable won't always dispatch on the "event processing thread"... or whatever.
[21:35:25] *** joet3ch has joined ##java
[21:35:52] <BadQuanta> the_birdman: If it isn't obvious to you, I am a Java student.
[21:36:17] *** white_gecko has quit IRC
[21:36:34] *** epure has quit IRC
[21:37:12] <the_birdman> BadQuanta: if you use threads use SwingUtilities to update the GUI that's it, I didn't read the observable source code, but if the observer GUI isn't notified in the EDT, you can do it yourself
[21:37:36] <BadQuanta> the_birdman: Thanks. :)
[21:37:43] *** c_axis has quit IRC
[21:38:17] <Yivz> ernimril, Thank you. Your first statement pretty much answered the second part of the my question.
[21:39:08] <BadQuanta> the_birdman: So, basically I should just encapsulate my "handeling" code in a Runner and call invokeLater()/invokeAndWait() (as appropriate). :)  Thanks.
[21:39:25] <mcastro> ernimril: Hey, jsut a quesiton, are you involved now in any open source project?
[21:39:59] <ernimril> mcastro: yes, several
[21:40:19] <mcastro> ernimril: JAva based?
[21:40:33] <ernimril> mcastro: my pet projects, but since I have a full time job I do not do as much work as I want on them
[21:40:46] *** Ilod has quit IRC
[21:40:55] <mcastro> ernimril: OK i see
[21:41:02] <ernimril> mcastro: mostly, yes: http://www.khelekore.org/ (there are a few private projects apart from those as well)
[21:41:28] <mcastro> ernimril: ok, thank you for sharing
[21:41:42] <ernimril> mcastro: prtree might seem inactive, but it just does not require much work :-)
[21:42:37] *** ziggles has joined ##java
[21:44:28] <ernimril> mcastro: I mostly made prtree since the oracle based r-tree used way too much memory
[21:44:34] *** digitaloktay has joined ##java
[21:44:50] *** merp has joined ##java
[21:44:51] <AMcBain> heh
[21:45:01] <ernimril> mcastro: and I wanted to know how priority r-tree worked, general r-tree I knew about already
[21:45:29] <mcastro> ernimril: I am checking it out, i t looks nice, also the rabit proxy :)
[21:45:49] <ernimril> AMcBain: 1M point objects and oracle uses 140 MB, my r-tree uses 16 MB (if I remember the numbers correctly)
[21:46:04] <AMcBain> wow
[21:46:10] <mcastro> ernimril: I worked a long time ago for a company that focused on speeding up webpages.. we never got an answer about why people don;t use gzip in the web servers
[21:46:53] <ernimril> AMcBain: and speed is about the same for many lookups (+- 1 percent without any statistical evidence)
[21:47:20] <ernimril> mcastro: I think more people do use gzip nowdays, at least more servers make it easier to set it up
[21:47:59] <AMcBain> people's personal projects always seem to be cool, and other pressing concerns always tend to reduce amount of time spent on them
[21:48:22] <mcastro> ernimril: The only answer that made sense to me (apart from the CPU load) was an incompatibility with with either the HTTP or GZIP implementations
[21:48:36] *** monestri has quit IRC
[21:49:05] *** monestri has joined ##java
[21:49:19] <mcastro> ernimril: Quickly we realized that if gmail was using gzip there was nothing to fear
[21:49:36] *** srm_ has joined ##java
[21:49:39] <mcastro> ernimril: I am talking 6 years ago
[21:49:41] <ernimril> AMcBain: the problem with oracles r-tree  (and most other r-trees as well) is that you need to provide some box-object (double[][] for oracle, a Box for many others). I let the user provide a MBRConverter that can give the bounds on a specific object instead. That means that I do not have to change the objects I store or keep the extra MBR
[21:50:11] <AMcBain> yeah
[21:51:35] <AMcBain> working on a bit of my website today so that I can more easily add stuff to my database for listing new projects and putting all the old ones back up.
[21:52:05] <AMcBain> I don't mind the cli, but entering all the projects at the database console via inserts is not my idea of fun.
[21:52:08] *** adaro has joined ##java
[21:52:25] *** srm has quit IRC
[21:52:25] *** srm_ is now known as srm
[21:56:19] *** Submarine has quit IRC
[21:56:23] *** jmarsman has joined ##java
[21:57:44] *** Incubuss has quit IRC
[21:57:49] *** keks_ has joined ##java
[21:58:04] *** gmunk has joined ##java
[21:58:30] *** EnginAy has quit IRC
[21:58:43] *** yolkaplexus has joined ##java
[21:59:17] *** rchern has quit IRC
[21:59:53] *** vitdo82 has quit IRC
[22:02:54] <flfuf> Hi. could someone give me a hand on how to retrieve input using the scanner, and automatically store it as an int, double, string, or whatever I want instead of being a java.util.scanner data type?
[22:03:18] *** km has quit IRC
[22:03:57] <_W_> flfuf, can you explain what you mean? Scanner does give you primitives and such
[22:04:02] <_W_> ~javadoc Scanner
[22:04:02] <javabot> _W_: http://is.gd/3iWx7 [JDK: java.util.Scanner]
[22:04:13] <Serendib> http://www.java-forums.org/java-tips/5518-using-scanner-class-read-int.html
[22:04:47] <_W_> nextInt for instance, produces an int primitive, not a java.util.scanner.Int (which doesn't exist) or anything else
[22:05:59] *** juan--d-_-b has quit IRC
[22:06:32] *** EnderMB has quit IRC
[22:08:08] <anders^> How come the g.drawRect() call before the sleep, and the System.out.println afterwards work, but not the g.drawX() after the sleep?
[22:08:17] <anders^> http://pastie.org/869474
[22:08:39] <anders^> i.e. only the first, last and sleep calls work
[22:08:44] *** srm has quit IRC
[22:08:53] *** Lone_Rifle has quit IRC
[22:08:57] <anders^> this is drawn to an ImageBuffer image
[22:10:35] *** notk0 has quit IRC
[22:10:50] <anders^> also any println statement inside the try block works too, but not any drawX statement
[22:11:09] <ernimril> anders^: provide a real test case
[22:11:44] <anders^> I'm not sure I understand what you mean
[22:11:52] <ernimril> ~test case
[22:11:52] <javabot> ernimril, sscce is a minimal independently runnable program, which demonstrates the problem; see http://www.pscode.org/sscce.html for details and a HOWTO
[22:12:02] <anders^> http://pastie.org/869479
[22:12:54] <anders^> oh wait, will i have to redraw the image each time?
[22:13:08] <ernimril> anders^: that code does not compile
[22:13:46] <anders^> DrawingMain is my own class, an extension of a JFrame with a BufferedImage attached to it.
[22:13:48] *** sphenxes has joined ##java
[22:13:53] <anders^> But I think I understand the problem now
[22:14:05] <anders^> Sorry, DrawFrame is my own class.
[22:14:28] <rawtaz> i am trying to test my application (web page + servlet) for file uploading. ive tested how the server reacts when the client goes away under transmission of a file, but i need to try what happens to the client when the server goes away.
[22:14:33] <ernimril> anders^: well, until you provide a real test case it is pretty hard to help you, but it looks like you do swing/java2d/awt outside the edt and then anything might happen
[22:15:05] *** enav has quit IRC
[22:15:15] <rawtaz> however, if in eclipse, at the very time that a file is being uploaded by the browser, i click "stop server" in the debug pane, to shutdown tomcat, it doesnt shut down until the file is finished transferring. is there a way to nicely force it to shutdown prematurely?
[22:15:35] <rawtaz> or do i have to go about killing the actual tomcat process manually to simulate such a thing?
[22:15:47] <anders^> ernimril: yes, I've gotten that answer before. I'll go and read up about working with the EDT instead of wasting other people's time
[22:15:57] <ernimril> ~edt
[22:15:57] *** Gambit- has left ##java
[22:15:57] <javabot> ernimril, edt is Event Dispatch Thread, the thread that drives the awt/swing gui. See http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html for a tutorial on Swing and threads, and note http://java.sun.com/developer/JDCTechTips/2005/tt0727.html#1
[22:17:14] *** zed_DX has quit IRC
[22:17:28] *** mreh has quit IRC
[22:18:06] *** magn3ts has joined ##java
[22:18:32] *** rburton- has quit IRC
[22:19:29] *** stylus has quit IRC
[22:22:35] *** sepult has quit IRC
[22:22:38] *** e1n85 has joined ##java
[22:23:54] *** ldam has quit IRC
[22:24:52] *** Razorigga has quit IRC
[22:25:07] *** nibbles has joined ##java
[22:26:41] *** CodeWar has joined ##java
[22:27:34] *** Theravadan has joined ##java
[22:27:55] *** sepult has joined ##java
[22:28:15] *** alkos333 has joined ##java
[22:28:53] *** Kedare has quit IRC
[22:28:56] *** dobau has joined ##java
[22:29:23] *** rchern has joined ##java
[22:30:47] *** Stericson has quit IRC
[22:31:57] *** [Justice] has quit IRC
[22:32:24] *** [Justice] has joined ##java
[22:34:08] *** Kedare has joined ##java
[22:34:43] *** Ilod has joined ##java
[22:35:10] *** exbio has quit IRC
[22:35:15] *** DraZoro has joined ##java
[22:35:21] *** DraZoro has left ##java
[22:35:30] *** kane77 has quit IRC
[22:35:31] *** vitdo82 has joined ##java
[22:35:57] *** flfuf has quit IRC
[22:36:16] *** ldam has joined ##java
[22:37:11] *** elbeardmorez has quit IRC
[22:37:25] *** tombee has quit IRC
[22:38:47] *** Rayne has left ##java
[22:38:49] *** yolkaplexus has quit IRC
[22:38:53] *** vitdo82 has quit IRC
[22:40:58] *** werdan7 has quit IRC
[22:45:28] *** Frostix has joined ##java
[22:46:13] *** zed_DX has joined ##java
[22:46:35] *** werdan7 has joined ##java
[22:48:11] *** Elench has joined ##java
[22:49:13] *** mcastro has quit IRC
[22:52:04] *** adaro_ has joined ##java
[22:52:53] *** Ilod has quit IRC
[22:54:05] *** adaro has quit IRC
[22:54:05] *** adaro_ is now known as adaro
[22:54:37] *** Cain` has joined ##java
[22:55:08] *** mcastro has joined ##java
[22:56:20] *** Cain has quit IRC
[22:56:20] *** Cain` is now known as Cain
[22:58:00] *** darrend has left ##java
[22:58:17] *** edi_99 has quit IRC
[23:00:18] *** sf11 has joined ##java
[23:00:27] *** jmarsman has quit IRC
[23:01:47] *** bindaas has quit IRC
[23:02:58] *** merp is now known as moi
[23:03:14] *** becks` has quit IRC
[23:06:08] *** Baldurgon has quit IRC
[23:08:27] *** jtheuer has joined ##java
[23:08:48] *** goki__ has quit IRC
[23:08:50] *** Matic`Makovec has joined ##java
[23:09:14] *** mcastro has quit IRC
[23:10:03] *** daedra has joined ##java
[23:10:27] *** Kedare has quit IRC
[23:11:31] *** Determinist has joined ##java
[23:12:38] *** styx_ has quit IRC
[23:12:43] *** mvfranz has quit IRC
[23:13:05] *** Niall has quit IRC
[23:13:14] <daedra> hey, this is more of a programming/architectural problem I have, but I will be solving it using Java. I have a class which creates map and has game logic (the Game), and another class which sends text commands to the Game (the Player). I wish to wrap the game into a server so that I can have many players (once I write the server) connecting to the game. How should I go about writting a server wrapper?
[23:13:29] *** Niall has joined ##java
[23:14:32] <daedra> I would ideally like it to go Game -> Server -> Clients, keeping the server simply as a message passer
[23:14:57] *** jtheuer has quit IRC
[23:14:58] <RLa> so you need to handle game logics at clients
[23:15:21] <daedra> well yeah the clients are just human players
[23:15:36] <daedra> they will enter text commands ot make stuff happen in the Game
[23:16:03] <RLa> i do not see where the problem is
[23:16:13] <daedra> I need to write the server wrapper
[23:16:21] <daedra> I'm just wondering if this idea is possible
[23:16:32] *** freeone3000 has joined ##java
[23:16:47] <daedra> currently there can be only one client and one server, and they are very tightly coupled
[23:17:16] <daedra> text gets passed between the two
[23:17:45] <daedra> but I wish to separate concerns - to extract the server just to do the message passing between the game and the players
[23:17:49] *** andy^ has quit IRC
[23:18:19] <daedra> anyone here had experience with this?
[23:18:41] <RLa> so you have three kind of parties? server, game, players?
[23:18:47] <daedra> yea
[23:18:49] <RLa> is there a single game?
[23:18:52] <daedra> yes
[23:19:03] <daedra> and a single server
[23:19:04] *** CodeWar has left ##java
[23:19:05] <RLa> but multiple players?
[23:19:09] <daedra> yes
[23:19:37] <RLa> so server handle game logics
[23:19:45] <RLa> not players
[23:19:49] <daedra> no the Game does
[23:19:59] <daedra> server does not exist yet
[23:20:01] <RLa> yes but it would be on server side
[23:20:06] <SEcki> but Game and Server run under the same jvm?
[23:20:06] <thepro4ever> is there a separate channel for java EE or is this the best we got
[23:20:20] <daedra> SEcki: yes
[23:20:41] <daedra> that is how it will be
[23:21:06] <daedra> provided I don't totally mess this up
[23:21:10] *** jonkri has quit IRC
[23:21:19] <SEcki> then write a parser part where you parse what the players enter and do error handling, after that pass certain java objects to the game
[23:21:24] <RLa> do you need server to notify players?
[23:21:55] <daedra> RLa: no, the game does that
[23:22:14] <SEcki> why not let the server handle all communication?
[23:22:16] <RLa> or can you use something like http with request-response cycle?
[23:22:35] <daedra> SEcki: because the game handles the game logic
[23:22:45] <daedra> the server should just pass messages
[23:22:48] <daedra> ideally
[23:23:09] <daedra> no http crap
[23:23:11] <RLa> pass from player to game or in opposite direction too?
[23:23:11] <daedra> just sockets
[23:23:14] <freeone3000> So you're putting trust in your clients. Interesting.
[23:23:14] <SEcki> no, you should have verification and error handling to the client there somewhere too
[23:23:19] <daedra> RLa: both directions
[23:23:30] <daedra> SEcki: well yes that is after I get this working
[23:23:35] <RLa> so http will not work
[23:23:45] <SEcki> and let the game just pass to your "server" side, ie the ones communicating with clients
[23:23:56] <daedra> RLa: I'm using sockets and on a  LAN
[23:24:02] <daedra> RLa: forget about http
[23:24:05] *** e1n85 has quit IRC
[23:24:15] <SEcki> RLa: he just uses Sockets and builds a protocol on hos own, no problem
[23:24:21] <RLa> good luck with inventing your own communication protocol
[23:24:27] <freeone3000> Not that hard.
[23:24:36] <daedra> the protocol is already written
[23:24:43] <freeone3000> Worst he comes up with is SOAP-RMI.
[23:24:48] <daedra> I'm just writing the server!
[23:24:54] <daedra> jebus
[23:25:14] <RLa> so just pass your text through sockets
[23:25:20] <RLa> i see no problems
[23:25:37] <RLa> you have to handle timeouts and such too, of course
[23:25:37] <daedra> the problem is, what architectural approach would be most suitable
[23:25:40] <SEcki> me neither
[23:25:43] <freeone3000> Architectural?
[23:26:04] <RLa> architecture is *client-server*
[23:26:19] <daedra> writing a server wrapper should ideally keep the server and the game separate
[23:26:31] <daedra> so the server just does message passing
[23:26:31] <SEcki> you do separation of concerns and message passing - what do you head for?
[23:26:42] <daedra> SEcki: I don't know..
[23:26:45] <daedra> MVC?
[23:26:45] <SEcki> and server-client, of yourse
[23:26:50] <daedra> yea of course
[23:27:03] <SEcki> is this a trick question?
[23:27:12] <daedra> no!
[23:27:18] <daedra> I am genuinely stuck here
[23:27:25] <freeone3000> Stuck *where*?
[23:27:35] <RLa> it's just a problem of implementing how to pass text around in sockets
[23:27:37] *** adaro has quit IRC
[23:27:47] <SEcki> yes, server does message parsing, the game doesn't do that - where is the problem?
[23:28:05] <daedra> where to put the server code
[23:28:14] <freeone3000> ..In the server.
[23:28:15] <daedra> I want to keep the game code relatively untouched
[23:28:21] <SEcki> Server.java <- in there!
[23:28:27] <daedra> haha
[23:28:39] <RLa> no
[23:28:56] <daedra> I don't want to put server code in Game.java...
[23:29:00] <RLa> depends whether you want thread by client or single thread server model
[23:29:11] <freeone3000> You're creating a new component.
[23:29:16] <daedra> clients are threads
[23:29:54] <RLa> so a client (on server) would read stuff from socket, obtain game instance and pass to it
[23:30:08] *** Johannes13 has quit IRC
[23:30:26] <RLa> or do you want game to be special class of client?
[23:30:41] <daedra> I agree with your first comment
[23:30:52] <daedra> but I don't know what you mean by special class
[23:31:10] <RLa> daedra, a possibility of having multiple games
[23:31:22] <daedra> no only one game please
[23:31:44] <daedra> 1 game per server
[23:31:46] <freeone3000> You have a Game. A Client. A Server. Done.
[23:32:02] <freeone3000> People keep having this adversion to creating more classes.
[23:32:08] <SEcki> you still separate the game stuff, from the connecting stuff from the parsing stuff as much as possible
[23:32:14] <RLa> do you need monitoring interface for server?
[23:32:38] <RLa> and maybe some kind of user moderation system?
[23:32:38] *** CodeWar has joined ##java
[23:32:45] *** magn3ts has quit IRC
[23:32:48] *** magn3ts has joined ##java
[23:32:54] <SEcki> RLa - do you want to sell something?
[23:33:00] <RLa> maybe
[23:33:38] <daedra> lol
[23:34:02] <daedra> right, I've got some ideas ot think about now
[23:34:35] *** alkos333 has quit IRC
[23:34:56] <SEcki> this was much do about nothing I guess
[23:35:22] <daedra> a nice chit chat
[23:37:16] *** EoN has quit IRC
[23:38:38] <freeone3000> Okay, with synth, I have http://pastebin.com/3fQJBSee . When I mouse over the component multiple times, the alpha-transparency doesn't stick - it becomes more and more opaque. How do I keep the opacity to that what I set?
[23:39:39] *** skoskav has quit IRC
[23:40:42] *** RLa has quit IRC
[23:41:34] *** sam_ has quit IRC
[23:42:15] *** samferry has joined ##java
[23:44:03] *** Mavrik- has quit IRC
[23:45:21] *** BfrOv3rfl0w has quit IRC
[23:45:43] *** gigasoft has quit IRC
[23:48:45] *** Frostix has quit IRC
[23:50:46] *** pastyhermit has joined ##java
[23:51:37] *** trsh has quit IRC
[23:51:52] *** pastyhermit has quit IRC
[23:53:00] *** Teknoenie has quit IRC
[23:53:17] *** Niall has quit IRC
[23:53:39] *** Niall has joined ##java
[23:55:20] *** pastyhermit has joined ##java
[23:55:25] <pastyhermit> Hey all
[23:56:17] <pastyhermit> I did not know xchat could do themes, they are quite nice I must say
[23:56:26] *** daedra has left ##java
[23:59:36] *** wh1t3 has quit IRC

top