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


NOTICE: This channel is no longer actively logged.

Toggle Join/Part | bottom
[00:00:07] <cheeser> well, the object it can't create
[00:00:11] <eidolon> ah
[00:00:12] <eidolon> sec.
[00:00:15] <cheeser> yeah. WebActions
[00:00:24] <eidolon> webactions is nightmarish
[00:00:30] <eidolon> i should do this in a smaller class.
[00:00:56] <cheeser> it's too late for apologies. P^)=
[00:01:01] <eidolon> (webactions is an example of everything wrong in in web development with java. it's a single java action class that handles -every single- form request in the public interface.
[00:01:08] <eidolon> i shoul dnever have written it
[00:01:20] <eidolon> yeah i know
[00:01:20] <eidolon> fine
[00:01:22] * eidolon pastes
[00:01:55] <eidolon> http://pastebin.stonekeep.com/11590
[00:01:58] * eidolon embarrasses
[00:03:01] * cheeser stares at eidolon
[00:03:25] <eidolon> toldja man. of all the congo code, this is probably the saddest.
[00:03:26] <cheeser> arg 11 is AddressDAO
[00:03:30] <eidolon> !
[00:03:32] <eidolon> no
[00:03:39] <eidolon> really?
[00:03:41] * eidolon checks
[00:04:33] <cheeser> unless spring 0 indexes its count
[00:04:44] <eidolon> no, that's not it
[00:04:56] <eidolon> the counts match
[00:04:59] <eidolon> where are you getting 11?
[00:05:02] <cheeser> but that context xml def doesn't seem to match the code
[00:05:26] <cheeser> only 5 in the xml to that methods 12.
[00:05:30] <cheeser> 12! P^)=
[00:05:55] <eidolon> the applicationcontext.xml has 12 also.
[00:05:57] <Bombstone> Somelauw, then you need Formatter
[00:06:13] <Terabyte> I've made a call to a swing worker execute() which has as expected gone and executed the dobackgroundTask method while the calling thread has gone off and done something else. The second time around, on execute, no error is thrown, the calling thread continues, but no execution occurs, debugging shows that it doesn't hit the doBackground task......
[00:06:14] <Bombstone> ~~Somelauw javadoc java.util.Formatter
[00:06:15] <javabot> Somelauw: http://is.gd/iN8ez [JDK: java.util.Formatter]
[00:06:22] <eidolon> OH!!!
[00:06:24] <eidolon> i'm sorry cheeser
[00:06:33] <eidolon> i shortened the applciationcontext.xml file when i pasted it to the forum
[00:06:39] <cheeser> Terabyte: that will only affect the String conversion. not the actual float.
[00:06:39] <eidolon> here'st he actual one from applicationcontext.xml
[00:07:19] <eidolon> here'st he full applicationcontext.xml: http://pastebin.stonekeep.com/11591
[00:07:29] *** rvsjoen has joined ##java
[00:07:40] <Terabyte> cheeser Bombstone*?
[00:07:54] <rvsjoen> is there any way to modify a variable in the outer class from within an inner class, as the outside var needs to be declared final
[00:07:59] <rvsjoen> are there ways around this ?
[00:08:13] <cheeser> rvsjoen: use a mutable object
[00:08:21] <cheeser> only the reference is final
[00:08:36] <Terabyte> ..... http://codepad.org/ACPtbgo5 on line 4 the first time round, addIfUnderCorePoolSize(..) is called and returns true, the method exits (having started the thread as part of the addIfUnderCorePoolSize). The second time round, addIfUnderCorePoolSize is skipped, and so the thread start call isn't hit. No idea why the test is skipped, short circuit? but surely || isn't a short circuit operator...
[00:08:47] <cheeser> eidolon: i'll have to try later. i've been promising my youngest i'd play with her in "just a minute" for some time now.
[00:09:02] <eidolon> okay. should i come back at a particular time? 9pm? ish?
[00:09:13] <cheeser> hard to say tonight...
[00:09:40] <eidolon> okee. look for me aorund / msg it or the like
[00:09:43] <eidolon> thanks.
[00:09:48] *** Maggi has left ##java
[00:10:23] *** mxweas has quit IRC
[00:10:27] <Bombstone> Terabyte, no idea. sorry.
[00:10:43] <Terabyte> Bombstone i was saying to cheeser did he mean Bombstone
[00:10:46] <Terabyte> :P
[00:11:13] <rvsjoen> what, like a final Integer a = new Integer(); instead of a final int a; ?
[00:13:11] <Terabyte> ok on inspection on line 4. this is because poolSize >= corePoolSize and || is acting as a shortcircuit...
[00:13:23] *** Cobi has quit IRC
[00:14:16] *** jjido has joined ##java
[00:14:34] *** gelignite has joined ##java
[00:15:14] <Terabyte> still no idea what the solution is or even if the old thread is still running
[00:15:24] * Terabyte rumages around netbeans for a way to track thread lifetimes
[00:16:52] <Bombstone> cheeser, yes it doesn't modify the float, but Somelauw, i guess, just wanted to print the new value and not any conversion.
[00:17:30] *** Nikelandjelo has quit IRC
[00:18:51] <Somelauw> Oh just printing it is fine./
[00:19:48] <Somelauw> I only want it as a string so i can print it.
[00:20:11] *** bitshuffler_ has quit IRC
[00:20:19] *** barq has quit IRC
[00:20:52] *** jjido has quit IRC
[00:23:20] *** taxon has joined ##java
[00:23:26] *** jjido has joined ##java
[00:24:33] *** Fanook has quit IRC
[00:26:16] *** GreYFoXGTi has quit IRC
[00:26:38] *** GreYFoXGTi has joined ##java
[00:27:21] *** taxon has quit IRC
[00:27:52] *** jjido has quit IRC
[00:28:01] <Cher> Does someone have a link to an IntelliJ IDEA community edition version that does not refuse to run with JDK7?
[00:28:06] *** taxon has joined ##java
[00:29:11] *** Fanook has joined ##java
[00:29:55] *** maxorator has quit IRC
[00:30:51] <cheeser> eidolon: hrm. i'm not sure what to tell you other than try using an interface there for FriendDAO
[00:31:08] <cheeser> Cher: you need to the 10.5 they announced a few weeks back
[00:31:15] *** jjido has joined ##java
[00:31:57] <eidolon> cheeser - i'm actually not 100% sure what steps to take to do that.
[00:32:03] *** Cobi has joined ##java
[00:33:03] <Terabyte> I get the same behaviour if I submit it to an ExecutorService :(
[00:33:30] *** FrozenKnight has quit IRC
[00:34:28] *** jjido has quit IRC
[00:35:43] *** GreYFoXGTi has quit IRC
[00:37:23] *** werdan7 has quit IRC
[00:38:42] *** VonNaturAustreVe has joined ##java
[00:38:52] *** jjido has joined ##java
[00:39:27] <Terabyte> ok to solve my problem i switched from the swing abstraction to the Runnable type. which is oddly enough what lies underneath.. but hey, it works...
[00:39:31] *** Cobi has quit IRC
[00:39:33] *** EvilPenguin has quit IRC
[00:40:26] *** electronplusplus has joined ##java
[00:40:30] <electronplusplus> hi folks
[00:40:49] <electronplusplus> last week I googled some information about Java GUI
[00:41:07] <electronplusplus> and i found a GUI library related to apache
[00:41:16] <electronplusplus> does somebody knows the name?
[00:41:22] <Terabyte> ok sod that it doesn't work, it just takes longer to break
[00:41:35] <electronplusplus> i think it was pigeon or something similar
[00:41:40] <Terabyte> if I send something to an execute service, do I have to kill it?
[00:41:54] <Terabyte> or when it's done with it's run method, does it kill itself
[00:42:28] <pr3d4t0r> cheeser: Yo'.
[00:42:40] <pr3d4t0r> cheeser: Is JQueryJavabot a relative of our 'bot, or something else?
[00:43:47] *** Fanook has quit IRC
[00:44:12] *** mescalinum has quit IRC
[00:44:44] *** werdan7 has joined ##java
[00:45:32] *** servo has quit IRC
[00:45:34] <Planck_> Terabyte: what is it? In what way does it break?
[00:45:49] <Terabyte> sec, i havn't converted all of them from swingworkers to runnables.
[00:46:25] <Terabyte> Planck_ though if you're interested the swingworker object doesn't do it's "doInBackgroundTask" executed, even though the caller calls execute and returns
[00:46:57] <Terabyte> no worries, it's all gone now :)
[00:47:07] *** dmlloyd has quit IRC
[00:47:10] <Planck_> I've never had a problem with SwingWorker of that sort
[00:47:20] *** mxweas has joined ##java
[00:47:26] *** gelignite has quit IRC
[00:47:28] <Terabyte> swingworker is obviously either broken (as google throws up rumours) or has subtleties that make the term "doInBackground" an inappropriate term.
[00:47:35] <Terabyte> hmm
[00:47:51] *** Skyec has quit IRC
[00:47:53] *** McMAGIC-- has quit IRC
[00:47:58] <Planck_> Are you trying to run multiple actions on the same SwingWorker?
[00:48:00] *** Prezioso has quit IRC
[00:48:26] *** Ruudjah has quit IRC
[00:48:28] <Terabyte> i'm trying to run the same swingworker twice, (the first instance should have had time to finish, but even if it didn't it shouldn't matter)
[00:48:40] <Terabyte> http://codepad.org/ACPtbgo5 the difference in executions paths is here
[00:48:48] <Planck_> From the javadoc: "SwingWorker is only designed to be executed once. Executing a SwingWorker more than once will not result in invoking the doInBackground method twice"
[00:48:49] *** Matic`Makovec has joined ##java
[00:49:05] <Terabyte> a sucessful executions requires the first test of line 4 to not short circuit the addIfUnderCorePoolSize which contains the thread start call.
[00:49:12] <Terabyte> oh right
[00:49:21] <Terabyte> i could have sw...
[00:49:25] *** Cobi has joined ##java
[00:49:34] <Terabyte> OHHHH, when i first tested it, it was a local scope Worker :D
[00:49:47] <Terabyte> after that I kept the same worker and used it twice, but i never tested that till much later.
[00:49:52] <Terabyte> that explains everything.
[00:50:00] <_W_> happy to help ;)
[00:50:16] * _W_ is always happy to be a rubber duck
[00:50:28] <Terabyte> squeek squeek
[00:50:39] *** jesmon has joined ##java
[00:51:07] <Terabyte> ah well that also explains why my runnable works :D
[00:51:20] *** barq has joined ##java
[00:51:38] *** McMAGIC-- has joined ##java
[00:53:25] <Planck_> Executor is designed to accept many tasks - but has no relation to the EDT, so doesn't have the built-in methods for UI updates
[00:53:37] <Terabyte> ah
[00:54:01] <Terabyte> there's no UI here, just a plain old console. i just liked the fact that i could ask for a job to be done.
[00:54:09] <Terabyte> but as it turns out executor service isn't that hard :)
[00:54:51] *** Cobi has quit IRC
[00:55:25] <Planck_> Heh yes, I found it a bit scary to consider for the first time with all those Future objcts and whatnot. Easier than it looks though :)
[00:55:39] *** jjido has quit IRC
[00:56:04] *** electronplusplus has quit IRC
[00:56:39] *** swordi has joined ##java
[00:57:29] *** fisted_ has joined ##java
[00:57:32] *** echo_mirage has quit IRC
[00:58:43] *** Cobi has joined ##java
[01:00:06] *** fisted has quit IRC
[01:00:18] *** vuln has joined ##java
[01:01:07] *** werdan7 has quit IRC
[01:03:49] *** barq has quit IRC
[01:04:21] *** ramenmeal_ has joined ##java
[01:05:14] *** jjido has joined ##java
[01:05:22] *** ramenmeal has quit IRC
[01:05:22] *** ramenmeal_ is now known as ramenmeal
[01:07:49] *** ramenmeal has quit IRC
[01:08:23] *** dmiles_afk has quit IRC
[01:10:07] *** servo has joined ##java
[01:10:43] *** jaska^ has quit IRC
[01:11:32] *** okiwan has quit IRC
[01:15:53] *** McMAGIC-- has quit IRC
[01:16:10] *** Matic`Makovec has quit IRC
[01:17:16] *** cbeust has joined ##java
[01:17:27] *** rvsjoen has left ##java
[01:18:38] *** Droxx has quit IRC
[01:21:26] *** McMAGIC-- has joined ##java
[01:21:57] <Cher> cheeser: Thanks :)
[01:28:24] *** rjohnson19 has quit IRC
[01:28:26] *** Somelauw has quit IRC
[01:29:11] *** dextro_ has joined ##java
[01:29:54] <dextro_> (mysql connector) can you insert a dynmaic number of rows with 1 query?
[01:35:21] *** LouisJB has quit IRC
[01:37:45] *** Guyman has quit IRC
[01:38:44] <cheeser> dextro_: you can batch inserts
[01:38:58] <eidolon> cheeser: i thought you were with your daughter? :)
[01:39:13] <cheeser> pr3d4t0r: i've never heard of JQueryJavabot. where'd you see it?
[01:39:30] <cheeser> ~seen JQueryJavabot
[01:39:30] <javabot> cheeser, I have no information about "JQueryJavabot"
[01:42:43] *** CodeWar has joined ##java
[01:43:51] *** jjido has quit IRC
[01:43:59] *** swordi has quit IRC
[01:44:22] *** jjido has joined ##java
[01:46:20] *** Gatto has quit IRC
[01:46:23] *** Abhi347 has quit IRC
[01:52:09] *** sphenxes has quit IRC
[01:55:23] *** Versuchen has quit IRC
[01:57:45] <dextro_> what you mean cheeser?
[01:58:46] *** DJClean has quit IRC
[01:58:48] <pr3d4t0r> cheeser: It's a Tweeter bot. It rewtweets some #Java postings I made. Just curious.
[02:00:16] *** pipeep has joined ##java
[02:00:58] *** jdolan has quit IRC
[02:03:16] *** looopy has joined ##java
[02:03:18] *** matsebc has quit IRC
[02:04:15] *** eidolon has quit IRC
[02:04:58] *** Droxx has joined ##java
[02:04:59] *** arborist has quit IRC
[02:07:37] *** matsebc has joined ##java
[02:11:12] *** neoneurone has quit IRC
[02:11:16] *** Fuco has quit IRC
[02:12:16] *** angusyoung has joined ##java
[02:17:46] *** riotz has quit IRC
[02:22:52] *** plarsen has joined ##java
[02:25:21] *** kalio has left ##java
[02:25:23] *** Droxx has quit IRC
[02:26:19] *** realtime has quit IRC
[02:26:47] *** paissad has quit IRC
[02:27:36] *** magn3ts has quit IRC
[02:29:20] *** BSWolf has quit IRC
[02:30:35] *** guidj0s has joined ##java
[02:30:46] *** phantomcircuit has quit IRC
[02:31:10] *** PigFlu has quit IRC
[02:31:17] <Terabyte> if a Runnable throws an exception, does it hang around? I resubmitted the same job to an executor service after it previous threw an exception and I got the same exception twice. I submitted it a third time, and it responded with three copies of the same exception... I just wonder if the previous runnables are still lingering...
[02:31:27] <Terabyte> (did this up to 8 times)
[02:32:44] *** magn3ts has joined ##java
[02:32:45] <freeone3000> Terabyte: Nope.
[02:32:46] *** paissad has joined ##java
[02:32:55] <Terabyte> hmm, must be something else then. thanks :)
[02:33:05] <freeone3000> Since it's an unchecked exception, the thing that's wrong with the code the first time is probably still wrong the second time.
[02:33:16] *** BSWolf has joined ##java
[02:33:37] <Terabyte> yeah, but it should throw the exception once. not n times my try
[02:33:58] *** jjido has quit IRC
[02:34:17] <Terabyte> (it's one call to a database with a duplicate index insert attempt which returns with the error n times depending on how many times i've tried it, so the 5th time i attempt, it throws back 5 intsances of the exception)
[02:35:16] <Terabyte> http://codepad.org/R2I4G2KB if you're curious
[02:37:54] *** BSWolf has quit IRC
[02:38:54] *** CodeWar has quit IRC
[02:40:44] *** _bugz_ has quit IRC
[02:41:35] <Terabyte> tits, it might be my own logic, me not resetting an member arraylist (not local method scope) after usage.
[02:42:06] <Terabyte> using threads extensively for the first time, every time something goes wrong "IT'S THE THREADS. THEY'RE EVIL"
[02:43:18] <Terabyte> it *is* my logic. thanks anyway
[02:44:41] *** [[thufir]] has quit IRC
[02:47:45] *** bearded_oneder has joined ##java
[02:49:24] *** looopy has quit IRC
[02:49:29] *** Fanook has joined ##java
[02:57:28] *** DormantOden has quit IRC
[02:59:05] *** DerHorst has joined ##java
[03:00:01] <Planck_> I try to assume that every Thread is out to get me by executing at the worst possible time with respect to race conditions, deadlocks, and other nasties.
[03:00:25] *** BSWolf has joined ##java
[03:01:21] <Planck_> I've been doing multithreaded applications for quite a few years now, and I still suck at it. (And yes, I have JCIP and have read through it a few times)
[03:02:52] <Fanook> i'm convinced our brains simply aren't wired to let us conciously think in a parallel fashion
[03:03:39] *** [switch] has quit IRC
[03:03:58] <Fanook> at least, not without non-trivial effort
[03:04:05] *** [switch] has joined ##java
[03:04:42] <Planck_> I don't think it helps that the threading model is unsafe by default, and you have to consciously organize things to make it safe.
[03:04:51] <Planck_> But I don't know a better way
[03:05:14] <Fanook> immutability helps a lot
[03:06:10] <freeone3000> I think the main issue is testing - race conditions aren't always obvious.
[03:07:43] *** eidolon has joined ##java
[03:07:59] <Planck_> A few times I've ended up with multiple EDT-like structures, but passing tasks between them looks pertty disgusting in code.
[03:08:33] <Planck_> EDT-like in that the structure should only be accessed from a specific designated thread that starts when the structure is initialized.
[03:11:41] *** hex` has quit IRC
[03:12:02] <Terabyte> heh
[03:12:21] <Terabyte> testing, or better modelling
[03:12:25] <Terabyte> (ltsa etc)
[03:13:31] <Fanook> for a while I pondered the possibility of a tool that systematically forced context switches to test for race conditions, but my brain started hurting so I stopped
[03:14:06] <cbeust> Fanook: TestNG gives you some simple, albeit primitive, way to test for that: @Test(invocationCount = 1000, threadPoolSize = 20, timeOut = 5000)
[03:14:20] <Fanook> interesting
[03:14:21] <Terabyte> if two threads request input from the user (command line app), where does my input go?
[03:14:44] *** Wyzard has quit IRC
[03:14:46] <Planck_> Either or both divided
[03:14:51] <Terabyte> wow
[03:15:10] <Planck_> ie. Don't do that.
[03:15:18] <Terabyte> what's the best way to control it?
[03:15:59] <Terabyte> i've got a menu system which takes inputs as to what to do, at the end of the menu is a task node which actually does something when you provide input, but in theory a task node could itself need input, and the menu system is still listening (since it's there for control of the task).
[03:16:22] <Fanook> shouldn't your test be inherently supplying those inputs ?
[03:16:39] <Fanook> s/inherently/responsible for
[03:17:02] *** [switch] has left ##java
[03:17:21] <Terabyte> me or cbeust?
[03:17:30] <Fanook> you
[03:17:47] <Terabyte> oh, it's not a test harness, it's a menu system the user controls to interact. (in the absence of a GUI)
[03:18:28] <Terabyte> oh sorry, you mean task yeah, no perhaps, i'm unsure of where the responsibility should lie.
[03:19:13] <Fanook> it sounds like you might be moving ui code into your model
[03:19:15] <Terabyte> the task could get it from a config, but that makes it a pain for the user, and it is meant to be all operatable from the commandline without opening config files. so i guess the menu system should have an option to set it.... and the task should never ask anything...
[03:19:29] <Terabyte> ya
[03:19:37] <Fanook> or the task asks through the menu system
[03:19:46] <Terabyte> i'll keep the ui stuff in the menu system, so a menu is responsible for setting all information that a task does.
[03:20:14] <Terabyte> never though of the menu for configuration, only control of tasks, but i guess configuration is a form of controlling aspects of the tasks so ya that makes sense
[03:22:07] *** frivol has quit IRC
[03:22:27] *** flippo has quit IRC
[03:23:20] <Planck_> I'm rather leery of using Socket from multiple threads. It seems common practice, but the API docs say virtually nothing about thread safety
[03:24:30] *** teralaser has quit IRC
[03:25:23] *** [switch] has joined ##java
[03:25:41] *** noisewaterphd has joined ##java
[03:25:53] *** [switch] has joined ##java
[03:26:52] <freeone3000> It's the same as reading from any other buffered stream from multiple threads. It's exactly as thread-safe as the buffer.
[03:27:22] *** L-----D has joined ##java
[03:30:00] *** odinsbane has quit IRC
[03:30:56] *** zemanel has quit IRC
[03:31:16] *** servo has quit IRC
[03:31:31] *** cbeust has quit IRC
[03:32:02] *** cbeust has joined ##java
[03:32:40] *** zemanel has joined ##java
[03:40:22] *** caverdude has joined ##java
[03:45:25] *** DerHorst has quit IRC
[03:45:51] *** Sliker has quit IRC
[03:46:24] *** vengeancex32 has quit IRC
[03:48:26] *** xiliax has quit IRC
[03:51:45] *** BSWolf has quit IRC
[03:52:20] *** guidj0s has quit IRC
[03:52:28] *** BSWolf has joined ##java
[03:59:01] *** noisewaterphd has quit IRC
[04:01:56] *** Clete2 has joined ##java
[04:02:27] <dextro_> Java have a duration function?
[04:02:39] <cheeser> a what now?
[04:03:14] <dextro_> something to convert 100000 seconds to "1day 3hrs 46mins 40secs"
[04:03:26] <ojacobson> Sure, infinitely many of them
[04:03:35] <ojacobson> None of them are in the standard library, though - use joda
[04:05:46] <surial> ~~ dextro_ jodatime
[04:05:46] <javabot> dextro_, jodatime is an excellent date/time implementation for Java, particularly useful if you need to do time arithmetic and work with time intervals. Open source. Available at http://joda-time.sourceforge.net/ - it is also the basis for the new date/time system that'll be in java 8. See: https://jsr-310.dev.java.net/
[04:05:46] <surial> Use that.
[04:06:43] *** RogueShadow has quit IRC
[04:10:24] *** python_user has joined ##java
[04:11:02] <python_user> hi
[04:12:25] <python_user> I'm trying to implement a linked list that represents a transition network
[04:12:48] <python_user> at the moment I have a very simple linear linked list that contains five nodes
[04:13:06] <python_user> how can I enhance it so that one node can point to multiple nodes?
[04:13:40] <cbeust> python_user: replace the pointer to the next node by a list of pointers to other nodes? Then it's beginning to look like a tree, btw
[04:14:20] <python_user> I've done this by having a class Node that has the constructor public Node( Object theElement, Object theData, Object theData2, ListNode n )
[04:14:35] <python_user> cbesut, yeah I think that's what I've done in the above
[04:14:50] <python_user> please excuse me if I've pasted two much code above
[04:15:05] <cbeust> In such a case, the pointer is no longer a "next node" and more like "children"
[04:16:04] <python_user> cbeust, right ok. So would I need like an array?
[04:16:20] <cbeust> python_user: Avoid arrays, a list is better
[04:17:18] <cbeust> But I think you'll save yourself some headache if you just look up how to implement a graph
[04:17:24] <cbeust> might as well not reinvent the wheel
[04:18:18] <python_user> haha ok
[04:18:36] <python_user> is there a dedicated class in the Java API that does that?
[04:18:43] <python_user> ~pastebin
[04:18:44] <javabot> http://paste.pocoo.org/ - Paste the final url after you've pasted your stuff there.
[04:19:05] <python_user> I'm sorry if that was a very noobish thing to do! :p
[04:19:28] <cbeust> python_user: Interestingly, I'm not aware of a standard tree/graph class
[04:20:03] <python_user> cbeust, right ok. Would you mind looking at the code I've written?
[04:20:16] <Fanook> there isn't one. you could probably leverage something in JGraph though
[04:20:29] <python_user> Fanook, ok thanks. I'll check that out
[04:21:04] <python_user> essentially, what I'm trying to do is to implement a monitor
[04:21:33] <python_user> so the monitor checks the messages stored in array, and if they match with the messages in the node, it transitions the list to the next node
[04:21:43] <python_user> very simple really, but having trouble with it
[04:22:02] <cbeust> python_user: Look up "finite state machine", I believe that's what you're trying to buil.
[04:22:04] <cbeust> d
[04:22:04] *** werdan7 has joined ##java
[04:23:03] *** angusyoung has quit IRC
[04:23:22] <python_user> cbeust, ok great. Thank you
[04:24:10] *** Matuku has quit IRC
[04:29:50] <surial> Hmm, you know, some of my build automation tools would be a little more convenient if there's a pure java library out there somewhere that can do what gpg -ab does.
[04:30:21] <surial> (i.e. create an uuencoded detached signature of some input bytestream based on some DH public key that's given as second input).
[04:30:32] <surial> I'm finding a few bajillion wrappers that just farm out the work to gpg.
[04:30:43] <surial> In fact, an all-java GPG would be even better.
[04:30:52] <eidolon> iirc gpg is either very difficult to or not allowed to be compiled into other programs.
[04:31:07] <surial> Well, the algorithms used are surely open.
[04:31:14] <surial> I doubt they have a patent on RSA or DH.
[04:31:16] <eidolon> I SEE A GREAT NEED
[04:31:26] <surial> Yeah, I'm half tempted to start up a project to recreate it.
[04:31:55] <freeone3000> PGP's obviously open. GPG's an implementation; heck, it's even GPL.
[04:31:57] <surial> Besides, doesn't javax.crypto or bouncycastle implement just about every algorithm used by gpg? That would mean all that you really need to reproduce is its particular ascii-armouring format and command names.
[04:32:04] <surial> freeone3000: That's what I thought.
[04:32:35] <surial> Hell, some algorithmic C code is usually portable to java by copy/pasting the whole thing and changing nothing of note other than perhaps ensuring that all numeric types are sigint32 or sigint64.
[04:32:40] <eidolon> surial: http://www.bouncycastle.org/ ?
[04:32:55] <surial> Yes, that bouncycastle.
[04:33:14] <surial> Can it trivially emit the exact same (or at least compatible enough for oss.sonatype.org to accept it) output as gpg -ab?
[04:33:16] <eidolon> oops, sorry
[04:33:21] <eidolon> i didn't see you had said it already.
[04:33:34] <surial> Maybe. I see a comment about OpenPGP in there.
[04:33:35] <freeone3000> It doesn't do the armoring.
[04:33:55] <surial> Am I missing something or does maven itself not actually include any of this code? The docs I can find about mvn itself suggest it'll be calling gpg to do it.
[04:34:03] <surial> (This is all based on oss.sonatype.org's requirement that all artifacts are signed).
[04:34:13] <eidolon> further chattering seems to show that bouncycastle has a full openpgp implementation
[04:34:42] <freeone3000> surial: Maven contains very little code. It's probably been plugin'ified.
[04:35:06] <surial> Right now I upload a package to my own server via scp (automated in an ant build), then ssh in (again, automated) to run a script server-side which applies gpg to all artifacts and then uploads the whole thing to nexus. The only manual step is promoting it. Would be cooler if I could do all of this client-side, I guess, but in order to make sure the project builds on any machine provided you have java, ant, and git installed, I wouldn't wan
[04:35:06] <surial> rely on gpg.
[04:35:23] <surial> eidolon: Going to delve into bc's javadoc to see if it'll suffice.
[04:35:52] <eidolon> good luck. the drive for having it on android is likely pretty high
[04:36:09] <eidolon> also? eve's downloader is irritating me. check out the time estimate: https://skitch.com/dbelfershevett/rwpk9/downloads
[04:36:47] <cbeust> surial: I would love to see something like this, I'm tired of having to install gpg everywhere
[04:37:41] <surial> So, what would be best, here? A wrapper which (A) reproduces gpg's command line features pretty much command-for-command, and (B) a wrapper API for bouncycastle that uses the exact same names as gpg's commands, including its particular vagaries on output?
[04:37:51] <paissad> when using log4j, it is possible to set the log level programmatically, http://robertmaldon.blogspot.com/2007/09/programmatically-configuring-log4j-and.html
[04:37:57] <surial> AFAIK bouncycastle should run on android, though it might not be very fast.
[04:38:03] <paissad> is this kind of work possible with slf4j ?
[04:38:04] <surial> paissad: Congratulations, man.
[04:38:18] <mrapple> is there any memory leaking i would need to worry about with constant socket connections opening and closing?
[04:38:29] <surial> paissad: That's the point of SLF4J.
[04:38:34] <freeone3000> mrapple: Java doesn't do that whole "memory leak" thing.
[04:38:35] <surial> mrapple: no.
[04:38:42] <Planck_> mrapple: So long as you actually do close them, no
[04:38:43] <mrapple> oh really?
[04:38:53] <mrapple> good to know
[04:39:06] <Planck_> If you leave them lying around open you can run out of various resources (probably not memory first).
[04:39:10] <paissad> surial, but not only the log level, (the appender, layout ..) as shown in the link above
[04:39:10] <mrapple> i guess its just my mind playing tricks on me that the memory usage is higher when i have the socket thing
[04:39:19] *** eidolon has quit IRC
[04:39:25] <surial> paissad: .... again, that's the point of SLF4J.
[04:39:31] <freeone3000> mrapple: How're you monitoring it?
[04:39:44] <mrapple> monitoring what...
[04:39:49] <freeone3000> Memory usage.
[04:39:50] <surial> paissad: SLF4J is a meta logging framework. It lets you log into whatever actual log framework you want. This is useful because life sucks if you use 5 libraries, and each library uses a different logging framework.
[04:39:51] <mrapple> top
[04:40:10] <surial> paissad: Thus you're asking the wrong questions. SLF4J is *NOT* a logging framework like log4j. You configure SLF4J to send its logs to log4j and then configure log4j to do whatever you want.
[04:40:30] <freeone3000> mrapple: Okay. Java's reported memory usage is much higher than its actual memory usage because your operating system counts all shared libraries used in a process as part of that process, even if they were already loaded by another process.
[04:40:37] *** dextro_ has quit IRC
[04:40:44] <mrapple> oh
[04:40:48] <mrapple> good to know
[04:41:00] <Planck_> mrapple: Also, Java tends to not bother to reclaim memory if it hasn't run out.
[04:41:22] <Planck_> By "run out" I mean reached its configured heap size
[04:41:52] <paissad> surial, thus, there's no way to configure the appenders & layout from slf4j ... ^^... apart from creating the log4j.properties file
[04:42:47] <surial> paissad: ... um.. what?
[04:42:57] *** dmlloyd has joined ##java
[04:42:58] <surial> paissad: You're saying: There's no way to do X, except via Y. So, there's a way to do X.
[04:43:05] <surial> In fact, that's the way to do X.
[04:43:37] *** devkhadka has joined ##java
[04:45:34] *** taxon|afk has joined ##java
[04:45:36] <paissad> surial, actually what i want to do is:
[04:45:37] <paissad> instead of creating a log4j.properties files for the use of (slf4j + log4j) ... i don't want to have that log4j.properties file, ... i want to be able to set the Logger (its appender, its layout, its log level) via some options (arguments passed to the program)
[04:46:18] <paissad> The logger would be created/set "programmatically"
[04:46:43] <paissad> not with an already configured file (log4j.properties)
[04:47:02] *** BSWolf has quit IRC
[04:47:35] <python_user> does anyone know how I can access this channel and IRC in general using SSH tunnelling?
[04:48:00] <python_user> it's just that I'm behind a connection (not currently) that blocks port 6667
[04:49:02] *** taxon has quit IRC
[04:50:20] <tjsnell> tunnel to a server that doesn't
[04:50:50] <tjsnell> ssh -D 1080 myhost.com
[04:53:29] *** BSWolf has joined ##java
[04:53:45] <surial> tjsnell: Right, -D for the full sock5 treatment, and then use winsocks or mac's out-of-the-box system-wide proxy settings etc, or, if you can't get that to work, redirect port 6667 specifically, like so: ssh -L6667:nameOfIRCServer.com:6667 myhost.com
[04:53:48] <surial> er...
[04:53:54] <surial> python_user: Right, -D for the full sock5 treatment, and then use winsocks or mac's out-of-the-box system-wide proxy settings etc, or, if you can't get that to work, redirect port 6667 specifically, like so: ssh -L6667:nameOfIRCServer.com:6667 myhost.com
[04:54:16] <surial> python_user: That last command will open a connection to nameOfIRCServer.com:6667 on myhost.com and then tunnel this connection to your own machine. You then point your IRC client at localhost:6667.
[04:54:16] <tjsnell> I just then run proxifier but didn't assume he was mac :)
[04:55:02] <surial> python_user: Or rather, if you connect to localhost:6667, you're actually connecting to your own SSH client which will then tunnel the request to myhost.com, tell it to open a TCP connection to nOIS:6667 and complete the tunnel.
[04:55:05] <python_user> surial, thank you so much. Will try that out :)
[04:55:14] <tjsnell> ~surial++
[04:55:15] <javabot> surial has a karma level of 161, tjsnell
[04:55:40] <surial> python_user: Good luck. Good knowledge of -L, -R, and -D commands of ssh plus having a server available (an AWS micro instance is dirt cheap these days, too) means if you have SSH you can get anywhere else.
[04:56:28] *** Dragonai has joined ##java
[04:56:30] <python_user> surial, ok haha. I'm gonna try and read a lot more about this so that I'll hopefully have a better understanding of what you're saying! :p Any books or websites you recommend?
[04:56:59] <surial> I doubt there are books, I just explained just about all there is to know about -L. -R is mostly similar. -D is even simpler.
[04:57:06] <surial> That'd make for one tiny tiny book.
[04:57:12] <surial> python_user: So, uh, ssh's man page?
[04:57:31] * surial has time to spare to discuss things. He just fired up maven and is currently busy downloading the internet.
[04:57:36] <python_user> surial, thank you again
[04:57:40] *** BSWolf has quit IRC
[04:58:06] <surial> maven whiners who want lombok to be in maven central need not whine any longer.
[04:58:39] *** looopy has joined ##java
[04:59:02] <tjsnell> haha
[04:59:16] <tjsnell> correction, now find new things to whine about
[04:59:25] <surial> Probably that lombok itself is built with ant and not mvn.
[04:59:41] <surial> Also that 0.10.0 still isn't out. That is kind of a fair point.
[04:59:41] <tjsnell> they'd only know by pulling the source
[05:00:14] <tjsnell> given that 9 out of 10 projects I download that use ant won't build without a lot of effort my first thought is always uhoh
[05:00:34] *** topriddy has joined ##java
[05:01:12] <surial> We test after every tweak that it'll run anywhere.
[05:01:28] <tjsnell> nod, you're an exception
[05:01:31] *** pyrrhic has joined ##java
[05:01:36] <surial> even doing a complete release, updating the website, the videos, everything, is done with the script. All you need is the key file.
[05:01:48] <tjsnell> though when a maven project doesn't build it's more spectacular
[05:01:53] <surial> I wish all FOSS projects took building seriously.
[05:01:57] <tjsnell> that's when it's really ugly
[05:03:23] *** BSWolf has joined ##java
[05:05:26] *** meoblast001 has quit IRC
[05:07:26] <surial> Feel free to tell me to shut up and read some docs if these newbie questions get too annoying, but: How do you tell maven to compile to 1.6? I thought it was <plugin>(lots of stuff)</plugin>, but apparently plugin is no longer a recognized tag.
[05:08:35] *** echosystm has joined ##java
[05:08:38] *** kermit is now known as meltdown
[05:08:49] <echosystm> whats the best way to run j2ee maven projects?
[05:09:12] <echosystm> if i use jetty (non-j2ee), i get all this sweet automatic-redeploy stuff
[05:09:22] <echosystm> but the glassfish plugin doesnt have anything like that
[05:09:24] <echosystm> any options?
[05:11:32] *** homie has quit IRC
[05:13:27] *** farok has joined ##java
[05:14:07] <freeone3000> Make the glassfish plugin better. Glassfish does support redeployment, so it's a plugin thing.
[05:14:52] <echosystm> jetty can do it without needing to prepare a war though
[05:14:58] <echosystm> can glassfish do that?
[05:15:08] <freeone3000> surial: Compiler target version is part of configuration for the maven-compiler-plugin.
[05:15:43] <freeone3000> echosystm: The admin console has an option for it, but only if the files are on the same drive as the server.
[05:15:53] <surial> freeone3000: Yeah, figured it out. It's a page long. Jesus. <build><pluginManagement><plugins><plugin>(loads of shite)</close all that>. "Configuration by convention my arse".
[05:16:23] <freeone3000> surial: Well, it *does* compile your source. It just assumes that you're targetting 1.3.
[05:16:37] <tjsnell> surial or just use maven 3
[05:16:44] <surial> It's instructions for other people using maven.
[05:16:50] <tjsnell> ahh
[05:16:51] <surial> Kind of harsh to tell them to fuck off and use maven 3.
[05:17:00] <surial> maven 3 does 1.6 out of the box, I take it?
[05:17:04] <tjsnell> but fuck off and use 1.6?
[05:17:30] <surial> Yes, but that's not something I can help. annotation processors and all that.
[05:17:32] <freeone3000> So they can use a recent version of Java but not a recent version of their build system?
[05:17:42] <tjsnell> heh
[05:17:47] <tjsnell> it makes sense, just needling you
[05:17:50] <surial> Though, huh, my mac seems to have picked up mvn 3.0.2 someplace. I'm fairly sure I didn't put it there. I guess apple ships mvn 3 out of the box these days.
[05:17:53] <surial> tjsnell: :P
[05:18:02] <surial> What's the default for 3? 1.6?
[05:18:12] <surial> How many people still use maven 2?
[05:18:13] <freeone3000> I think the same version as the JDK it's using.
[05:18:13] <tjsnell> pretty sure, checking, one sec
[05:18:17] <tjsnell> ahh
[05:20:22] <echosystm> on mac you need to explicitly set the target/source otherwise it uses something retarded ( < 1.5)
[05:20:25] <surial> Does anyone have experience with oss.sonatype.org? Can I use the staging repo to test a build? What do I use as URL in maven?
[05:20:33] <surial> echosystm: How?
[05:20:44] <surial> echosystm: Snow Leopard has only 1.6.
[05:20:50] <echosystm> i mean in maven
[05:21:10] <echosystm> hang on, what is your problem?
[05:21:14] <surial> echosystm: .... Macs only have 1.6. It couldn't use 1.5 even if you wanted to. Or do you mean: maven will just bail .... oh, nevermind, I'm an idiot. You mean it'll run 1.6 and supply -target 1.3 -source 1.3.
[05:21:22] <echosystm> yeah
[05:21:22] <surial> echosystm: My problem? I dunno. Not enough coffee? :P
[05:21:31] <surial> echosystm: Sorry about that.
[05:22:00] <echosystm> was that what your question was relating to? i just assumed
[05:23:25] <cheeser> no, OS X 10.6 only has 1.6. 10.5 still has 1.5 afaik
[05:23:42] <freeone3000> surial: <repositories> specifies a remote repository for `mvn deploy`, to answer one of your questions.
[05:23:55] <surial> freeone3000: Sure. I don't know what to put in there.
[05:24:37] *** guidj0s has joined ##java
[05:24:46] <surial> freeone3000: The current procedure for putting FOSS projects into mavencentral is to first pick a synced repo. I picked oss.sonatype.org. It uses nexus. I've uploaded lombok 0.9.3 to the staging area. I'd like to write a <repositories> entry in a maven test project I've got set up locally to make 100% sure it all works fine before I promote it and thus preclude myself from changing any of it.
[05:25:10] <surial> I can't find any documentation on how to do so. I get the nagging feeling you can't actually use staging as a repo, but that'd be too stupid to entertain.
[05:25:31] <freeone3000> If staging *is* a repo, it'd be the root of the repo.
[05:26:05] <surial> All I have is this fancy-but-doesnt-feel-right nexus thing.
[05:26:10] *** Mkop has joined ##java
[05:26:17] <tjsnell> in your settings.xml you could do it
[05:26:18] <tjsnell> http://pastie.org/1665519
[05:26:23] *** python_user has quit IRC
[05:26:36] <surial> tjsnell: I don't know what URL to put in.
[05:26:42] <tjsnell> oh
[05:26:46] <tjsnell> yeah
[05:27:14] <surial> I'm googling around to find it. I get the feeling its not online at all. But, that would mean you can't test before clicking 'promote' and thus locking yourself out _FOREVER_ of changing that coordinate (GAV).
[05:27:26] <tjsnell> depends on what one it's in
[05:27:27] <tjsnell> https://oss.sonatype.org/index.html#view-repositories
[05:27:37] *** pyrrhic has quit IRC
[05:27:43] <surial> Heck if I know.
[05:28:10] <surial> Ohhhh, wait.
[05:28:11] <surial> https://oss.sonatype.org/content/repositories/orgprojectlombok-402/
[05:28:20] <surial> I get a personal tiny little repo.
[05:28:53] <surial> Yup, that's working.
[05:28:58] <surial> D'oh. Okay, that was my bad.
[05:29:16] <echosystm> is m2eclipse the best way to get maven support in eclipse?
[05:29:23] <surial> echosystm: I guess.
[05:29:45] <surial> According to Roel (coconspirator on lombok I tend to whine about maven to), it's not as stable as he'd like.
[05:30:01] <freeone3000> echosystm: Eclipse support for maven, yeah. If you just want a project compiled and working, mvn eclipse:eclipse has better results, but you'll have to re-run it for every POM change.
[05:30:12] <tjsnell> m2eclipse has issues
[05:30:18] <tjsnell> when it works it works well
[05:31:06] <surial> Can I run a project using mvn?
[05:31:14] <surial> I tried 'mvn run', but no such luck.
[05:31:16] <tjsnell> sure
[05:31:35] <echosystm> surial: it depends on the project
[05:31:41] <tjsnell> mvn mvn exec:java -Dexec.mainClass="com.example.Main"
[05:31:43] <surial> Simplest possible project you can imagine.
[05:31:53] <tjsnell> if it has a main, you can run it
[05:31:55] <tjsnell> like that
[05:32:13] <tjsnell> well mvn not mvn mvn
[05:32:13] <echosystm> for webapps and so on you use maven plugins
[05:32:20] <echosystm> ie. mvn jetty:run or glassfish:run and so on
[05:32:38] <echosystm> but yeah, what tjsnell said for stock java apps
[05:33:02] <surial> Well, that seems to be working.
[05:33:27] <tjsnell> 300 lines of xml later all is well!
[05:33:38] <surial> I really do hate to pile on the laziness, but you're all far too convenient right now. How can I download the sources and javadocs for a given dependency?
[05:33:44] <surial> Oh, I'll run mvn eclipse:eclipse, see what it makes.
[05:33:49] *** meltdown is now known as kermit
[05:34:01] <surial> (Still checking all is well before I promote).
[05:34:22] * surial is already regretting it as more of the interwebs are downloaded.
[05:35:04] <tjsnell> mvn dependency:sources
[05:35:07] <surial> Hum, no sources/javadocs added.
[05:35:29] <tjsnell> no eclipse:eclipse creates an eclipse workspace
[05:35:32] <surial> Right. Well, I'll tell you how that went when it's done downloading some more.
[05:35:38] <surial> tjsnell: Right, but it doesn't link up sources/javadocs.
[05:35:44] *** lesce has joined ##java
[05:35:52] <tjsnell> link up?
[05:35:56] <surial> tjsnell: If you do link up sources, you can cmd+click on any type name from that library and hop straight into the source. I find this an absolute requirement for many deps, such as guava.
[05:36:05] <tjsnell> oh
[05:36:12] <surial> My own tool that produces an eclipse project def from an ivy config DOES do this right.
[05:36:14] <tjsnell> dunno eclipse that well
[05:36:22] <surial> javadoc in practice is useless, as eclipse will just parse the source files for it.
[05:36:28] <tjsnell> I'm idea day to day
[05:36:31] <surial> But if you have javadoc in a zip and no sources, it'll have to do.
[05:36:38] <tjsnell> eclipse once a week or so
[05:36:49] <surial> Does mvn intellij:intellij hook up sources? I assume IntelliJ has some notion of 'link up sources'.
[05:36:50] *** lesce is now known as Rinzler
[05:37:03] <tjsnell> dunno
[05:37:06] <tjsnell> I've never used it
[05:37:06] *** Rinzler is now known as lesce
[05:37:12] <tjsnell> in Idea you just open the pom
[05:37:21] <freeone3000> IDEA has much better maven integration; IDEA's integration does link the sources, if you pull them.
[05:37:34] <tjsnell> the pom and idea's project settings stay synced
[05:37:36] <surial> tjsnell: mvn dependency:sources ran successfully. However, I see no sources anywhere. I guess it must be in .m2
[05:37:41] *** titankiller has joined ##java
[05:37:50] <tjsnell> yeah
[05:37:58] <freeone3000> M2_REPOSITORY, yeah. That's where it sticks the everything.
[05:38:18] <surial> No, I mean, lets say you have a dep on guava. You cmd+click on "ImmutableList". In my eclipse I now jump straight into guava's sources for ImmutableList. I love this bit, as just looking at source is often the fastest way to figure out some obscure interaction.
[05:38:53] <freeone3000> Yeah. IDEA does that. Not sure if maven's IDEA project generation does.
[05:38:58] *** mrapple is now known as Serenity
[05:38:59] <surial> Right.
[05:39:04] *** Serenity is now known as mrapple
[05:39:10] *** dmiles_afk has joined ##java
[05:39:48] <tjsnell> cbeust can probably tell you when he's around
[05:40:05] *** dmiles_afk has joined ##java
[05:40:52] *** dmiles_afk has joined ##java
[05:41:01] <surial> Welp, no way back now.
[05:41:05] <surial> Thanks a bunch for your help.
[05:41:08] <surial> ~tjsnell++
[05:41:08] <javabot> tjsnell has a karma level of 3, surial
[05:41:20] <surial> ~waz++
[05:41:20] <javabot> waz has a karma level of 9, surial
[05:41:26] <surial> D'oh.
[05:41:30] <tjsnell> :)
[05:41:36] <tjsnell> I aim for neutral :)
[05:41:41] *** CodeWar has joined ##java
[05:41:44] *** CodeWar has left ##java
[05:41:47] <surial> ~karma r0bby
[05:41:47] <javabot> r0bby has a karma level of 688, surial
[05:41:59] <surial> That proves beyond all doubt that a neutral karma must imply you're one gigantic asshole :P
[05:42:07] <tjsnell> haha
[05:42:09] <surial> Actually, 688? That feels like cheeser's been twekaing.
[05:42:12] <surial> ~karma maven
[05:42:12] <javabot> maven has a karma level of 8198, surial
[05:43:20] *** CodeWar has joined ##java
[05:43:25] *** BeholdMyGlory has quit IRC
[05:43:47] <freeone3000> I, for one, welcome our new karmic overlords.
[05:44:26] <surial> It looks like at least on this mac, it defaults to 1.6.
[05:45:13] <surial> Hmm.. there doesn't appear to be a --verbose option to make the compiler plugin emit the -source and -target its providing.
[05:45:36] <surial> oh, -X.
[05:46:12] <surial> huh?
[05:46:43] <surial> Heh. It does indeed fire them, as long as you're using 1.6 javac.
[05:49:04] <cbeust> tjsnell: Yes?
[05:49:27] <tjsnell> surial had a question about maven and eclipse
[05:49:37] <tjsnell> I didn't know thought maybe you did
[05:50:02] <surial> cbeust: I just noticed that mvn eclipse:eclipse will NOT link the source jar to the dependency, and thought that was pretty stupid.
[05:50:09] *** epalm has joined ##java
[05:50:24] <surial> Was wondering if I was either missing something or if I misconfigured the repo.
[05:50:51] *** farok has quit IRC
[05:50:51] <cbeust> surial: I've never used eclipse:eclipse but I would expect m2eclipse would do that automatically, assuming the artifact contains sources (not sure if it's required to be on Maven central)
[05:51:12] <surial> It is, at least if you use Sonatype Forge.
[05:51:16] <surial> javadoc too, for some strange reason.
[05:53:21] *** jesmon has quit IRC
[05:56:35] <echosystm> awesome, i've been using eclipse for 2 minutes and it has already crashed
[05:57:08] <surial> What the heck did you do to accomplish that?
[05:57:17] *** TzilTzal has joined ##java
[05:57:18] <echosystm> i pressed ctrl+enter
[05:57:23] <echosystm> err, ctrl+space
[05:57:29] <echosystm> to get autocomplete to pop up
[05:58:05] <echosystm> ...on a brand new install with nothing but m2e
[05:58:16] <cheeser> surial: the only karma i've tweaked, that i recall is maven's
[05:58:37] <ztj> Well m2e's sucktitude should not be underestimated.
[05:58:50] <surial> echosystm: Well, I guess when I mentioned that m2eclipse might not be the most stable of plugins, I nailed it.
[05:59:01] <echosystm> how can people use eclipse without decent maven support?
[05:59:32] *** dextro_ has joined ##java
[05:59:41] <dextro_> if ( cn.equals("bl") && ((perm != null && perm.has(p, "blockloglite.bl")) || s.isOp()) ) {
[05:59:53] <cheeser> <blink>uh...</blink>
[05:59:55] <surial> Well, for some subset of people, m2e does work. The rest use mvn eclipse:eclipse presumably.
[06:00:09] <freeone3000> Or don't use eclipse, or don't use maven.
[06:00:12] <tjsnell> only one you've tweaked higher :)
[06:00:13] <dextro_> if perm == null the part after && wont even evaluate right?
[06:00:19] <ztj> Meh, only one of our ~30 projects use maven. I can't imagine we're the only ones.
[06:00:19] <surial> dextro_: That's correct.
[06:00:24] <dextro_> ty
[06:00:38] <surial> ztj: I use ivy everywhere personally.
[06:00:49] <ztj> We have several projects using ivy
[06:00:53] <surial> ztj: Don't really need a plugin. Running "ant eclipse" after futzing with ivy.xml is not so bad.
[06:01:08] <cbeust> I used to use ant+ivy but I'm not going back, Maven simplifies too much to pass up
[06:01:33] *** caverdude has quit IRC
[06:02:03] <echosystm> do you use IDEA cbeust ?
[06:02:13] <cbeust> Can't find any good reason to create a new project without Maven, these days
[06:02:20] <cbeust> echosystm: No, I'm an Eclipse weenie
[06:02:27] <echosystm> do you use m2e?
[06:02:35] <tjsnell> ant+ivy is just a gateway drug
[06:02:38] <cbeust> echosystm: yup
[06:02:50] <tjsnell> it's a step towards maven
[06:02:50] *** Curator has joined ##java
[06:03:15] <cheeser> ant+ivy is a tainted gateway drug.
[06:03:17] <cbeust> Yes, going from ant to ant+ivy was quite a relief, but Maven has that beatn
[06:03:22] <cbeust> beaT*
[06:03:49] <cbeust> I see Gradle gaining some momentum, though, wonder if it will take hold
[06:03:49] <ztj> ant and ivy work better than maven where one must move older projects into newer dev idioms without spending much time on figuring out how to convert 50 ant scripts to the "maven" way
[06:04:11] <tjsnell> yeah, you finally give up and realize a repository is a good thing, but refuse to use maven so you try ivy,it's like using ant with extra pain included so in desperation you try maven at long last
[06:04:18] <ztj> But I do Use maven when I start new projects... that just doesn't happen at work :)
[06:04:26] <echosystm> whats so bad about netbeans?
[06:04:36] <echosystm> after the talk yesterday, i felt like i should start using eclipse
[06:04:39] <echosystm> but this is just fucked
[06:04:41] <echosystm> crashed again
[06:04:45] <tjsnell> try idea :)
[06:04:50] <freeone3000> echosystm: There's no pressing reason to use it. It's not shiny like IDEA, and it doesn't have a bajillion plugins like eclipse.
[06:05:04] <tjsnell> ~eclipse faq
[06:05:04] <javabot> I don't think so. But maybe there's a plugin...
[06:05:05] <surial> echosystm: Check the logs.
[06:05:06] <ztj> IDEA 10 has not pissed me off yet. It might get bought finally.
[06:05:14] <cbeust> echosystm: The main problem with NetBeans is the lack of mindshare
[06:05:16] <tjsnell> ~netbeans faq
[06:05:17] <javabot> tjsnell, what does that even *mean*?
[06:05:38] *** epalm has quit IRC
[06:06:33] <echosystm> because of the whole CDDL thing?
[06:06:39] <echosystm> hmm
[06:06:57] *** fuzzygroove has joined ##java
[06:07:05] *** VonNaturAustreVe has quit IRC
[06:09:07] <freeone3000> It's not CDDL. IDEA's been propritary for years.
[06:09:44] <echosystm> no, i mean netbeans
[06:10:13] <cbeust> Nothing to do with CDDL, NetBeans failed to impose itself, the race is over.
[06:10:27] *** fuzzygroove has quit IRC
[06:11:03] <cbeust> I'm not even going into its technical lacks compared to Eclipse/IDEA (it's quite behind on many fronts)
[06:11:50] <echosystm> Description Resource Path Location Type
[06:11:51] <echosystm> Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. taskpath-application Build path JRE System Library Problem
[06:12:11] <echosystm> oops, didnt realise it would be that long
[06:12:23] <surial> echosystm: Your project is configured to require J2SE-1.5, but your system has no 1.5 java installed. Therefore eclipse is actually using 1.6 and weird shit might happen, such as zero errors when you use API that's been introduced in 1.6. hence the warning.
[06:12:31] <surial> echosystm: You fix it by configuring your project to be dependent on 1.6 instead.
[06:12:32] <echosystm> yeah, i figured
[06:12:43] <surial> (or by adding a 1.5 VM in the 'java' section in the preferences).
[06:14:06] <echosystm> ah, ok ive found it
[06:14:11] <echosystm> thanks
[06:14:32] <echosystm> shouldnt it detect that from my pom though?
[06:14:59] <echosystm> ive got the source/target set to 1.6
[06:15:33] *** BSWolf has quit IRC
[06:15:48] *** servo has joined ##java
[06:16:31] <ztj> echosystm: That string looks like an osgi warning more than anything maven related
[06:17:07] <echosystm> that was an error in eclipse - the deps list in eclipse had 1.5 instead of 1.6
[06:17:12] <echosystm> (my system doesnt have 1.5)
[06:17:16] *** CodeWar has left ##java
[06:17:21] *** ormaaj_ has quit IRC
[06:17:31] *** Xgc has quit IRC
[06:20:50] *** mxweas has quit IRC
[06:21:11] *** BSWolf has joined ##java
[06:21:38] *** ormaaj has joined ##java
[06:21:55] *** ormaaj has quit IRC
[06:22:48] *** servo has quit IRC
[06:23:32] *** ormaaj has joined ##java
[06:24:01] *** fuzzygroove has joined ##java
[06:28:49] *** Xgc has joined ##java
[06:31:11] *** Cymage has quit IRC
[06:37:17] *** andrewfree has joined ##java
[06:37:40] *** karmst has joined ##java
[06:37:42] <karmst> hello
[06:37:54] <karmst> does anyone know of a way to have a java installation from a webpage and not have to select if McAfee or any of the other garbage software is installed or not?
[06:38:10] *** epalm has joined ##java
[06:38:17] <karmst> my web application requires java, and takes the end user to download and install it.
[06:38:37] <karmst> and they are getting confused during installation what options to choose
[06:38:47] *** drunkvegetarian has quit IRC
[06:39:49] <symbole> McAfee blocks JNLP?
[06:40:10] <karmst> no
[06:40:25] <karmst> the java client has malware built into it
[06:40:35] <andrewfree> Am I doing this right? http://snapplr.com/w4z4 inheritance is confusing me.
[06:40:47] *** null-pointer has quit IRC
[06:40:48] *** devkhadka has quit IRC
[06:40:48] <karmst> tries to automatically make you install other software besides just the client
[06:41:05] <symbole> andrewfree: Is that your homework?
[06:41:45] <andrewfree> symbole: Was, I turned it in like that already but I want to know what I messed up because we dont get our scores back before finals so i have no idea if im doing it right/
[06:42:18] <Fanook> andrewfree: an easy way would be to just write the code to test each of those options
[06:42:31] <karmst> well it's wrong andrew
[06:42:43] <andrewfree> yea I figured.
[06:42:53] <karmst> the inheritance example at the top of the page tells you everything you need to know
[06:43:18] <karmst> If animal is an abstract class
[06:43:20] *** servo has joined ##java
[06:43:36] <karmst> and animal extends (object)
[06:44:12] <andrewfree> I think of it like this http://snapplr.com/f67y
[06:44:27] *** c_axis has quit IRC
[06:45:05] <Fanook> andrewfree: seriously, the best thing you could do right now is to write a simple test class that tries to do each of those options
[06:45:07] <karmst> no so animal A1 would not be a new animal
[06:45:17] <cbeust> andrewfree: a6 should compile
[06:45:17] <andrewfree> it would be a new object..
[06:45:28] <karmst> since a1 does not extend an object
[06:46:09] <karmst> but cow a3 = new animal
[06:46:09] <Fanook> um, A1's biggest problem is that Animal is abstract
[06:46:10] *** BoF has joined ##java
[06:46:35] <cbeust> Indeed, a1 won't compile
[06:46:39] <cbeust> sneaky
[06:46:42] <andrewfree> is this http://snapplr.com/f67y correct, or do I have it backwards?
[06:46:50] <Fanook> you have it right
[06:47:28] <karmst> so yeah...
[06:47:30] <Fanook> andrewfree: but seriously, the best thing you could do right now is to write a simple test class that tries to do each of those options. Go and do that. Then, if you don't understand why some of them work or don't work, come back and ask
[06:47:46] <andrewfree> mmk will do
[06:47:50] <karmst> Is there a universal java installer I can use that doesn't have other software built into the install?
[06:47:56] *** servo has quit IRC
[06:47:59] <andrewfree> what does abstract do to animal though?
[06:48:00] <freeone3000> karmst: Yeah. The one from java.sun.com.
[06:48:06] <Fanook> ~~ andrewfree abstract
[06:48:06] <javabot> andrewfree, abstract is http://java.sun.com/docs/books/tutorial/java/IandI/abstract.html
[06:48:29] <Fanook> technically, Oracle's JRE installer comes with the yahoo toolbar
[06:48:40] <freeone3000> Seriously? Why?
[06:49:02] <Fanook> beats the hell out of me. The public runtime you get with the JDK doesn't have it
[06:49:21] <karmst> yeah see that's retarded
[06:49:23] <Fanook> I assume it was one of Sun's genius business plans
[06:49:46] <karmst> people don't want software installed with critical apps
[06:49:53] *** BoF has quit IRC
[06:49:54] *** blbrown_win3 has joined ##java
[06:49:58] <freeone3000> I assume the response to that is "don't check the checkbox".
[06:50:07] <Fanook> it IS an optional install, checked by default of course
[06:50:15] <karmst> probably but the checkbox is checked by default
[06:50:20] <freeone3000> Anyway. The JDK doesn't come with it, nor does the JDK's JRE.
[06:50:21] <cbeust> I think Fanook nailed it, and people wonder why Sun failed
[06:50:35] <freeone3000> cbeust: Obviously they should've gone with the *Google* toolbar.
[06:50:47] <freeone3000> Or had a product that made money.
[06:50:53] *** devkhadka has joined ##java
[06:50:57] <karmst> don't think have a universal installer that doesn't have any of those options?
[06:51:06] <freeone3000> karmst: That'd be the JDK one.
[06:51:33] <karmst> I see how sun.com JDK has something like it ... But you have to select platform
[06:51:43] <freeone3000> Right, just like you do with the JRE.
[06:51:44] <karmst> is there one that automatically has every platform in it?
[06:51:53] <Fanook> there might be a special one made for embedded installs or a command-line one
[06:51:54] <freeone3000> No.
[06:51:59] *** cschneid has quit IRC
[06:52:15] <freeone3000> The JDK installer can be run in offline mode, but as a self-executing archive, you've still gotta choose your OS.
[06:52:31] *** servo has joined ##java
[06:52:45] <karmst> is that the only options you have to choose?
[06:52:45] <Fanook> which, since every OS has its own installation idiom isn't a totally bad thing
[06:52:47] <andrewfree> Fanook: would I try those statements inside animal.java or in another class?
[06:53:12] <Fanook> andrewfree: set up Animal and its subclasses separate from the class that's testing the options
[06:53:24] <andrewfree> mmk
[06:53:30] <freeone3000> karmst: The installer has a few other options, such as whether to expose a public JRE (you want "yes") and whether to install local documentation, but it's all JDK-related stuff.
[06:54:16] <karmst> dammit. I just want an EXE that only installs java
[06:54:19] <karmst> no other options
[06:54:25] <freeone3000> The linux installer has a ton of options to specify this from the command line and just install. Maybe the windows one does too.
[06:54:27] <karmst> how hard can that be?
[06:54:40] <Fanook> you might be able to extract the JRE installer that gets used in the JDK install
[06:56:33] <freeone3000> (Something like sh sun-java6-jdk.bin --auto-accept-license=yes --silent --with-public-jre. I'm a little rusty on my options, but --help shows them all.)
[06:57:13] <karmst> ah
[06:57:18] <karmst> found them
[06:57:36] <push[RAX]> Anyone knows an opensource SNMP agent that could be used in commercial applications without paying licensing ?
[06:57:46] <karmst> straight java installers no online installation with mcafee garbage included
[06:57:48] <push[RAX]> s/agent/client/
[06:59:02] <echosystm> push[RAX]: snmp4j
[06:59:11] <echosystm> thats pretty much the only snmp library for java
[06:59:36] <echosystm> oh hang on, thats gpl isnt it
[06:59:37] <echosystm> hm
[06:59:58] <push[RAX]> yep
[07:00:00] <freeone3000> I found http://gicl.cs.drexel.edu/people/sevy/snmp/ . Don't see the license, don't know the quantity, but it says it's open-source and it's got an .edu in the TLD.
[07:00:08] <freeone3000> *quality, not quantity.
[07:00:32] <push[RAX]> I'm thinking of decoupling net-snmp and J2EE through a webservice
[07:01:07] <echosystm> ah wait, the standard snmp4j is apache 2.0 - you should be able to use that commercially afaik
[07:01:14] <echosystm> IMO, IANAL, etc.
[07:01:21] <freeone3000> Yeah, apache is permissive.
[07:01:28] <push[RAX]> ah nice
[07:01:42] <freeone3000> (You have to redistribute changes to the *library*, but most people don't change their libraries.)
[07:01:55] <echosystm> only snmp4jmx is gpl
[07:02:04] <echosystm> the plain version is asl
[07:02:47] <echosystm> to be honest though, snmp4j is pretty shit
[07:03:07] <echosystm> if your needs are simple, you could be better off just writing your own
[07:08:21] *** evant_ has joined ##java
[07:09:33] <Curator> question:
[07:09:38] <Curator> what is the point of the strong typing of java?
[07:11:24] <Planck_> Early detection of some types of errors
[07:11:30] *** BoF has joined ##java
[07:11:56] <evant_> Curator: It's also more performant
[07:13:22] *** servo has quit IRC
[07:14:21] <blbrown_win3> Plus, with Java you have to define your type at compile time.
[07:15:01] <cbeust> Curator: Lot of good things among which 1) easier to understand the code and 2) more powerful tooling (automatic refactorings, etc...)
[07:15:24] *** servo has joined ##java
[07:15:32] <blbrown_win3> I wish javascript had some of the type safety protections that Java has...but what are you gonna do
[07:17:13] <cbeust> blbrown_win3: I avoid using Javascript, that's what I'm gonna do :)
[07:18:31] <blbrown_win3> cbeust, I hate the HTML,CSS, JavaScript world...even though I do web development. So it is difficult to completely avoid JavaScript. The google folks saw that and GWT was born. I want to sue google for stealing my idea of GWT
[07:18:57] <cbeust> blbrown_win3: Go for it, I hear they are rich
[07:19:30] <blbrown_win3> Actually, I think I just bitched for years about Javascript and HTML. "I wish there was a way to compile HTML/Javascript code"
[07:19:57] <blbrown_win3> Wicket was one of my ideas too
[07:20:07] <surial> Curator: It's also compile-time checked documentation.
[07:20:33] <surial> Curator: You can't unit test a comment. You *CAN* unit test the notion that some method has explicitly said that it reutns a List<UserName> and in fact does so. Actually, you don't even have to unit test that, if you don't, the compiler will refuse to compile your code.
[07:24:42] *** Curator has quit IRC
[07:25:25] <karmst> ugh...
[07:25:28] <karmst> this isn't working
[07:25:28] *** servo has quit IRC
[07:25:44] <karmst> I'll have to find another flavor to write my app in besides Java
[07:26:12] <karmst> all because of the stupid software 'included' in the installer
[07:26:30] *** topriddy has quit IRC
[07:27:07] <freeone3000> Could package your own installer.
[07:27:29] <cbeust> karmst: Yeah, shame. It's a wonder Java became so successful when you see the kind of knucklehead decision Sun made
[07:27:47] *** abhijain has joined ##java
[07:27:50] *** evant_ has left ##java
[07:30:30] *** evant_ has joined ##java
[07:34:52] <karmst> and it's supposed to automatically redirect back to my website when it finishes installing...
[07:34:54] <karmst> Does it?
[07:34:56] <karmst> NO!
[07:35:03] <karmst> java = epic FAIL
[07:36:31] <evant_> Stupid question, but does anyone know what concrete implementation is used for the DOM NodeList? I want to return my own collection of nodes
[07:37:41] *** drunkvegetarian has joined ##java
[07:38:16] <Fanook> and you can't just stuff the contents of NodeList into your own List?
[07:39:06] <evant_> I could, it's more out of curiousity
[07:39:16] <evant_> Haven't written any java in such a long time
[07:39:38] <evant_> Or alternatively, how can I find out what concrete class is used?
[07:40:00] <cbeust> evant_: Breakpoint, inspect
[07:40:22] <Fanook> NodeList is an interface
[07:40:40] <evant_> Right, I want to find out what concrete implementation is being used
[07:40:45] <evant_> So I can use it
[07:40:48] <Planck_> Being used by what?
[07:40:53] <cbeust> evant_: you won't be able to, most likely.
[07:40:57] <Fanook> in fact, from the docs "The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live."
[07:41:35] <Planck_> There's only two methods; implementation is trivial.
[07:41:42] *** xianny has joined ##java
[07:41:50] <evant_> Yeah I know, just don't want to reinvent the wheel
[07:42:00] <evant_> Eh whatever it's not for anything important, I'll just use an array ;)
[07:42:09] <Fanook> use a List
[07:43:23] <Planck_> I'd be more worried about implementing Node than NodeList.
[07:43:42] *** dmiles_afk has quit IRC
[07:44:39] <evant_> Planck_: I don't want node, I just want to return collection of nodes
[07:44:46] <evant_> Anyway, it's just for a uni lab, not going to bother
[07:44:51] <Planck_> List<Node>. Done.
[07:45:17] <evant_> Indeed
[07:46:58] *** lunatik210 has joined ##java
[07:47:46] *** dmiles_afk has joined ##java
[07:48:11] *** jmotta has joined ##java
[07:50:56] *** abhijain has quit IRC
[07:51:39] *** Dragonai has quit IRC
[07:53:04] *** barq has joined ##java
[07:57:46] *** jjido has joined ##java
[07:58:46] *** BoF has quit IRC
[07:59:14] <dextro_> methods default to private?
[07:59:19] *** topriddy has joined ##java
[07:59:22] *** drunkvegetarian has quit IRC
[07:59:36] <blbrown_win3> dextro_, is that a question?
[08:00:00] <dextro_> yes
[08:00:27] <dextro_> and it looks like the answer is no
[08:00:32] <dextro_> they appear to default to public
[08:00:45] <dextro_> so why is public always used
[08:00:51] <blbrown_win3> dextro_, see this, http://mindprod.com/jgloss/scope.html
[08:01:20] <dextro_> ah ty
[08:01:39] *** jjido has quit IRC
[08:02:07] <blbrown_win3> "so why is public always used" Most people don't think of method scope when they write code. But, they should. Public access is available to other calling classes
[08:02:20] *** jmotta has quit IRC
[08:04:56] *** ExtraSpice has joined ##java
[08:05:48] *** horte has joined ##java
[08:07:04] <echosystm> can anyone explain to me what osgi is?
[08:07:06] *** Thrawn has joined ##java
[08:07:11] <freeone3000> ~osgi
[08:07:11] <javabot> freeone3000, osgi is a module system for java. It's seen in eclipse, glassfish, jboss, and a host of other environments. See also ~equinox, ~felix, and ~knopflerfish
[08:07:19] <echosystm> ive read a dozen generic descriptions that make absolutely no practical sense
[08:07:30] <echosystm> what is a "module system" ?
[08:07:35] *** evant_ has left ##java
[08:07:35] *** Denebola has quit IRC
[08:07:58] <freeone3000> A system of modules. Your code is a module. Your dependencies are modules.
[08:08:31] <freeone3000> It's basically a hunk of code which could do a thing and can have a lifecycle.
[08:08:46] <echosystm> i see
[08:09:01] <echosystm> do you think it is a fairly essential thing to learn?
[08:09:02] *** plarsen has quit IRC
[08:09:28] *** Mkop has quit IRC
[08:09:36] <freeone3000> If you plan on using osgi. I find it nice, but not essential.
[08:09:44] <cbeust> Essential probably not, but interesting to know. The overview is pretty small
[08:10:21] <echosystm> what kinds of projects lend themselves to OSGI use?
[08:10:29] <cbeust> Read the tutorial for Knofpfler Fish (I think, or was it Felix?). Well done and to the point
[08:10:51] <echosystm> ok
[08:10:53] <cbeust> echosystm: Any complex application where you want to have several components activate/deactivate on demand
[08:10:53] <echosystm> thanks
[08:10:58] <freeone3000> It's a pretty good JPF replacements, and things that like the EE lifecycle, but don't want to depend on EE (or like the OSGi lifecycle better than the EE one).
[08:14:53] *** jmotta has joined ##java
[08:15:39] *** barq has quit IRC
[08:17:19] *** barq has joined ##java
[08:18:05] <push[RAX]> is there a way to check for an object's type through EL ?
[08:20:33] <freeone3000> Isn't an EL just arbitrary Java code in a JSP?
[08:20:59] <blbrown_win3> expression language, a sort of simple dynamic java scripting
[08:21:03] <push[RAX]> I thought so too but instanceof doesnt seem to cut it
[08:21:13] <push[RAX]> yeah "simplified" is the key word
[08:21:19] <push[RAX]> aka core functions missing ;/
[08:21:25] *** t0rc has quit IRC
[08:21:25] <symbole> push[RAX]: Maybe foo.class.simpleName, or something like that.
[08:21:41] <push[RAX]> oh that's not a bad idea at all :>
[08:22:01] <blbrown_win3> push[RAX], if you can invoke a java method that returns a boolean, you could wrap that method around an instanceof call
[08:22:21] <push[RAX]> Yeah that's what I'm doing atm and it's very very ugly
[08:22:37] <blbrown_win3> EL is ugly. JSP is ugly
[08:22:38] <symbole> push[RAX]: Why do you need to know the type of the object inside a JSP page?
[08:22:54] <blbrown_win3> Don't use JSP. Use Wicket, hehe
[08:23:19] <freeone3000> Or take all these nasty ELs, stick them in a taglib, and give yourself a TLD
[08:23:24] <push[RAX]> Basically i have a tree object in icefaces and the treenode element (a DefaultMutableTreeNode) can be one of several subclasses of the element type
[08:23:46] <push[RAX]> subclasses of the defaultmutabletreenode
[08:24:08] <Thrawn> float pi = 3.14_15F; whats that F suffix?=
[08:24:19] <freeone3000> Float literal.
[08:24:22] <push[RAX]> Basically it shows a tree of network resources (domains, containing machines, containing software, contianing URLs, containig web forms, etc)
[08:24:23] <Thrawn> thx
[08:24:32] <freeone3000> Otherwise, it'd be a double literal. Why they're not using Math.PI, though, no clue.
[08:24:51] <push[RAX]> So flexibility to the number of possible subclasses of nodes is a must
[08:25:03] <push[RAX]> and wrapping in a boolean is long and ugly
[08:26:43] *** vuln has quit IRC
[08:26:58] *** glcrazy has joined ##java
[08:27:22] <topriddy> blbrown_win3: are you an experienced wicket user?
[08:27:34] *** cbeust has quit IRC
[08:28:45] <topriddy> blbrown_win3: kind of researching wicket's application in portal development. Also, considering how wicket lends itself for modular development
[08:29:44] <blbrown_win3> topriddy, sort of. The #wicket channel have some of the developers on there. What is your question. Wicket encourages a moduler/component approach for web app development
[08:30:17] *** Paradox has left ##java
[08:30:21] *** DJClean has joined ##java
[08:30:42] <blbrown_win3> topriddy, I would only use wicket or something similar for most webapp development. Maybe gwt if you are using something more client driven
[08:31:44] <blbrown_win3> topriddy, for portal development, you might have to revert to something that the j2ee container offers.
[08:31:56] *** dmiles_afk has quit IRC
[08:31:58] <topriddy> blbrown_win3: i use wicket too. am considering a case where in portal development, you just add another application portlet to an existing portal
[08:32:21] <blbrown_win3> yea, I don't know if wicket supports the portlet api.
[08:32:34] <topriddy> blbrown_win3: maybe am not clear enough. X_X . never mind.
[08:34:08] *** devkhadka has quit IRC
[08:36:14] *** epalm has quit IRC
[08:49:08] *** surial has quit IRC
[08:49:38] *** openpercept has joined ##java
[08:49:58] <Thrawn> int [] list = { 5, 3, 8}; what are the [] for?
[08:50:32] *** looopy has quit IRC
[08:51:06] *** Maknib has joined ##java
[08:51:49] *** Soliah has joined ##java
[08:51:53] <Thrawn> bump?
[08:52:17] *** jmotta has quit IRC
[08:55:43] *** L-----D has quit IRC
[08:55:49] *** horte has quit IRC
[08:56:05] *** Thrawn has left ##java
[08:56:09] *** Thrawn has joined ##java
[08:56:29] <Thrawn> int [] list = { 5, 3, 8}; what are the [] for?
[08:56:56] <symbole> Thrawn: http://download.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
[08:57:07] <Thrawn> thx
[08:57:46] *** nixness has joined ##java
[09:03:16] *** FrozenKnight has joined ##java
[09:05:27] *** aless67 has joined ##java
[09:05:28] <aless67> hi
[09:06:15] *** BSWolf has quit IRC
[09:06:23] <symbole> aless67: Howdy.
[09:10:34] *** askhl has quit IRC
[09:10:35] *** BSWolf has joined ##java
[09:10:49] *** nixness has quit IRC
[09:13:54] *** nixness has joined ##java
[09:13:54] *** openpercept has quit IRC
[09:15:01] *** askhl has joined ##java
[09:17:00] *** barq has quit IRC
[09:19:29] *** BSWolf has quit IRC
[09:19:49] *** BSWolf has joined ##java
[09:20:34] <Maknib> hi all.... in my assignment it needs a menu. i have it so you choose either A B or C.. if you choose anything else it stops and says choose A B or C then it shows the menu.... i have done this by going into ..showMenu() when they choose it throws the choice to validateChoice().. if wrong it goes back to showMenu().. is this a good approach?
[09:22:03] *** platzhirsch has joined ##java
[09:22:13] <symbole> Maknib: Sure.
[09:22:49] *** guidj0s has quit IRC
[09:22:56] <Planck_> I'm not sure why you allow the user to select options from a menu that you then reject.
[09:23:06] <Planck_> Ohhh! Text menu, not GUI?
[09:24:13] *** openpercept has joined ##java
[09:24:56] *** BSWolf has quit IRC
[09:27:15] <Maknib> yeah sorry im in week 2 of my first programming unit. which is Java.. my assignment is to have a menu with 3 options.. A is a pattern the user enters how many rows and a Character. it then does a pettern.. B: is a stamp duty calculator and C: is a sales table where the user enters all the sales they made and it shows in a table. should be fun :) so no gui yet
[09:27:39] *** blbrown_win3 has quit IRC
[09:30:51] *** BSWolf has joined ##java
[09:31:53] *** ronr_away is now known as ronr_
[09:32:42] *** srji has joined ##java
[09:32:58] *** frangiz has joined ##java
[09:38:39] *** frangiz has quit IRC
[09:39:46] *** frangiz has joined ##java
[09:40:36] *** symbole has quit IRC
[09:42:30] *** lapice has quit IRC
[09:42:37] <Thrawn> i got for (int i = 0; i < list.length; i++) but i want it to go thorough my list from the end to the beginning; how do i do that? i tried: for (int i = list.length; i >0; i--) but that gives an error :(
[09:42:53] <Thrawn> through*
[09:43:07] <Maknib> <= ?
[09:43:30] <Maknib> oh sorry..
[09:43:55] <Maknib> maybe.. for (int i = list.length; i > list.length; i--)
[09:44:17] <Thrawn> works!
[09:44:28] <Thrawn> although wrong result^^
[09:44:29] *** riotz has joined ##java
[09:45:01] <Thrawn> now that one just looked at the last element of the arrey (list) but not at all
[09:45:46] *** srji has quit IRC
[09:46:21] <Maknib> i thought i >0 would have worked
[09:46:26] *** puwei has joined ##java
[09:46:45] *** puwei has left ##java
[09:47:12] <Thrawn> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
[09:47:17] *** Denebola has joined ##java
[09:47:53] <Thrawn> is the error i get with i>0 , what does that mean?
[09:48:55] <freeone3000> Element list[list.length] is exactly one beyond the bounds of the array.
[09:48:57] <Thrawn> weird, (int i = 3; i > 0; i--) works but (int i = list.length; i > 0; i--) doesnt; the arrey has 4 elements
[09:49:10] <Thrawn> ah thx freeone :)
[09:49:10] <freeone3000> Not weird at all. Arrays start at zero.
[09:49:18] <freeone3000> Therefore, an array with 4 items has indexes 0, 1, 2, 3.
[09:49:19] <Thrawn> yeop grasped it^^
[09:49:27] <Thrawn> so
[09:49:32] <Thrawn> how do i write list.length -1 ?
[09:49:49] *** platzhirsch has left ##java
[09:49:53] <Thrawn> lol works -.- before it didnt work
[09:50:21] *** zemanel has quit IRC
[09:50:35] <Thrawn> but then i have to set terminate at i > -1
[09:50:45] *** zemanel has joined ##java
[09:51:54] <freeone3000> Yes, or i >= 0.
[09:52:20] *** robbyoconnor has quit IRC
[09:52:22] <freeone3000> (0 is the first integer greater than -1.)
[09:52:57] *** LadySerena has quit IRC
[09:53:00] *** robbyoconnor has joined ##java
[09:53:25] *** LouisJB has joined ##java
[09:53:30] *** zemanel has joined ##java
[09:55:46] *** dmiles_afk has joined ##java
[09:55:54] *** PigFlu has joined ##java
[09:57:05] *** kriko has quit IRC
[09:57:15] *** bwright has joined ##java
[09:58:09] *** xianny has quit IRC
[09:58:29] *** cool123 has joined ##java
[09:59:19] *** chandan_kumar has joined ##java
[09:59:52] *** rigved has joined ##java
[10:01:48] *** LouisJB has quit IRC
[10:03:03] *** chandan_kumar has quit IRC
[10:06:26] <Maknib> with main(String[] args);... if i print out the length it is 0 if i print out args[0] i get an exception. i need to test if there are params from command line or not.. what do i need to test this.
[10:06:31] *** LouisJB has joined ##java
[10:06:43] *** xianny has joined ##java
[10:07:11] *** dextro_ has quit IRC
[10:08:29] *** titankiller has quit IRC
[10:11:19] <freeone3000> If the length is 0, you got no arguments.
[10:12:33] *** arborist has joined ##java
[10:12:43] *** titankiller has joined ##java
[10:13:14] *** homie has joined ##java
[10:14:02] <Maknib> oh thanks. i'm even echoing out the length and testing and still didn't notice it haha
[10:16:48] <Maknib> can you set eclipse to focus on the console when it runs? every time i run the program and try to type it types in the code and not console until i click the console
[10:19:12] *** cool123 has quit IRC
[10:19:46] *** cool123 has joined ##java
[10:21:29] *** cool123 has quit IRC
[10:21:59] *** cool123 has joined ##java
[10:23:28] *** cool123 has quit IRC
[10:23:29] <ernimril> Maknib: there is a #eclipse, perhaps they know
[10:23:48] <Maknib> thanks
[10:23:52] *** cool123 has joined ##java
[10:26:02] *** BSWolf has quit IRC
[10:26:10] *** cool123 has quit IRC
[10:26:23] *** BSWolf has joined ##java
[10:26:45] *** cool123 has joined ##java
[10:28:20] *** cool123 has quit IRC
[10:28:38] *** openpercept has quit IRC
[10:29:29] *** neuro_damage has joined ##java
[10:33:29] <Edulix> hi
[10:33:39] <Edulix> I'm trying to use java reflection API, but I get this:
[10:33:52] <Edulix> symbol : variable TYPE
[10:33:52] <Edulix> location: class org.apache.hadoop.conf.Configuration
[10:33:52] <Edulix> Class partypes[] = {Configuration.TYPE};
[10:33:57] <Edulix> why?
[10:34:57] <Bombe> I have a theory but I’m not going to share.
[10:35:38] <Edulix> Bombe: lol
[10:36:17] *** bearded_oneder has quit IRC
[10:36:34] <freeone3000> You managed to miss the first line of that error message. Chances are, Configuration doesn't have a TYPE property. 'class' is the one magically generated by the Java runtime, not 'TYPE'.
[10:37:31] <Edulix> freeone3000: so I should use Configuration.class instead?
[10:37:44] <freeone3000> If you want its associated Class object, yes.
[10:38:04] <Edulix> ok thanks freeone3000
[10:38:16] <Edulix> makes sense :P
[10:38:33] <echosystm> when should one use EAR over WAR ?
[10:38:54] <echosystm> is it pretty much a case of "all JavaEE apps should use EAR" ?
[10:38:55] *** kriko has joined ##java
[10:39:55] <selckin> when you use ejb i guess ?
[10:40:18] <freeone3000> An EAR is when you need to deploy multiple enterprise modules, one of which may be a web module. Web modules have the WAR extension.
[10:41:21] <echosystm> why would an application server be interested in anything more than a "web module" ?
[10:41:42] <echosystm> like, what other modules can be deployed to an AS?
[10:42:39] <echosystm> actually, nevermind, this is a better question: i'm making a jax-rs web service and i want to bundle all non-javaee deps into the archive. ear or war?
[10:43:00] <freeone3000> WAR.
[10:43:07] <echosystm> okie dokie!
[10:43:10] <echosystm> thanks
[10:43:38] <freeone3000> (An application server is more than a webserver with some fancy libraries - it's also a middleware and backend platform.)
[10:43:50] <echosystm> what is "THE" java ee book? i think i need to do some reading
[10:44:20] <selckin> probably a whole bookshelf
[10:44:53] <echosystm> i guess i would like coverage of the important bits: servlets, persistence, messaging and transactions
[10:45:09] <echosystm> i dont really know what else is in java ee, but those things are what i am mostly interested in
[10:47:28] <ztj> ~jee
[10:47:29] <javabot> for information and tutorials on JavaEE see http://java.sun.com/javaee/6/docs/tutorial/doc/
[10:48:04] <freeone3000> Servlets I'd go with Core Servlets and JSP. For persistance, you've got to differentiate between EJBs and JPA - the first has Enterprise JavaBeans, the latter has Hibernate in Action. Then there's Enterprise JMS Programming for messaging, and transactions'll be handled by whoever handles your persistance, if you mean what I think you mean.
[10:48:29] <ztj> ~jta
[10:48:29] <javabot> ztj, what does that even *mean*?
[10:48:33] <freeone3000> So yeah, bookshelf wouldn't be too far off.
[10:48:38] * ztj O.o
[10:49:16] *** devkhadka has joined ##java
[10:49:26] <freeone3000> ~jta is the Java Transaction API, a set of libraries connecting a transaction manager to transaction-based applications. http://java.sun.com/products/jta/
[10:49:27] <javabot> OK, freeone3000.
[10:51:22] <ztj> the best thing about jta is being able to transactionally access several separate types of components together, not JUST jpa
[10:51:27] <ztj> for example, jms and jpa
[10:51:36] <echosystm> yeah, thats what i meant
[10:53:43] *** Kamaran has joined ##java
[10:54:25] *** io2 has joined ##java
[10:54:53] <echosystm> http://apress.com/book/view/1430219548
[10:55:08] <echosystm> seems to get a good rap on stackoverflow
[10:58:20] *** discozohan has joined ##java
[11:05:41] *** aless67 has quit IRC
[11:06:29] *** mxweas has joined ##java
[11:06:38] *** mxweas has quit IRC
[11:06:42] *** aless673 has joined ##java
[11:06:48] <aless673> re
[11:07:04] <aless673> can someone tell me the use of Iterator ?
[11:07:13] <selckin> ~collections
[11:07:13] <javabot> The Collections API is available at http://java.sun.com/javase/6/docs/technotes/guides/collections/index.html
[11:07:25] <aless673> Iteratos gives me nothing more than a List
[11:08:25] <echosystm> aless673: you use iterators to iterate over a colection
[11:08:27] <aless673> selckin, i read it, i still not find what is the use
[11:08:48] <echosystm> the name pretty much gives it away..
[11:08:59] <selckin> it's a way to loop/iterate over something, for example the elements in a list
[11:09:14] <aless673> selckin, you can do it withwhile, for ?
[11:09:19] <echosystm> no
[11:09:22] <echosystm> thats wrong
[11:09:32] <aless673> i actually do it in my program
[11:09:36] <aless673> without iterator
[11:09:50] <echosystm> if you are using an array, using for is ok
[11:09:59] <aless673> ArrayList in fact
[11:09:59] <echosystm> but if you are using collections, you should be using iterators
[11:10:18] <aless673> why does a List have a method iterator
[11:10:19] <aless673> no use?
[11:10:28] <aless673> i cant understand ffs...
[11:10:29] <hyppias> how do I get NB generate a META-INF/services/xxx file for a class? some kinds of projects generate this automatically.
[11:11:29] <echosystm> aless673: iterator() will give you the iterator for that list aless673
[11:12:20] <aless673> echosystm, why do i need an iterator
[11:12:30] <aless673> if i can go where i want in the list with other method
[11:12:44] <echosystm> have you ever seen the looping construct like this...
[11:12:52] <squeakytoy> aless673: Iterator is just a technique to use for "lists/collections" you don't know the max size of, or that each "item" in the list actually has a logic behind it
[11:12:58] *** matsebc has quit IRC
[11:13:01] <echosystm> for (SomeClass x : someCollection) { }
[11:13:01] <echosystm> ?
[11:13:04] <aless673> List.size()
[11:13:11] <aless673> and you know the size.
[11:13:22] <echosystm> aless673: have you ever seen a for loop like that?
[11:13:30] <squeakytoy> aless673: You don't need to use Iterator for lists
[11:13:38] <selckin> aless673: what if it's a linkedlist? the only way to effeciently loop over all the items to keep state , hence the iterator
[11:13:52] <aless673> squeakytoy, why is there a iterator method then ?
[11:14:28] <echosystm> aless673: there are many benefits to iterators... read what i am about to say ok?
[11:14:34] <squeakytoy> aless673: It gives developers more tools, if they want to make their own lists. For example if you create a AlessList, you can define how the ITerator works
[11:14:39] *** MyWay has joined ##java
[11:14:46] <echosystm> 1. simple looping construct: for (Type x : collection) {}
[11:14:56] <echosystm> that is a shitload easier than for (int i = 0....)
[11:15:11] <echosystm> the above for ( : ) loop uses an iterator
[11:15:19] <MyWay> hello, after I've upgraded to java 1.6.0_u24, java applications/web starts really slow, taking several minutes... I'm using Ubuntu 10.10 x64, anybody has idea?
[11:15:22] <aless673> i dont see where it is easier
[11:15:37] <echosystm> then im wasting my time
[11:15:39] <echosystm> keep using for loops
[11:15:49] *** Thrawn has quit IRC
[11:15:51] <aless673> it is like if(blabla) ? return ok : return okk;
[11:15:54] <aless673> this is NO use
[11:16:00] <aless673> maybe some style
[11:16:17] <aless673> but u gain no time, no performance
[11:16:28] <echosystm> are you trolling?
[11:16:46] <aless673> tell me why?
[11:17:00] <freeone3000> aless673: Consider a linked list.
[11:17:02] *** mescalinum has joined ##java
[11:17:13] <echosystm> how the fuck is "for (Type x : collection) {}" not better than "for (int i = 0; i < collection.size(); i++) {}"
[11:17:31] <echosystm> like
[11:17:36] <freeone3000> MyWay: Is it `javaws` that's taking the time? Note that there's no 64-bit version of the Java plugin distributed with java 6.
[11:17:36] *** dmiles_afk has quit IRC
[11:17:39] <echosystm> why would you do all that extra work when you dont need to?
[11:17:46] <squeakytoy> echosystm: I think he is so new its hard for him to grasp it
[11:17:47] <MyWay> freeone3000: how to check it?
[11:18:05] <aless673> echosystm, extra works? ho yes your .java will take 10 bytes more
[11:18:05] <freeone3000> MyWay: Download the JNLP and run javaws over it instead of running it directly through the browser.
[11:18:13] <echosystm> i know, but hes not listening
[11:18:21] <MyWay> freeone3000: it happens the same to desktop applications
[11:18:28] *** E-sense has quit IRC
[11:18:49] <freeone3000> Nope. Chances are, it's just you. Maybe #ubuntu knows more (perhaps a bad packaging).
[11:18:54] *** PelleTut has joined ##java
[11:19:09] <MyWay> I've tried manually installing 1.6.0_u24, too
[11:19:11] <squeakytoy> aless673: If you continue to code, I bet 1000 USD you will by default create "for (Type x : collection) {}" loops
[11:19:11] <echosystm> aless673: iterators are often much faster than for loops
[11:19:22] <echosystm> what do you think happens when you use a for (int i...) loop over a linked list?
[11:19:28] <echosystm> you have no positional access to elements
[11:19:32] <echosystm> so it will be slow
[11:19:37] <echosystm> iterators will be much faster
[11:19:56] *** E-sense has joined ##java
[11:20:03] <aless673> iterator can only give me next position
[11:20:14] <aless673> with loop i can go where i want
[11:20:29] <freeone3000> aless673: And how many times do you need to get a position oter than the next?
[11:20:38] <squeakytoy> aless673: You clearly are new to Java and/or programming. The people here have years and years of experience. We are not making this up to screw with you. Listen what we are saying, since its based from years and years of experience.
[11:20:48] <echosystm> iterators are for iterating over a whole collection. if thats not what you are doing then dont use iterators.
[11:20:55] <aless673> wait guys
[11:21:02] <aless673> i am listening to you, i just try to understand
[11:21:09] <aless673> im new, you are pro, i know
[11:21:21] <squeakytoy> aless673: Then dont say its bad performance, since clearly dont know
[11:21:28] <freeone3000> (And please consider a case for when your access is not random. There's the RandomAccess marker interface, which ArrayList implements but LinkedList does not.)
[11:22:12] <aless673> can i show you some code
[11:22:19] <squeakytoy> !pastebin
[11:22:20] <aless673> and you tell me how an iterator can help me
[11:22:26] <freeone3000> ~pastebin
[11:22:26] <javabot> http://eugeneciurana.com/pastebin - Paste the final url after you've pasted your stuff there.
[11:22:30] <echosystm> use a pastebin aless673
[11:22:39] <aless673> 1 second
[11:23:06] <aless673> http://pastebin.com/6H2pbwg8
[11:23:17] <aless673> take a look on parcoursProf and parcoursLarge method
[11:23:32] <freeone3000> And to answer your original question, a half hour ago: List provides an iterator() method because Collection provides an iterator() method, and List is a subinterface of Collection. Collection does not have a get() method.
[11:24:39] <freeone3000> aless673: Everywhere you have a simple for *could* be replaced by an iterator. It won't offer any noticable improvements because you're using an ArrayList, but it'll behave exactly the same, and if you ever needed to switch to a non-RandomAcess List implementation, it'll show benefits.
[11:24:50] <aless673> look parcoursLarge, i need to get(0) (position 0), with iterator i can only take the next, not the actual position
[11:25:03] *** magn3ts has quit IRC
[11:25:23] <freeone3000> aless673: To be specific, that'd be lines 46, 56, 69, and 88.
[11:25:54] <aless673> ok
[11:26:18] <aless673> but how to do line 85/86 with an iterator?
[11:26:19] <aless673> i cant!
[11:26:24] *** Eyes|iPod has joined ##java
[11:26:27] <freeone3000> No, you can't. So don't.
[11:26:38] <dreamreal> morning
[11:27:00] <freeone3000> Well, you *could* because you only access the first element, and you only do a remove() operation, but there's no real reason to.
[11:27:04] <aless673> i think my code isn't an good example for iterator ^^ may in the future i will see the real use of it
[11:27:09] <dreamreal> heh
[11:27:11] <dreamreal> still at it?
[11:27:24] <freeone3000> aless673: Actually, it's the perfect case. All nice, and clean, and simple.
[11:27:38] <freeone3000> aless673: Java's Iterator interface is rather weak, with only two required operations.
[11:28:25] <squeakytoy> aless673: which one is more easier to read and understand? http://pastebin.com/mPMSAy43
[11:29:20] <aless673> for me the first cause i dont understand the second
[11:29:21] <squeakytoy> aless673: its not always about performance, its to write user-friendly code :-)
[11:29:29] <aless673> but if i do, the second better in fact
[11:30:17] <dreamreal> haha
[11:30:25] * ztj shakes his head
[11:30:26] <echosystm> aless673: a good exercise is to write your own iterable linked list implementation
[11:30:40] <dreamreal> yeah, that's really important: java will usually get your code to run well, so you might as well just write simple stuff, you'll do fine
[11:30:50] *** Eyes|iPod has left ##java
[11:31:05] <squeakytoy> aless673: its easy. you write: for ( *type of class the list contains* *a name* : *the list *) { } ex: for( NODE node : a.arc ) { in here you can use node } <-- NODE is the class that a.arc contains and 'node' is just a name of the variable
[11:31:11] <ztj> and on the other side of that token, there's no sense in writing blatantly stupid code
[11:31:14] <echosystm> aless673: doing that exercise will make you understand what an iterator is and why you should use them
[11:31:26] <ztj> like using a LinkedList in a context where random access is frequently required
[11:31:59] <dreamreal> ztj: sure. But then again, if the list is 15 elements, and this code is accessed four times in the life of a program... meh
[11:32:11] <ztj> perfect practice makes perfect
[11:32:19] <dreamreal> it's stupid, absolutely. But in the grand scheme of things, that's an optimization that you just don't care about.
[11:32:22] <ztj> furthermore in exactly your same sentiment, there's no risk in using ArrayList instead
[11:32:29] <dreamreal> and yes, fully agreed.
[11:32:57] <squeakytoy> aless673: I strongly recommand you take 10mins and read http://download.oracle.com/javase/1.5.0/docs/guide/language/foreach.html <-- it explains it all
[11:33:40] <aless673> squeakytoy, i am not really good in english and if i read some lesson in english, i missunderstand many things..
[11:33:44] *** Johannes13 has joined ##java
[11:33:46] *** servo has joined ##java
[11:33:50] <squeakytoy> aless673: whats you native language?
[11:33:54] *** dmiles_afk has joined ##java
[11:34:08] <echosystm> french
[11:34:23] <squeakytoy> Lithuania?
[11:34:24] <aless673> don't discriminate me please :)
[11:34:29] <aless673> french/italian
[11:35:06] *** drindt has joined ##java
[11:35:15] <echosystm> hes not discriminating, hes finding you the documentation in your language
[11:35:24] *** TiLex has joined ##java
[11:35:26] <aless673> squeakytoy, in your exemple u didn't use it from Iterator it
[11:35:27] <ztj> sun only provides English and Japanese
[11:35:34] <ztj> err oracle bleh
[11:36:06] <echosystm> aless673: for (X x : y) uses iterators behind the scenes
[11:36:19] <echosystm> java has "language support" for iterators
[11:36:35] <aless673> then why should i put a name for the iterator
[11:36:42] <squeakytoy> a name?
[11:36:52] <ztj> you don't put a name for the iterator
[11:37:00] <aless673> Iterator<NODE> it = arc.iterator();
[11:37:07] *** rafadc has joined ##java
[11:37:10] <ztj> using iterators that way is not using foreach
[11:37:16] <dreamreal> why bother? for(Node node:nodes) {}
[11:37:19] *** horte has joined ##java
[11:37:21] <ztj> though it is a valid usage if you need the Iterator.remove method
[11:37:22] *** rafadc has quit IRC
[11:37:30] <squeakytoy> Iterator<NODE> it= parcours.iterator(); <-- this a bad idea tho
[11:37:46] <aless673> i read a french lesson
[11:38:09] <ztj> squeakytoy: without qualification, you make a false statement, so I'd suggest you justify the claim
[11:38:09] <aless673> http://dev-lang.over-blog.com/article-726029.html
[11:38:13] <aless673> look at the example
[11:38:20] <echosystm> who here would be interested in a maven plugin for glassfish that can do target scanning and redeploy?
[11:38:33] <echosystm> im thinking i might start my own from scratch
[11:38:47] <freeone3000> I would, especially if it didn't require a local glassfish to work.
[11:38:56] <echosystm> haha
[11:39:02] <echosystm> i mean embedded glassfish
[11:39:29] <squeakytoy> aless673: There is a simple answer. That article is from 2005, we are in 2011 :-)
[11:39:54] <squeakytoy> aless673: You "don't" have to write that code anymore. You "should" use: for( X x : y)
[11:40:06] <ztj> unless you need .remove()
[11:40:18] <aless673> is there a default iterator for list without define it ?
[11:40:33] <freeone3000> aless673: Two. List.iterator() and List.listIterator().
[11:40:41] <aless673> okkkkk
[11:40:43] <aless673> nice ^^
[11:40:53] <freeone3000> aless673: The former is used for purposes of for(X x : list) { }, but it shouldn't matter to you.
[11:41:00] <Cher> Ouch. Idea takes nearly 12 minutes to build from scratch on my machine. This is far too slow imo.
[11:41:05] <squeakytoy> aless673: Look at '3.2. Itérateurs sur une collection en C#' <-- thats how we want you to code ^^
[11:41:22] <dreamreal> well, note that yesterday he was arguing that he HAD to use Object in Node, generics were unacceptable
[11:41:26] *** frangiz has quit IRC
[11:41:27] <squeakytoy> aless673: but using for( X x : y ) syntax instead
[11:41:31] <dreamreal> so he may well be stuck in 2004
[11:41:32] <aless673> ok ^^
[11:41:40] *** zChris has quit IRC
[11:42:19] *** m3asmi has joined ##java
[11:42:19] <aless673> but i dont understand the subject of my work then
[11:42:21] <ztj> aless673: is this all for school or something?
[11:42:33] *** frangiz has joined ##java
[11:42:33] <dreamreal> yes, this is all school
[11:42:34] <aless673> "create an iterator helped by a inside class"
[11:42:42] <ztj> ugh why are we wasting any time then? ASK YOUR PROFESSOR.
[11:42:45] <ztj> that's why you pay them.
[11:42:49] <aless673> i bad translate
[11:43:00] <squeakytoy> jesus christ. I hope not this was a school task to learn how "iterators" works and we totally screwed him over :P
[11:43:02] *** devkhadka has quit IRC
[11:43:11] <freeone3000> Oh, his professor won't know. If he did, he would be employed in an actual business.
[11:43:22] <aless673> this isn't work
[11:43:28] <squeakytoy> freeone3000: wow, that was a cruel work
[11:43:30] <dreamreal> his professor probably avoids generics because they're confusing
[11:43:32] <squeakytoy> freeone3000: wow, that was a cruel joke*
[11:43:33] <aless673> this is some work we can do he gives us to practice
[11:43:42] <freeone3000> squeakytoy: ...I wish it was a joke.
[11:44:13] <squeakytoy> freeone3000: Well, i know professors that know about coding languages than any other
[11:44:32] <aless673> a part of question is "create iterator by new within class
[11:44:53] <aless673> why shoudl i create class within my GRAPH class for iterator oO
[11:45:02] <freeone3000> I'm sure there are, just like there are terrible programmers. It's just that professors tend to be several years behind on best practices and how a language is actually worked with.
[11:45:02] *** cyphorious has joined ##java
[11:45:20] <freeone3000> aless673: Because putting the iterator code in the actual class tends to be messy, and putting it in a separate class requires too manythings to be public.
[11:45:25] <ztj> freeone3000: that's because they have different goals entirely
[11:45:27] *** PhoenixSTF has joined ##java
[11:45:32] <ztj> which is why a person should not be coming here for questions from school
[11:45:39] <echosystm> you are wrong freeone3000... professors do research to ensure they keep up with new developments in the industry
[11:45:42] <echosystm> (lol)
[11:45:57] <ztj> teachers frequently "misuse" languages to show points and teach concepts
[11:46:00] *** gigabytes has joined ##java
[11:46:20] <ztj> aless673: it's very likely for you to be poorly served by getting advice from practicing programmers when you're doing schoolwork
[11:46:22] <freeone3000> echosystm: As one who works with research papers, I posit that familiarity with new algorithms and techniques has very little to do with how production code is written.
[11:46:34] *** m3asmi has left ##java
[11:46:38] *** gigabytes has quit IRC
[11:46:42] <aless673> im just doing extra workj
[11:46:53] *** MyWay has quit IRC
[11:47:04] *** gigabytes has joined ##java
[11:47:04] <echosystm> i was joking freeone3000 :P
[11:47:23] <aless673> no care from school if i fail this work =p
[11:48:53] *** m3asmi has joined ##java
[11:49:12] *** m3asmi has left ##java
[11:49:14] <aless673> otherwise, do you know how to fix eclipse for this problem: sometime the java process from eclipse go to 100% use CPU and i need to end it manually to stop this bug
[11:49:17] *** LouisJB has quit IRC
[11:50:06] <Cher> aless673: Is Sophos Antivirus running on the machine on which Eclipse sometimes uses 100% CPU?
[11:50:35] <aless673> Cher, no i am under Ubuntu with only firefox/xchat runing, nothing else
[11:50:46] <Cher> aless673: Ah okay. No Windows. Wise choice :)
[11:50:55] <squeakytoy> Cher: :'(
[11:51:10] <freeone3000> Cause eclipse is terrible.
[11:51:16] *** horte has quit IRC
[11:51:20] <squeakytoy> freeone3000: :'(
[11:51:24] <freeone3000> I mean, if it works, yay, go with that. If it doesn't work, use something else.
[11:51:27] *** horte has joined ##java
[11:51:32] <freeone3000> IDEA's a great candidate.
[11:51:32] <aless673> may windows nice for programming, dunno, i start programming on linux and still programming on it
[11:51:47] <freeone3000> Windows is great if you're a developer for *only* Windows.
[11:51:50] *** no_mind has quit IRC
[11:51:58] <squeakytoy> freeone3000: or web development
[11:52:04] *** m3asmi has joined ##java
[11:52:06] <Cher> aless673: Windows sucks for programming, unless you develop windows only - in which case it just sucks less.
[11:52:21] <squeakytoy> Guys, guys - seroiusly. You got proof of this?
[11:52:21] *** m3asmi has left ##java
[11:52:28] <squeakytoy> Why is Windows worse?
[11:52:36] <dreamreal> squeakytoy: FUD
[11:52:38] <Cher> squeakytoy: Yes I got proof. Because set -o pipefail doesn't work in cmd.exe.
[11:52:41] *** topriddy has quit IRC
[11:52:45] <aless673> ./join #OS-debate =p
[11:52:48] <dreamreal> people like unix more. justifiably. But meh, whatever
[11:53:03] <squeakytoy> Cher: So based on purely "pipe", Linux is beter?
[11:53:06] <freeone3000> squeakytoy: Depends on what you mean by that. Apache doesn't run well on it, Glassfish runs exactly the same, and for IIS, see poin.
[11:53:18] <freeone3000> Cher: The syntax is different. Windows does have named pipes. And also, use powershell.
[11:53:41] <freeone3000> (Yes, windows now has a proper shell. No, it's not a csh-dervative, so people are gonna hate on it anyway.)
[11:54:00] <Cher> The problem with pipes on windows is that if you run "foo | bar" you have no chance of getting the %ERRORLEVEL% of foo, you always get the %ERRORLEVEL% of bar. On bash and other shells, you have the choice, in bash you do set -o pipefail and you get $? from foo, not bar.
[11:54:03] <dreamreal> interfering with people's stupid biases isn't nice, folks
[11:54:22] <ztj> UNIX was specifically designed for software engineering purposes, it's natural for programmers to prefer it over windows which wasn't designed at all.
[11:54:23] <Cher> This is essential for large build systems to perform logging to files and terminal at the same time using tee without actually loosing the error level.
[11:54:26] <dreamreal> Cher: hmm, funny, set -o pipefail works fine for me on windows.
[11:54:34] * squeakytoy sighs
[11:54:35] <Cher> dreamreal: I guess you use Cygwin :)
[11:54:46] *** Sliker has joined ##java
[11:54:46] <dreamreal> sure
[11:54:51] <dreamreal> I also use ssh like maaaaad
[11:54:58] <Cher> dreamreal: But that means you "emulate" UNIX on Windows - just like I do. I wouldn't use Windows without Cygwin.
[11:55:00] <squeakytoy> Cher: Oh, "cygwin" isnt allowed
[11:55:02] <freeone3000> Why in the world would one use Cygwin? Just install the linux kernel as a windows kernel module. It's so much smoother.
[11:55:14] <squeakytoy> Cher: Using cygwin uses the best of the two world :-)
[11:55:38] <ztj> least hackish way to get unixy behaviors in windows is to use PowerShell
[11:55:42] <selckin> freeone3000: colinux? that actually works nicely?
[11:55:42] <Cher> squeakytoy: Is you mean "best" that it's less hassle to run World of Warcraft in Windows than it is to run it in Wine - then yes :-D
[11:55:43] *** jjido has joined ##java
[11:55:50] <freeone3000> selckin: It works better than cygwin.
[11:56:01] <ztj> if you want unix and you want WoW, then get a mac.
[11:56:03] <selckin> nice
[11:56:17] * squeakytoy is jumping out of the OS-war
[11:56:45] <freeone3000> I think I had to disable UAC, and some programs don't work, and there's not a decent package manager, but I think there's an Ubuntu distribution with similar goals now...
[11:56:58] <Cher> ztj: I would, if macs wouldn't suck so much to me. I don't like the Apple policy, I don't like the Java update cycles, and I don't like the keyboard of their powerbooks ;-P
[11:57:19] <Candle> ~ interesting
[11:57:19] <javabot> this is all very interesting (not really) but please take it somewhere else.
[11:57:41] <ztj> the "Apple policy?" Cher I think you're 2 arms short of an octopus
[11:59:16] *** Versuchen has joined ##java
[11:59:48] *** aless673 has quit IRC
[12:00:16] <freeone3000> Also, great news! Apple is no longer in charge of the Java update cycle! A committee of international corporations are, so it should go much smoother.
[12:00:35] <Cher> Oh, that's good. I didn't know that.
[12:00:48] *** cyphorious has quit IRC
[12:02:39] *** rigved has quit IRC
[12:03:54] *** neuro_sys has quit IRC
[12:04:18] <squeakytoy> freeone3000: isnt that like 2009 news?
[12:04:27] <freeone3000> squeakytoy: Yes.
[12:04:38] <squeakytoy> bowa! the nerd inside me knew that one
[12:04:40] <squeakytoy> oh yea
[12:05:14] <freeone3000> In a few months, it'll actually matter, as several hundred mac users will notice that their java will not be updated to 1.7.
[12:05:15] *** aless673 has joined ##java
[12:05:17] <aless673> re
[12:05:26] <aless673> The method hasNext() is undefined for the type List<NODE>
[12:05:33] <freeone3000> aless673: Right. It's defined on type Iterator.
[12:05:34] <aless673> ?_?
[12:05:43] <ztj> I'm pretty sure the only mac users that care about java at all are java developers at this point
[12:05:48] <ztj> who can compile openjdk
[12:05:50] <freeone3000> aless673: A List has a method which returns an iterator. A List is not an Iterator.
[12:05:52] <aless673> how to use hasNext on this List then ?
[12:06:02] <freeone3000> aless673: You don't. You use it on the Iterator which List.iterator() returns.
[12:06:06] <aless673> but u told me there is a default iterator
[12:06:13] <freeone3000> aless673: Yes. The one returned by .iterator().
[12:06:20] <Planck_> Heh, I've got 3 users on Macs in my workplace who use Java apps
[12:06:22] <ztj> it's not a "default" that makes no sense
[12:06:22] <Cher> ztj: Hmm. The mac java devs also have to care about their uses, resp. the availability of the JRE.
[12:06:24] *** cyphorious has joined ##java
[12:06:29] <aless673> but whe n i use for i do not need .iterator()
[12:06:33] <ztj> Cher: who deploys on macs?
[12:06:43] <freeone3000> aless673: Yes, because enhanced-for is magical.
[12:06:51] <Cher> ztj: Users?
[12:07:00] *** xiliax has joined ##java
[12:07:02] <aless673> for(NODE node : n.arc) parcoursProf2(node);
[12:07:18] <ztj> Cher: if you're doing anything besides back end work in java you're being silly
[12:07:24] <aless673> magical XD
[12:07:28] <aless673> i dont understand..
[12:07:41] <dreamreal> aless673: it creates an iterator and uses it internally.
[12:07:44] <freeone3000> aless673: "for(X x : foo)" is translated to "for(Iterator<X> $it = foo.iterator(); $it.hasNext(); ) { X x = $it.next(); ... }"
[12:07:47] *** no_mind has joined ##java
[12:07:49] <dreamreal> aless673: it also hides the iterator reference for you.
[12:07:58] <aless673> ho..
[12:08:13] <aless673> i thought i could use List. method from iterator
[12:08:15] <aless673> snif :(
[12:08:15] <Cher> ztj: Then call me silly... and put JetBrains on that list, too :)
[12:08:42] <ztj> Cher: developer support can be excused from the silliness, but I think I already have effectively called you silly, haven't I?
[12:09:04] <aless673> then to replace List.isEmpty() i need to define a Iterator<NODE> it=List.iterator(); Right ?
[12:09:12] <Cher> ztj: I think for a small program with a GUI which needs to run on Mac, Windows and Linux, Java isn't a bad choice.
[12:09:15] <aless673> and then use it.hasNext();
[12:09:26] <freeone3000> aless673: Why would you replace List.isEmpty()?
[12:09:44] <ztj> anyway, oracle will release java 7 for mac, so I'm not sure of the point of this concern anyway
[12:09:59] <aless673> freeone3000, you told me use iterator is better
[12:10:08] <freeone3000> aless673: The iterator is better when the iterator is clearer.
[12:10:44] <aless673> i talk 30 min to told u there was no use and u 30 min to told me there are (but in reality only for is usefull for a list)
[12:10:47] <aless673> rofl
[12:11:10] <aless673> i was right, iterator has no use on a ArrayList (just the for usefull)
[12:11:24] <echosystm> jesus christ, still with the iterators?
[12:11:31] <aless673> ^^
[12:11:35] <echosystm> aless673: iterators are useful even on arraylists
[12:11:40] <dreamreal> echosystm: they're confusing!
[12:11:44] <freeone3000> Magnets, how do they work?
[12:11:50] <echosystm> lol
[12:11:53] <echosystm> aaha
[12:11:58] <aless673> why should i use an iterator on ArrayList (except the case of for)
[12:12:00] <aless673> tell me !
[12:12:14] <echosystm> ok, heres one example
[12:12:15] <ztj> aless673: EASIER TO READ. Haven't you been paying attention?
[12:12:42] <dreamreal> they're not easier for him to read, because he's clueless
[12:12:58] <ernimril> aless673: if you do not like them then do not use them
[12:12:59] <echosystm> Iterator<String> it; while (it.hasNext()) { if (it.next().equals("something")) it.remove(); }
[12:13:06] <echosystm> have a think about that for a few minutes.
[12:13:07] <aless673> ztj is Iterator.hasNext() easier to read than List.isEmpty()
[12:13:08] <aless673> ?
[12:13:18] <dreamreal> heh
[12:13:21] <Cher> aless673: Yes, definitely.
[12:13:23] <dreamreal> "is red better than orange?"
[12:13:29] <echosystm> yes.
[12:13:30] <aless673> XD
[12:13:35] <echosystm> red is empirically better
[12:13:36] <aless673> bad english sorry ^^ i try do the best
[12:13:53] <ernimril> aless673: classes are tools, you use whatever tools that you need
[12:14:08] <Cher> aless673: Using two different variables (list vs. iterator) to modify / query the same data structure inside a loop makes the loop hard to understand and maintain.
[12:14:08] <aless673> Cher where it is easier?
[12:14:23] <freeone3000> The one where you type less.
[12:14:27] <aless673> i told you EXCEPT loop
[12:14:46] <dreamreal> yeah, look at aless673 getting all snippy
[12:14:53] <dreamreal> you idiots just don't understand
[12:14:53] <aless673> hasNext is same lentgh as isEmpty
[12:15:13] <aless673> there are no type less ^^
[12:15:25] <Cher> aless673: I can't remember you told me, sorry. When I'm not iterating, I wouldn't use an iterator ;-D
[12:15:34] <dreamreal> and now we've gone from lines of code to individual characters
[12:15:44] <echosystm> aless673: you do realise hasNext() and isEmpty() do completely different things right?
[12:15:53] *** jjido has quit IRC
[12:16:13] <ztj> aless673: if you're not ITERATING why would you even be THINKING of using an ITERATOR? Get a french/english dictionary or something if you don't get these words.
[12:16:54] <aless673> ztj, i just ask what the use of use iterator on this case
[12:17:03] <ztj> if it's a case where you're not ITERATING, it has no use
[12:17:08] <aless673> echosystm, it still used for same condition
[12:17:32] *** cyphorious has quit IRC
[12:17:34] <echosystm> no.
[12:17:35] <echosystm> rofl
[12:17:36] <aless673> ztj, i just ask it, u should answer that before ^^
[12:17:39] *** cyphorious has joined ##java
[12:17:42] *** Maknib has quit IRC
[12:17:52] <ztj> These are very simple concepts, apply your own brain to them
[12:18:19] *** Fuco has joined ##java
[12:19:12] *** gremmachook has joined ##java
[12:19:58] *** bitshuffler has joined ##java
[12:20:00] <gremmachook> I want to store a byte[] in a HashMap<String,Object>. When I retrieve it though, I do a (byte[]) cast, but I end up getting the HashCode for the object and not the byte[].
[12:20:13] <freeone3000> gremmachook: A byte[] *is* an Object.
[12:20:32] <gremmachook> Yes, but what about when I retrieve it.
[12:20:34] <freeone3000> gremmachook: Arrays do not override any methods from Object, and thus, use the default implementation.
[12:20:37] <dreamreal> hahaha
[12:20:49] <dreamreal> damn school
[12:20:57] *** aless67 has joined ##java
[12:20:57] <gremmachook> So I need to override something? I'm guessing..
[12:20:59] <freeone3000> gremmachook: This means that, shockingly, two arrays do not have the same hashcode, even if the contents are the same. Use the methods in Arrays.
[12:21:01] <FauxFaux> Are you sure you care about the hashCode() of something on the right-hand-side of a HashMap?
[12:21:07] <aless67> mhhh
[12:21:08] <ztj> gremmachook: wtf gave you that idea?
[12:21:15] *** neuro_damage has left ##java
[12:21:37] <dreamreal> every stupid question we've had on ##java that I've seen today has been school-related. Almost like schools get nothing but idiots in them, like a marker.
[12:21:39] <ztj> byte[] b = new byte[10]; map.put("x", b); byte[] c = (byte[]) map.get("x"); c == b
[12:21:40] <aless67> if i need to begin my loop (NODE node : node.arc) but at the second element, not the first of arc, how to simply do this?
[12:21:50] <dreamreal> "Look, there's a dummy! Let's send him to college!"
[12:22:03] *** aless673 has quit IRC
[12:22:19] <aless67> dreamreal, at school you learn, then it is normal to have stupid people at school
[12:22:23] <ztj> aless67: iterate over the sublist of concern
[12:22:27] <gremmachook> ztj, I am doing that, yes.
[12:22:36] <aless67> ztj, i dont understand
[12:22:36] *** jjido has joined ##java
[12:22:39] <ztj> gremmachook: then you have no issues, congratulations
[12:22:47] <ztj> ~javadoc List.sublist(*)
[12:22:47] <javabot> ztj: http://is.gd/cIfd9d [JDK: java.util.List.subList(int,int)]
[12:22:54] <dreamreal> hahaha
[12:23:40] <gremmachook> ztj, But when I get it back, I get the HashCode and not the (byte[]).
[12:23:54] <ztj> gremmachook: bullshit
[12:24:06] <gremmachook> Let me just check that again.
[12:24:12] <gremmachook> I'll be right back.
[12:24:16] <dreamreal> heh
[12:24:31] <gremmachook> dreamreal, Mercy.
[12:24:31] <ztj> odds are you are doing something else that is causing your issue (like foolishly implicitly converting to a String)
[12:24:35] <dreamreal> yeah, you may want to check that again.
[12:24:51] <dreamreal> gremmachook: no need, I don't think poorly of you
[12:25:02] <aless67> ztj,
[12:25:05] <gremmachook> Your statements speak something else/
[12:25:13] <ztj> there's no way to "accidentally" get a hashcode, you'd have to actually call .hashCode() but you could get a String that has the hashcode in it on accident with an implicit call to .toString()
[12:25:21] <freeone3000> It may have been the person in here for two hours now and yet to grasp that iterators are for iterating.
[12:25:30] <aless67> now for(NODE node : n.arc.subList(1, n.arc.size())){ is very more longer than for(i=0;i<n.arc.size();i++){
[12:25:51] <dreamreal> gremmachook: if you like, consider my humor to be a canary in a coalmine: "I'm amusing dreamreal, I must be doing something that makes it look as if I have no oxygen in my brain)
[12:26:30] <freeone3000> aless67: Uh. You want '1', not '0', in that second loop, for those statements to be the same. THere's some mild efficiency arguments for using #1 over #2, but heck, you'll figure those out.
[12:26:38] <freeone3000> aless67: It's really simple. Use it when it's nicer. Done.
[12:26:40] <ztj> aless67: they are two different conceptual models. Someday you'll understand when and why one is more appropriate than the other. You're having a conflict akin to wondering why someone would EVER use a 10mm wrench when they already have a 12mm wrench.
[12:26:58] <freeone3000> ...I don't understand why either.
[12:26:58] <aless67> now for(NODE node : n.arc.subList(1, n.arc.size())){ is very more longer than for(i=1;i<n.arc.size();i++){
[12:27:06] <aless67> it was a mistake
[12:27:22] <dreamreal> aless67: yes, it's all a mistake
[12:27:26] <dreamreal> oh, just that code, you mean
[12:27:35] <aless67> the 2 loop are the same now
[12:28:00] *** fisted_ is now known as fisted
[12:28:10] *** rainnighte has joined ##java
[12:29:56] <ztj> aless67: the purpose of such constructs is to enhance generic algorithm implementations such that you can do ONE implementation that takes any list, or any iterable, and have the tools necessary to link up various views as necessary of the common collections classes
[12:30:38] <discozohan> whats the difference between "byte" and integer, that i get from inputStream by calling "read()" ?
[12:30:50] <ztj> You can write a method that takes Iterable<String> or something and it will work when passed a List, Set, Collection, or the result of List.subList or Map.values() and so on
[12:31:51] <ztj> discozohan: it has to do with the fact that java has no unsigned byte
[12:31:52] <freeone3000> discozohan: The range possible. Java has signed bytes; it's impossible to differentiate a negative byte from an error condition. Thus, an integer is returned, for which all valid values are nonnegative, and error values are negative. You really want to be using the read(byte[]) method, though.
[12:32:00] *** aless67 has quit IRC
[12:32:25] *** bitshuffler has quit IRC
[12:32:35] <ztj> indeed, though if you absolutely must use the int read() then consider decorating your input with a BufferedInputStream
[12:34:26] <discozohan> ye, i know, thanks :)
[12:35:10] <ztj> So, Octopussy is the James Bond version of the classic tale of a man who screws is girlfriend then screws his girlfriend's mom. The rest is boilerplate.
[12:37:25] *** Johannes13 has quit IRC
[12:38:24] *** jjido has quit IRC
[12:40:42] <gremmachook> For the record, if I println() and pass a byte[], I should get the HashCode right?
[12:41:27] *** jjido has joined ##java
[12:43:07] <gremmachook> Like I said, "'" + ((byte[])map.get(string)) + "'" is my code, where I want to do this so that I can run a Query to store the byte[] in a my SQLite DB. So I'm guessing I get the HashCode because it's calling toString() on the byte[] ?
[12:43:39] *** moai has joined ##java
[12:44:17] <gremmachook> And the byte[] toString(), is the Object class's toString(), hence the HashCode?
[12:45:53] <gremmachook> ztj, ?
[12:46:03] *** elzoog has joined ##java
[12:46:27] <elzoog> Hey guys. I was wondering if it makes sense to do something like this http://pastebin.com/fcBm5fxT
[12:46:31] <ztj> Basically
[12:46:55] <elzoog> The eventual class will also have other things in it besides the first 100 prime numbers.
[12:46:58] *** iman has joined ##java
[12:47:18] <iman> are there any way to change class file when application is running ?
[12:47:26] <dreamreal> yes.
[12:47:38] <iman> dreamreal: framework
[12:47:38] <iman> ?
[12:47:41] <ztj> If you want to make a string out of the bytes and you know they can be decoded into a real string then use the String constructor that takes byte[] and an encoding name
[12:48:25] <gremmachook> ztj, Yes, I will try that.
[12:48:42] <gremmachook> Did I spot the error correctly?
[12:48:46] <freeone3000> iman: Yeah. You probably want JPF, or more likely, OSGi.
[12:48:55] <dreamreal> there are a fdew, sure
[12:49:26] <iman> freeone3000: or byteman , yes ?
[12:49:33] *** no_mind has quit IRC
[12:49:47] *** bitshuffler has joined ##java
[12:50:04] <freeone3000> That's one way. Perhaps not the best way.
[12:50:08] *** dpy has joined ##java
[12:50:12] <freeone3000> Dealing with bytecode is icky.
[12:51:00] <iman> freeone3000: thank you
[12:51:49] <gremmachook> ztj, Yes, thanks. But is it wise to store a byte[] in a database ( a BLOB )?
[12:52:07] <elzoog> freeone3000: I am thinking of doing bytecode for part of my math program. Reason is that I have (a*b) mod c where (a*b) might cause overflow. So I am thinking of having an array of size 2 of long to store the overflow so that I can calculate it without error
[12:53:03] <freeone3000> You could probably rewrite that expression such that the multiplication happens before. I forget my rules of dealing with equivilance classes, but giv eme a second.
[12:53:37] <freeone3000> Ah. Yes. http://stackoverflow.com/questions/763137/computing-ab-mod-c-quickly-for-c-2n-1
[12:53:48] <ztj> gremmachook: depends what you're putting there, the db itself, the size, and other factors
[12:54:09] *** gigabytes has quit IRC
[12:54:09] <ztj> gremmachook: but if it's a string encoded then placed in a BLOB, almost any RDBMS has a better place for that, even if it's just a CLOB or NCLOB or equivalent
[12:54:13] *** jjido has quit IRC
[12:54:40] *** bindaas has quit IRC
[12:55:02] <ztj> that said, there are often unspoken reasons for seemingly strange decisions so if it's some existing code, I'd be sure to look into all the details surrounding this before assuming it's bad or good
[12:55:06] <freeone3000> (Or http://en.wikipedia.org/wiki/Montgomery_reduction , for the more mathematically-minded)
[12:55:27] *** m3asmi has joined ##java
[12:55:48] *** servo has quit IRC
[12:56:13] *** riotz has quit IRC
[12:57:57] *** maxorator has joined ##java
[12:58:08] <gremmachook> ztj, Ok. I can store the image separately as well, on the SDCard, written as a file.
[12:58:19] *** jjido has joined ##java
[12:58:27] <elzoog> freeone3000: I can see how that method would work if a and b are ints, but what if they are long. For example, a = 9223372036854775707 and b = 9223372036854775807
[12:58:33] *** servo has joined ##java
[12:58:45] *** gelignite has joined ##java
[12:58:50] <elzoog> I mean b = 9223372036854775607
[12:58:52] <freeone3000> elzoog: It works the same, except the equivilance class is larger.
[12:58:57] <freeone3000> elzoog: Actually, no. It just works the same.
[12:59:47] *** jdolan has joined ##java
[12:59:51] <ztj> gremmachook: things like images are often best stored separately anyway as most static data retrieval systems are designed around caches (either provided in them or work well with separate ones.) Filesystems are no exception.
[12:59:57] <freeone3000> "Why" is a mathy question, and the wiki article explains it.
[13:00:04] <elzoog> Ok, I'll look at it deeper. I was thinking of making an array of int or long and put the overflow in the upper elements of the array
[13:00:31] <gremmachook> ztj, Oh, ok.
[13:00:36] <gremmachook> Thanks!
[13:01:55] *** Johannes13 has joined ##java
[13:02:24] <ztj> gremmachook: just remember that you give up transactional protection for actions like deleting or overwriting and you'll have to do things like manually check that the SD card is really there or the file is really there, etc. So there are some reasons to be wooed towards using the blob method. It's best to consider all options and their pros and cons.
[13:03:01] <gremmachook> ztj, Good point, that could be hassle, to check the SDCard, i.e.
[13:03:39] <gremmachook> I am actually capturing a Signature on a Canvas.
[13:04:38] <ztj> that could be a rather small amount of data if encoded properly
[13:04:48] *** nixness has quit IRC
[13:05:21] <gremmachook> ztj, What kind of an Encoding?
[13:05:45] <ztj> well I assume you're getting an image that probably consists of a single color line or beziers or whatever
[13:06:29] *** KermitTheFragger has joined ##java
[13:06:34] <ztj> if it's granular beziers, it might be easiest to just encode the parameters of that in vectors, or if it's a raster image then it might be easiest to store it as a monochrome gif or similar, even an 8bit bitmap would be pretty small
[13:06:35] <gremmachook> Yes, a single colored line, it is.
[13:06:53] <KermitTheFragger> hi all
[13:06:53] <gremmachook> It's more like a finger paint.
[13:07:06] *** jjido has quit IRC
[13:07:23] <ztj> gif is the most efficient image format I know of for very low color, sparse images
[13:08:01] <KermitTheFragger> i've got a question about extending the AbstractTableModel, calling fireTableDataChanged does not seem to trigger the view port to recalculate the scrollbar size
[13:08:15] <ztj> anyway, it's something to consider. if the size is consistently rather small, life may just be easier putting it in a BLOB
[13:08:18] <KermitTheFragger> i seem to be missing something simple
[13:08:30] <gremmachook> ztj, So I encode it into gif and then store it as a BLOB?
[13:09:09] <KermitTheFragger> gremmachook: you can also try skwish: http://skwish.sourceforge.net/
[13:09:41] <ztj> gremmachook: that would be one option yes. I couldn't really get more detailed without more knowledge of the existing APIs you're working with. And the resolution of the input, and other factors of course
[13:09:41] <KermitTheFragger> gremmachook: if you dont want to store it in a db that is
[13:09:43] <freeone3000> KermitTheFragger: .setTableFillsViewportHeight() is required for a JTable to take on its special JScrollPane behavior.
[13:10:46] <KermitTheFragger> freeone3000: thx, ill check that out immediately
[13:11:05] *** servo has quit IRC
[13:11:17] <gremmachook> ztj, I understand, I am building an Android app that will capture signatures. More over when I call new String(byte[]), I get gibberish like �PNG
[13:11:17] <gremmachook> 
[13:11:17] <gremmachook> etc. And then my query throws an error.
[13:11:31] <gremmachook> KermitTheFragger, I'll look at that.
[13:11:39] <ztj> then you're probably getting a PNG image, via whatever call you're making
[13:11:47] <ztj> which may or may not be efficient enough. How big is it?
[13:12:29] <freeone3000> Well, duh. It's not a String. Why are you treating it as one?
[13:12:53] <freeone3000> (Strings are not arbitrary collections of bytes. byte[] is an arbitrary collection of bytes.
[13:13:33] <m3asmi> how can I read from fiile data like : int [+-/*] float
[13:14:00] <KermitTheFragger> freeone3000: it didn't do the trick :( Basically my problem is that i modify the table model's backing data (so the getRowCount() changes) but the fireTableDataChanged call is ignored and the scrollbar is not recalculated
[13:14:16] <KermitTheFragger> as soon as i click on the scrollbar, it is recalculated correctly
[13:14:30] <gremmachook> ztj, Yes, it's a PNG image.
[13:14:43] <gremmachook> freeone3000, I need to convert it into a String so that I can form my Query.
[13:14:56] <gremmachook> i.e. append it with other Strings.
[13:14:59] <freeone3000> What sort of SQL query contains a PNG image? (Answer: The invalid kind.)
[13:15:09] *** jjido has joined ##java
[13:15:16] <KermitTheFragger> gremmachook: cant you just use a hash of the image ?
[13:15:23] <dreamreal> damn I hate daylight savings
[13:15:50] <ztj> gremmachook: you should not be forming queries by taking input and making query strings out of it. Use PreparedStatements
[13:16:25] <ztj> (and if you meant http query well that's something else entirely that should still not involve cobbling a png into another string)
[13:17:07] <freeone3000> But *can*. There's an entire subset of the protocol devoted to shoving stuff that doesn't traditionally belong into an HTTP query.
[13:17:27] <gremmachook> Not http, but SQL.
[13:17:38] <gremmachook> I'll look at a more direct way of storing.
[13:18:08] <gremmachook> KermitTheFragger, What kind of a Hash?
[13:18:37] *** tilerendering has joined ##java
[13:18:49] <gremmachook> Thanks for all you help guys!
[13:19:09] <KermitTheFragger> gremmachook: if you want a to find an image in the db, just store a hash of the image in the db, and hash the image that is provided by the user
[13:19:14] <m3asmi> !!!
[13:19:52] <gremmachook> KermitTheFragger, Does that mean I will be storing the image as a file separately?
[13:20:38] <KermitTheFragger> gremmachook: well personally i stopped storing blobs in the db because of the headaches they caused me (when making backups, etc.)
[13:20:50] <KermitTheFragger> but you could store the blob along side the hash
[13:20:57] <ztj> anticipated size is a major factor on this decision
[13:21:24] *** iman has quit IRC
[13:21:26] <ztj> whatever the case, if you actually try, you should be able to store a signature in a rather small image
[13:21:49] <gremmachook> So in my db, I have a blob and a hash? What is the hash for then?
[13:21:55] <KermitTheFragger> the only reason why you want to have blobs in your db is because its easy. Like the inserting of the image is in the same transaction as the metadata
[13:22:13] <gremmachook> KermitTheFragger, Yes. true.
[13:22:14] <KermitTheFragger> gremmachook: for finding the image later on, comparing if they are the same
[13:22:30] <gremmachook> I have another prmary key actually.
[13:23:01] <KermitTheFragger> i was (perhaps under the mistaken) impression you wanted to find an image in the db based on an uploaded image ?
[13:23:09] *** aless67 has joined ##java
[13:23:11] <aless67> re
[13:23:34] <gremmachook> KermitTheFragger, I am generating the image locally.
[13:23:58] *** jjido has quit IRC
[13:24:01] <aless67> guys i have a Class A within method static x. In an other class (in same directory) i call A.x but it returns error at compilation
[13:24:14] <dreamreal> heh
[13:24:15] <gremmachook> ztj, I can compress my Bitmap(Android) into png and jpeg. I don't mind if the image is a little lossy, I care about space a lot. What format should I choose?
[13:24:26] <gremmachook> between the two.
[13:24:28] <freeone3000> ~~ aless67 scope
[13:24:28] <aless67> but i should be able to use x without an instance of A
[13:24:28] <javabot> aless67, "A variable's scope is the region of a program within which the variable can be referred to by its simple name" - http://bioportal.weizmann.ac.il/course/prog2/tutorial/java/nutsandbolts/scope.html Also see http://mindprod.com/jgloss/scope.html
[13:24:55] <KermitTheFragger> gremmachook: ah right, well png also supports alpha transparency, i dont know if you need that ?
[13:24:58] <freeone3000> aless67: If it's in a method, it's not visible from another class.
[13:25:12] <gremmachook> KermitTheFragger, Nah, that won't be needed. I did think about that.
[13:25:32] <ztj> gremmachook: depends on how much control you have over the algo, png is very flexible. Your best bet though is to just try a bunch of combinations of algorithm and parameters to see how they size up... literally.
[13:25:34] <aless67> freeone3000, public static void function{} can be read anywhere no ?
[13:25:38] <KermitTheFragger> gremmachook: png is also less patent encumbered iirc
[13:25:40] <aless67> can be called*
[13:25:54] <freeone3000> aless67: Depends. Show the code.
[13:25:55] <KermitTheFragger> gremmachook: if i were you i would just do some tests, make some jpg, make some pngs and tweak it
[13:26:05] <gremmachook> Ok, I'll try it and be back.
[13:26:25] <aless67> http://pastebin.com/5A3xeXpX
[13:28:07] <freeone3000> aless67: Yep, that's visible.
[13:28:08] <aless67> why it return error "no method PARSE_EXPR in EXPR
[13:28:17] <aless67> ...
[13:28:25] <mischief> damn you concurrentmodificationexception!
[13:28:34] <freeone3000> mischief: Don't modify collections while iterating over them.
[13:28:54] <mischief> ohh. how do i avoid that?
[13:28:57] <freeone3000> aless67: Differing class versions, perhaps. Compile all your classes at the same time.
[13:29:02] * ztj wanders off to bed
[13:29:02] <echosystm> anyone here written a maven plugin before? its quitting immediately after my server is started up :/
[13:29:03] <freeone3000> mischief: ...Don't modify collections while iterating over them.
[13:29:30] <dreamreal> except through an iterator reference
[13:29:49] *** Johannes13 has quit IRC
[13:29:54] <KermitTheFragger> mischief: if you want to remove elements, just create a second collection, store the ones you want to delete there, after your done itterating, remove them from the collection
[13:30:05] <KermitTheFragger> mischief: thats one solution out of a possible thousand :)
[13:30:14] *** jjido has joined ##java
[13:31:29] <mischief> thats exactly what i did! lol
[13:31:44] *** bindaas has joined ##java
[13:32:47] <KermitTheFragger> mischief: well not correctly i'm afraid :) paste your code in a pastebin so we can take a look
[13:34:02] *** deSilva has joined ##java
[13:34:18] <mischief> http://slexy.org/view/s2zq0W1NYL
[13:34:21] <mischief> like that?
[13:34:56] *** marens has joined ##java
[13:36:33] *** Pinas has joined ##java
[13:36:36] *** jjido has quit IRC
[13:36:47] *** neuro_sys has joined ##java
[13:37:07] <Pinas> is it ok to ask question concerning tomcat+java servlets ??
[13:37:14] *** srm has joined ##java
[13:37:15] <dreamreal> ~ask
[13:37:15] <javabot> The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
[13:37:45] <Pinas> jut thought that this might not be allowed because of "No applets"
[13:37:55] <dreamreal> servlets != applets
[13:38:02] <dreamreal> thus the different name and everything
[13:38:08] <Pinas> :)
[13:38:35] <KermitTheFragger> mischief: I doubt a synchronizedMap is safe if you grab a reference to the backing set of the synchronized map
[13:38:37] <Pinas> can someone tell me why i alway get a 404 error when calling localost:8080/TestServlet/ --- my web.xml looks like this http://nopaste.info/8754512da7.html
[13:38:54] <mischief> it seems safe
[13:38:55] <dreamreal> what's the context name
[13:39:07] *** Error404NotFound has joined ##java
[13:39:37] <Pinas> i am really freaking out if i dont even can run a testservlet *args*
[13:40:01] <dreamreal> Pinas: what. is. the. context. name.
[13:40:07] <KermitTheFragger> mischief: your using 3 synchronized maps/lists etc. atomic + atomic != atomic
[13:40:17] <mischief> so what do i do ^^
[13:40:19] <Pinas> sorry what context ???
[13:40:29] <KermitTheFragger> mischief: i would use manual synchronization in your situation
[13:40:58] <dreamreal> Pinas: and there's your error. Web applications have contexts. When you deploy foo.war, the context is normally "foo" although you can map it differently.
[13:41:08] <dreamreal> So http://localhost:port/foo/TestServlet
[13:41:16] *** m3asmi has quit IRC
[13:41:17] <mischief> KermitTheFragger, im using events and threads. i might have some synch issues now :p
[13:41:28] <Pinas> oha so I definitley need a war file ?
[13:41:41] *** m3asmi has joined ##java
[13:41:48] <KermitTheFragger> your having them, otherwise you would have the concurrent modify exception :)
[13:41:54] <dreamreal> Pinas: no. But unless you're deploying in the root webapp, you have a context. Use the tomcat manager app. It tells you the context names.
[13:42:09] *** m3asmi has left ##java
[13:42:13] *** jjido has joined ##java
[13:42:15] <KermitTheFragger> the synchronized maps,sets,etc are great for simple scenarios where you just need one list/map/etc
[13:42:29] <KermitTheFragger> but for the more complex cases I always do it manually
[13:43:07] *** Error404NotFound has quit IRC
[13:43:38] *** Ivellina has quit IRC
[13:44:41] <Pinas> in the manager app i just see /testServlet
[13:44:52] <dreamreal> what directory is web.xml in?
[13:45:00] *** Error404NotFound has joined ##java
[13:45:36] *** benJIman has quit IRC
[13:45:53] <dreamreal> Pinas: *sigh*
[13:46:12] <Pinas> /usr/local/apache-tomcat-7.0.8/webapps/testServlet/WEB-INF/web.xml
[13:46:21] <dreamreal> so the CONTEXT then is testServlet
[13:46:28] <Pinas> ah ok :)
[13:46:30] *** jjido has quit IRC
[13:46:33] <dreamreal> so http://localhost:port/testServlet/TestServlet or whatever
[13:47:04] <Pinas> holy sh** that works
[13:47:04] *** jjido has joined ##java
[13:47:23] <dreamreal> it's like maaaaaaaagic.
[13:48:00] <Pinas> jea java is some kind of magic for me (i prefer C and scripting languages :) )
[13:48:10] <dreamreal> yet java, too, is deterministic
[13:48:44] *** riotz has joined ##java
[13:48:49] *** yoshx has joined ##java
[13:48:52] <KermitTheFragger> Pinas: C and Scripting languages, do you also swear in the church ? :)
[13:49:29] *** rjohnson19 has joined ##java
[13:49:32] <Pinas> jea once, then the pastor threw me out :)
[13:49:50] * dreamreal needs to find a reason to use C again
[13:49:57] <Pinas> low level code :)
[13:50:07] <dreamreal> Pinas: everything I do is distributed lately
[13:50:13] <KermitTheFragger> dreamreal: nuclear fallout should do the trick ;-)
[13:50:21] <dreamreal> C doesn't work well when your deployment environment includes many OSes
[13:50:38] <Pinas> jea I know, still it is more fun coding in C
[13:50:47] * dreamreal shrugs.
[13:50:59] <KermitTheFragger> Pinas: i guess your also in to SM ? ;-)
[13:51:00] <siyb> Pinas: by fun you mean pain in the ass?
[13:51:24] <dreamreal> Like I said, I miss C
[13:52:54] <Pinas> no for real, when I started coding (just 4 years ago) we started with C (at university) and I really liked it
[13:53:05] <dreamreal> no reason not to
[13:53:23] <Pinas> well and then we switch to java and i was rally pissed :)
[13:53:31] <dreamreal> it's just that errors are very expensive in C, usually catastrophic based on their nature
[13:54:09] <KermitTheFragger> depends on the use, like dreamreal says, most of the projects just don't fit C
[13:54:33] <dreamreal> java's very good at surviving idiot programmers
[13:54:39] * dreamreal eyes Pinas
[13:54:39] <KermitTheFragger> and there are some projects that are in C where i wished they hadn't used it or at least C++ *cough* Asterisk *cough*
[13:54:53] <echosystm> dreamreal: C doesn't work well if your deployment environment includes one OS :P
[13:55:08] <dreamreal> echosystm: I dunno, like I said, i enjoy C
[13:55:15] <dreamreal> I just haven't had to use it in anger for a long time
[13:55:29] <dreamreal> Mostly when I do C nowadays it's to show my son how to do it
[13:55:39] *** jjido has quit IRC
[13:55:54] <echosystm> the only time i use C now is when i need to write an extension for <insert shitty flavour of the month scripting language>
[13:56:00] *** riotz has quit IRC
[13:56:34] <Pinas> well i mostly use python and perl an work, and now after about 2 years without java i have to do a (for me quite hard) java project for university
[13:56:41] <Pinas> s/an/at/
[13:56:43] <dreamreal> learning a new interfacing layer every month must suck
[13:56:46] <echosystm> i'm slowly turning all the C/perl fanboys at my work over to java
[13:57:01] <siyb> perl *brr*
[13:57:03] <echosystm> theyre slowly realising that dealing with C dependencies just isnt worth it
[13:57:07] <Pinas> hardly possible in av industrie :)
[13:57:08] <dreamreal> echosystm: they're discovering what performance is like, eh
[13:57:27] <dreamreal> Pinas: they have VSTs in Java now
[13:57:30] <echosystm> being able to use maven and just have it suck down the universe is a godsend
[13:57:37] <dreamreal> BBE's sonic maximizer is written in java
[13:57:57] <echosystm> we have so many problems with project x needing perl module y that depends on c library z... which won't compile on solaris
[13:58:07] <Pinas> vst ??
[13:58:20] *** pipeep has quit IRC
[13:58:23] <dreamreal> Pinas: sound processors
[13:58:30] <Pinas> never used :)
[13:58:34] <echosystm> wow
[13:58:35] <dreamreal> Pinas: never done a DAW?
[13:58:36] <echosystm> how?
[13:58:40] <dreamreal> Yet you say AV :)
[13:58:46] <Pinas> AV = anti virus
[13:58:50] <dreamreal> oh, that
[13:58:55] <dreamreal> AV to me is audio/video :)
[13:58:56] <echosystm> i didnt think java could really be used for realtime things
[13:59:06] *** eyesUnclouded has joined ##java
[13:59:16] <Pinas> oh sry for my bad explanation :)
[13:59:23] <freeone3000> There's a library, and a conversion project, but standard Java is not realtime.
[13:59:31] <dreamreal> echosystm: really? You don't know what realtime means, I guess?
[13:59:49] <dreamreal> java's very good at effective realtime if you know what you're about, even though it's not *real* realtime
[13:59:54] *** nixness has joined ##java
[14:00:00] *** Luc1fel has joined ##java
[14:00:09] *** flippo has joined ##java
[14:00:22] <echosystm> i made a vst once
[14:00:29] <echosystm> it was a filter
[14:00:36] *** Johannes13 has joined ##java
[14:00:40] <dreamreal> echosystm: *nod* what kind?
[14:00:49] <echosystm> i got the algorithm off musicdsp.org and then got bored :)
[14:01:24] <echosystm> DSP is osmething i would like to learn about in the future though
[14:01:54] *** echo_mirage has joined ##java
[14:01:54] <Terabyte> is there a way to check it Long.parseLong will work before attempting to parse it?
[14:01:56] <Pinas> i need a web.xml even if I use a war archive right ?
[14:02:06] <dreamreal> Pinas: yes
[14:02:27] <dreamreal> Terabyte: typical pattern is long longVal; try { longVal=Long.parseLong(string); } catch(...)
[14:02:35] <Terabyte> thanks
[14:02:39] *** jjido has joined ##java
[14:04:41] *** riotz has joined ##java
[14:05:38] <dreamreal> echosystm: holy cow, musicdsp hasn't been updated since 2004?!
[14:05:43] *** kriko has quit IRC
[14:06:04] *** _bugz_ has joined ##java
[14:06:55] <flippo> dreamreal, the source code entries are more recent than that
[14:07:17] <dreamreal> flippo: yeah, I see, but the site's kinda nonfunctional
[14:07:25] <dreamreal> definitely a potentially useful resource though
[14:08:06] *** gdoko has joined ##java
[14:08:16] *** gdoko has quit IRC
[14:08:23] <flippo> The News box is pretty silly looking
[14:08:42] <dreamreal> I wonder if he'd be interested in reviving the site
[14:09:13] *** BillyBobCraskin has joined ##java
[14:09:19] <Pinas> another question if you dont mind: If i export a war file (in eclipse) i get the war file itself and in the same directory a new directory structure (like TestServer/WEB-INF/classes/testServer/TestServer.class). what do i need the war file for if I have this whole direcotry structure (i alway thougt that the war file contains this structure just compressed in a file)
[14:09:39] <dreamreal> the .war file has everything you need
[14:10:17] <Pinas> but i still have to create the web.xml to reference the war file ?
[14:10:33] *** cyphorious has quit IRC
[14:10:55] <dreamreal> the .war file needs a web.xml of its own, sure
[14:11:10] *** jjido has quit IRC
[14:11:25] <Pinas> ok so i need to create this web.xml in the same directory as the war file ?
[14:11:31] <dreamreal> no.
[14:11:44] <dreamreal> jar tvf yourapp.war. It should have WEB-INF/web.xml
[14:12:21] <Pinas> oh ok so the war contains the web.xml
[14:16:43] *** bitshuffler has quit IRC
[14:17:40] *** jjido has joined ##java
[14:17:50] *** echosystm has quit IRC
[14:19:24] *** yoshx has quit IRC
[14:19:55] <mischief> hey.. how can i compare arrays returned from a factory if the arrays have shallow copies of each object every time?
[14:20:34] <dreamreal> compare the elements.
[14:20:52] *** benJIman has joined ##java
[14:21:41] <mischief> i cant cause its the same element
[14:21:53] <dreamreal> a.equals(a)==true
[14:22:23] <freeone3000> Arrays.equals() works better than trying to call .equals() on the actual array.
[14:22:39] <mischief> im converting the arrays to collections
[14:22:39] *** jaska^ has joined ##java
[14:23:11] <mischief> the problem is that the objects returned as a result are the same objects.. i need to basically capture the state of the objects. copy them.
[14:23:58] *** cyphorious has joined ##java
[14:23:59] <gremmachook> Ok, so I managed to store the image I think, when I look it up, I find something lik blob org.tmatesoft.sqljet.core.internal.memory.SQljetmemoryPointer@XXXXX
[14:24:10] *** lunatik210 has quit IRC
[14:24:12] <gremmachook> Is that how a Blob looks?
[14:24:54] *** lunatik210 has joined ##java
[14:24:59] <dreamreal> java.sql.Blob should show you how to access it
[14:25:53] <gremmachook> I am actually looking it up through a tool called SQLite viewer.
[14:25:58] <gremmachook> This is what it shows me.
[14:27:41] <freeone3000> That's what it looks like to that application, sure.
[14:28:13] <gremmachook> I was wondering if it's an error or is it how blobs are viewed?
[14:28:43] <freeone3000> It's not an exception.
[14:28:55] <freeone3000> It also won't be how your application will access it.
[14:29:23] *** iman has joined ##java
[14:29:25] <gremmachook> Ok, so there's another layer sitting between us?
[14:29:34] <freeone3000> Yeah. JDBC.
[14:29:42] <dreamreal> and sqlite viewer.
[14:29:53] <gremmachook> Cool.
[14:30:24] <iman> freeone3000: do you know that are there any java open source software like to implement a site like dzone.com
[14:30:46] *** jjido has quit IRC
[14:30:48] <dreamreal> iman: nothing has changed since yesterday.
[14:31:11] <iman> dreamreal: hi , http://java-source.net/
[14:31:48] <iman> dreamreal: do you know what is the name of type software like it ?
[14:32:19] *** gelignite has quit IRC
[14:32:37] *** neuro_damage has joined ##java
[14:32:49] *** benJIman has quit IRC
[14:32:56] *** benJIman has joined ##java
[14:33:01] <dreamreal> iman: not offhand. why not ask the admins?
[14:33:20] *** mxweas has joined ##java
[14:33:54] <iman> dreamreal: dzone admin ?
[14:33:57] *** srm has quit IRC
[14:34:10] *** kriko has joined ##java
[14:34:12] <dreamreal> is java-source.net a dzone site?
[14:34:19] <dreamreal> (dzone, btw, is mostly written in php)
[14:35:16] <iman> dreamreal: php and django, becuase java is heavy for this implementation
[14:35:54] <dreamreal> nah, it was just a shorter implementation path
[14:35:58] *** [[thufir]] has joined ##java
[14:36:05] *** epure_ has left ##java
[14:37:37] *** pen has quit IRC
[14:38:28] *** jjido has joined ##java
[14:40:10] *** pen has joined ##java
[14:40:50] *** jonkri has joined ##java
[14:44:44] *** Myth17 has joined ##java
[14:46:45] *** pipeep has joined ##java
[14:47:32] *** wanderingi has joined ##java
[14:47:47] *** frivol has joined ##java
[14:52:25] *** Somelauw has joined ##java
[14:52:37] <Somelauw> Is there some way to get java in an interactive mode
[14:52:44] <Somelauw> Like python and scala can be put in?
[14:52:54] <Somelauw> To quickly test small snippets of code?
[14:53:10] <dreamreal> bsh
[14:55:18] <Somelauw> Okay, I will instal bsh
[14:56:36] *** rjohnson19 has quit IRC
[14:56:44] <Somelauw> bsh is cool
[14:58:00] <Somelauw> Although it would be nice if you don't have to print every single item that you want to see.
[14:58:14] *** mxweas has quit IRC
[14:58:32] <Somelauw> 5 * 6 should just print 30 for example without a sys...
[14:59:41] <cheeser> no use whining to *us* about it.
[15:00:39] *** magentar has joined ##java
[15:02:06] *** matsebc has joined ##java
[15:04:26] *** kriko has quit IRC
[15:06:35] *** rjohnson19 has joined ##java
[15:08:23] *** magentar has quit IRC
[15:08:41] *** Crum has joined ##java
[15:08:43] <Crum> has anyone here familiar computation geometry problems? I'm trying to find an algorithm and datastructure for a circular range search in a 2d space.
[15:11:23] *** m3asmi has joined ##java
[15:16:18] <Somelauw> Also bsh seems to miss a lot of functions
[15:16:34] <Somelauw> System .out .format ( "%.2g" , 5.89 )
[15:16:39] *** LouisJB has joined ##java
[15:16:45] *** gkmngrgn has joined ##java
[15:17:11] *** dmiles_afk has quit IRC
[15:17:42] <Pinas> can comeone tell me how I can get the String "Test" if someone call localhost:8080/MyServlet/Test - Of course MyServlet is a java servlet running on a tomcat (Request is GET)
[15:19:00] <Pinas> i know that i have to override doGet() but what I dont know, is how to get the Test string
[15:20:38] <cheeser> ~javadoc HttpServletREquest
[15:20:38] <javabot> cheeser: http://is.gd/jSEi [JEE: javax.servlet.http.HttpServletRequest]
[15:21:06] <cheeser> getPathInfo
[15:21:35] <cheeser> or getRequestURI()
[15:23:08] *** cyphorious has quit IRC
[15:24:28] <Somelauw> System.out.format("%0.2f\n", 5.678)
[15:25:26] <Somelauw> What's wrong with that?
[15:26:59] *** iman has quit IRC
[15:28:03] *** Somelauw has left ##java
[15:28:43] *** RLa has joined ##java
[15:29:57] *** odinsbane has joined ##java
[15:32:04] <Pinas> merci :)
[15:41:24] *** Cymage has joined ##java
[15:42:05] <discozohan> Whats the best way to convert int to unsigned short ? :(
[15:42:51] <mescalinum> when the preferred size is known in the Component? in the Component constructor preferred size is 0,0
[15:43:05] <mescalinum> how do I know when component has initialized?
[15:43:40] *** riotz has quit IRC
[15:44:24] <odinsbane> discozohan: depends, considering there is not a 1 to 1 correspondance from unsigned short to int, it really depends on how the person intended the conversion to be done.
[15:44:59] *** rjohnson19 has quit IRC
[15:46:17] <odinsbane> discozohan: also since java doesn't have an unsigned short, what are you doing with your short that makes it unsigned?
[15:47:59] <discozohan> odinsbane: i'm learning java by writing socks5 server ;) There i have to response port number as unsigned short ( 2 bytes ), but InetAddress gives me an integer. Thats it
[15:48:56] <discozohan> a bit strange that java doesn't have native API to do that
[15:49:10] <odinsbane> discozohan: did you check Integer?
[15:49:31] *** Speed` has joined ##java
[15:50:29] *** TiLex has quit IRC
[15:50:38] <discozohan> odinsbane: what you mean ? Integer's "shortValue" method ? It returns signed short
[15:50:56] *** riotz has joined ##java
[15:51:12] *** m3asmi has left ##java
[15:51:41] <RLa> so what happens if you use int?
[15:52:03] <RLa> if you deal with binary protocols, you can write single bytes
[15:52:10] *** rainnighte has quit IRC
[15:52:25] <RLa> so write only two bytes of that int and it's fine
[15:52:38] <discozohan> RLa: ok, but how ? :)
[15:52:40] *** Bombstone has quit IRC
[15:52:52] <RLa> how what?
[15:53:10] <discozohan> RLa: how can i "write only two bytes of that int" ?
[15:53:22] <RLa> see write method on streams and bitwise ops
[15:53:38] <discozohan> ok, bitwise, as i expected ;<
[15:53:45] *** wanderingi has quit IRC
[15:53:56] *** jmotta has joined ##java
[15:54:23] <RLa> you get single byte using AND mask that only has set bits for octet you want
[15:54:37] <RLa> then you shift that octet into correct place
[15:54:46] *** surial has joined ##java
[15:55:06] <RLa> you can use hex integers for masks
[15:55:28] *** teralaser has joined ##java
[15:56:27] <RLa> also write some unit tests so you can test it
[15:58:19] *** BeholdMyGlory has joined ##java
[16:00:04] *** Matuku has joined ##java
[16:00:09] *** nixness has quit IRC
[16:01:30] *** jesmon has joined ##java
[16:01:58] *** webczat has joined ##java
[16:02:08] <webczat> Hey, what do you use in java to parse cmdline options?
[16:02:30] <dreamreal> gnu getopt works, as do some others
[16:02:32] <dreamreal> ~getopt
[16:02:32] <javabot> dreamreal, getopt is a java port of getopt: http://www.urbanophile.com/arenn/hacking/download.html - but it's not very java-esque (it mimics a C library), so it's not that easy to use. See also ~cmdreader for an alternative.
[16:02:56] <webczat> So nothing in a standard lib?
[16:03:36] <webczat> okay.
[16:03:52] <surial> ~cmdline
[16:03:52] <javabot> surial, what does that even *mean*?
[16:03:55] <surial> ~cmdreader
[16:03:56] <javabot> surial, cmdreader is a command line option parser for java. You define a class where each field represents a command line option, and cmdreader takes care of the parsing, returning an instance of this class. It's also capable of generating command line help automatically. MIT-licensed. http://github.com/rzwitserloot/com.zwitserloot.cmdreader
[16:04:06] <surial> webczat: Don't use getopt. It sucks ass. Use cmdreader or jcommander.
[16:04:09] *** Crum has quit IRC
[16:05:14] *** openpercept has joined ##java
[16:07:02] *** Fx21 has joined ##java
[16:09:39] <webczat> ~cmdreaderIs cmdreader/jcommander usually bundled in the program?
[16:09:40] <javabot> webczat, what does that even *mean*?
[16:09:45] <dreamreal> webczat: in java, almost every library is STANDARD.
[16:10:00] <dreamreal> the classpath is an integral concept. adding to it is normal.
[16:10:26] <dreamreal> deciding arbitrarily that if something doesn't come with the JRE, it's not valid for use... that's just silly
[16:10:32] <webczat> dreamreal: But I need to write the program to ensure I won't depend on anything except the jre.
[16:10:41] <dreamreal> webczat: right. Welcome to the classpath.
[16:11:04] <dreamreal> If you can't use ANY external jars, well, you're clearly in school and thus don't matter
[16:11:04] <webczat> cmdreader is not in jre so installing it is still required
[16:11:21] <dreamreal> you don't install it. You download it.
[16:11:26] <dreamreal> The classpath has a reference to it. Done.
[16:11:52] *** Nikelandjelo has joined ##java
[16:12:12] <webczat> actually, I don't think that I really need options for this program.
[16:12:58] <surial> webczat: I don't think you understand.
[16:13:04] <dreamreal> *nod* however, the failure of your concept of "extensions" is already apparent.
[16:13:30] <surial> webczat: You ship your app / library / whatever in a way that ALL dependencies are bundled in (or fetched automatically, usually that's the way to go for libraries). In any case, the end user never has to go out and download extensions by themselves.
[16:13:40] <surial> webczat: Also, any programmer that is unwilling to add libraries is not welcome here.
[16:14:02] <webczat> I know how I use extensions. but I don't want any requirement for any user to make him download that extension.
[16:14:03] <dreamreal> surial: yeah, mostly because at that point they're too stubborn and/or useless to help
[16:14:04] <surial> webczat: As 99% of our suggestions are along the line of "It's been done. Well. Use this library."
[16:14:14] <dreamreal> webczat: what part of "the user doesn't download it" did you not get?
[16:14:18] <surial> webczat: FOR FUCKS SAKE. Users DONT have to.
[16:14:33] <surial> webczat: Perhaps you don't know how to use extensions.
[16:14:52] <webczat> I know about those 2 entries in jar manifests too
[16:15:05] <freeone3000> Jar manifests. Ick.
[16:15:10] <freeone3000> Also, two?
[16:15:37] <webczat> hmm, one or another, one adds something to the classpath, another one can download the jarfile automatically
[16:16:17] *** askhl has quit IRC
[16:16:20] <webczat> And yes, I'm stubborn
[16:16:31] <dreamreal> iand stupi^W^W
[16:16:57] <surial> webczat: What are you using to build your app? ant? maven? gradle?
[16:17:06] <webczat> ant
[16:17:25] *** m3asmi has joined ##java
[16:17:26] <surial> webczat: Just unjar the dependencies, then jar those plus your own class files into one big jar. That's one way.
[16:17:31] <m3asmi> unreachable statement !!!!
[16:17:37] <dreamreal> m3asmi: how about that.
[16:17:39] <surial> webczat: If you're writing a library and not an app you might want jarjar instead.
[16:17:58] <m3asmi> inc comilation
[16:18:06] <dreamreal> m3asmi: right.
[16:18:06] <m3asmi> compilation :(
[16:18:13] <dreamreal> m3asmi: so? fix it.
[16:18:16] <surial> webczat: And to find those dependencies you could use ivy at some point, but for now I guess you can just manually download the dependencies and put them in projectFolder/lib and adjust your ant file yourself. Either way, the actual users will never know.
[16:18:22] *** BSWolf has quit IRC
[16:18:30] <m3asmi> I don't know how
[16:18:38] <dreamreal> make the statement reachable.
[16:18:48] <m3asmi> how
[16:18:55] <m3asmi> int count=0;
[16:18:58] <dreamreal> by not having code that guarantees an exit before the statement.
[16:19:22] <m3asmi> I don"t inderstand
[16:19:26] <m3asmi> :'
[16:19:44] <dreamreal> m3asmi: look: void foo() { return; System.out.pritnln("woo!"); }
[16:19:45] <webczat> Actually, I really don't need options if I'll have a config file, but it depends.
[16:19:52] <dreamreal> do you understand why that println would not be reachable?
[16:20:06] <webczat> I mean if I'd set loglevel to debug somewhere or have a -D option to do that.
[16:20:07] *** riotz has quit IRC
[16:20:47] <dreamreal> webczat: *snrk*
[16:21:08] <dreamreal> m3asmi: well?
[16:21:09] <webczat> wtf?
[16:21:22] <m3asmi> I don't enderstand
[16:21:22] <dreamreal> webczat: nothing, you're just jumping into the m**** zone.
[16:21:34] <m3asmi> int count=0; ..... then I have return count ;
[16:21:41] <freeone3000> m3asmi: THen you have more code.
[16:21:47] <dreamreal> m3asmi: do you have anything in there that you're not showing us?
[16:21:54] <dreamreal> I mean, ..... won't compile
[16:22:10] <webczat> dreamreal: I saw both uses.
[16:22:19] <m3asmi> dreamreal m3asmi: do you have anything in there that you're not showing us?
[16:22:24] <dreamreal> webczat: i'm sure you did.
[16:22:42] <m3asmi> int count=0;
[16:22:42] <m3asmi>
[16:22:42] <m3asmi>
[16:22:42] <m3asmi> for(int i=0;i
[16:22:42] <m3asmi> for(int j=1;j
[16:22:43] <m3asmi> String ch1=vc.get(i),ch2=vc.get(j);
[16:22:43] <m3asmi> if(ch1.length()!=ch1.length()) continue;
[16:22:44] <m3asmi> else
[16:22:44] <m3asmi> if (areAnagrams(ch1,ch2))
[16:22:45] <m3asmi> count+=1;
[16:22:45] <m3asmi>
[16:22:46] <m3asmi> }
[16:22:46] <m3asmi> return count;
[16:22:48] <surial> Oh god.
[16:22:49] <freeone3000> ~topicsmite m3asmi
[16:22:49] <javabot> And the wrath of /TOPIC descended with terrible fury upon m3asmi. And all the people marvelled, saying, Behold, we too should read the /TOPIC, lest we be stricken. And all the people read the /TOPIC, and went away edified.
[16:22:49] <dreamreal> STOP PASTING!
[16:22:51] <freeone3000> ~pastebin
[16:22:52] <javabot> http://pastie.org - Paste the final url after you've pasted your stuff there.
[16:22:56] *** neuro_damage has left ##java
[16:23:03] <m3asmi> excuse
[16:23:20] <surial> freeone3000: if (x != x) ...
[16:23:39] <dreamreal> surial: hahaha
[16:24:03] <dreamreal> hee hee. The compiler MIGHT have even shown him that the line right after that was unreachable.
[16:24:11] *** odinsbane has quit IRC
[16:24:32] *** askhl has joined ##java
[16:25:03] *** eyesUnclouded has quit IRC
[16:25:35] <surial> dreamreal: Of course not. Think about it.
[16:25:43] <surial> dreamreal: Who says that .length() returns the same thing every time its called?
[16:26:06] <m3asmi> dreamrea:any Idea to fix it
[16:26:30] *** guidj0s has joined ##java
[16:26:44] *** Rissien has joined ##java
[16:27:04] *** riotz has joined ##java
[16:27:36] <freeone3000> Hey. That's not all your code.
[16:27:47] <flippo> Nice use of whitespace
[16:27:52] *** dmlloyd has quit IRC
[16:27:58] *** ormaaj has quit IRC
[16:28:07] *** ormaaj has joined ##java
[16:28:22] *** jor has joined ##java
[16:28:46] *** m3asmi has left ##java
[16:29:13] *** bearded_oneder has joined ##java
[16:32:18] *** gkmngrgn has quit IRC
[16:33:41] *** BSWolf has joined ##java
[16:36:35] *** deSilva has quit IRC
[16:37:24] *** tilerendering has quit IRC
[16:37:49] *** eyesUnclouded has joined ##java
[16:38:20] *** Agbeladem has joined ##java
[16:38:44] *** eyesUnclouded has quit IRC
[16:38:54] *** TzilTzal has quit IRC
[16:39:50] <Pinas> can someone please tell me why this: http://nopaste.info/94538ed771.html result on a 404 when calling this: "http://localhost:8080/EVSServer/ReceiveAndForward". The web.xml is at BASEDIR/EVSServer/WEB-INF/
[16:40:02] <Pinas> its freaking me out
[16:40:27] <Agbeladem> shouldn't it be localhost:8080/EVSServer/WEB-INF/ReceiveAndForward
[16:40:28] <Agbeladem> ?
[16:40:38] <Pinas> ?
[16:40:40] <selckin> no
[16:40:47] <Agbeladem> then never mind
[16:41:18] <selckin> you don't have a / on the end in your browser do you?
[16:41:37] <Pinas> nope, but i tried it with and without /
[16:41:42] *** m3asmi has joined ##java
[16:41:52] <selckin> restarted after editting?
[16:42:09] <Pinas> u mean tomcat ?
[16:42:33] <selckin> the whole data center
[16:42:33] <m3asmi> unreachable statement in :int c=0;
[16:42:50] <Agbeladem> m3asmi: pastebin?
[16:43:04] <Agbeladem> you must have a return before the instruction
[16:43:34] <Pinas> selcking - data center restartet nothing different
[16:43:37] *** Luc1fel has quit IRC
[16:44:11] <m3asmi> an other in for(int j=0...
[16:44:30] <Agbeladem> m3asmi: paste your code in pastebin
[16:44:46] <Pinas> s/selcking/selckin/
[16:45:11] *** Rissien has quit IRC
[16:46:53] <m3asmi> thinks loot
[16:47:03] <m3asmi> I resolve the problem :)
[16:47:13] <Agbeladem> sure you did :O
[16:48:55] *** openpercept has quit IRC
[16:49:30] *** xiliax has quit IRC
[16:52:35] *** [gunner] has joined ##java
[16:53:38] *** ventsislav has joined ##java
[16:55:09] *** c_axis has joined ##java
[16:58:57] *** gremmachook has quit IRC
[16:59:33] *** cyphorious has joined ##java
[17:00:38] *** discozohan has quit IRC
[17:01:37] *** m3asmi has left ##java
[17:03:15] *** irn has joined ##java
[17:04:49] *** eyesUnclouded has joined ##java
[17:06:46] *** SpaceDoG has quit IRC
[17:08:04] *** eyesUnclouded has quit IRC
[17:08:24] *** magentar has joined ##java
[17:10:24] *** squeakytoy has left ##java
[17:12:36] *** Gryphon_ has joined ##java
[17:12:55] *** platzhirsch has joined ##java
[17:13:37] *** Gryphon_ has quit IRC
[17:13:43] <Agbeladem> I'm using a heavyweight Canvas3D in a swing application and it's hiding my JMenu. However, I did "JPopupMenu.setDefaultLightWeightPopupEnabled(false);" before instanciating the menu and it doesn't seem to do the trick. Any ideas ?
[17:14:11] *** eyesUnclouded has joined ##java
[17:14:26] *** Pinas has quit IRC
[17:15:18] *** SpaceDoG has joined ##java
[17:17:12] *** horte has quit IRC
[17:17:59] <Fanook> have you confirmed that the popup menu is actually heavyweight?
[17:18:31] *** horte has joined ##java
[17:20:03] <Agbeladem> no, the canvas is
[17:20:07] *** cbeust has joined ##java
[17:20:18] *** meoblast001 has joined ##java
[17:20:22] <meoblast001> hi
[17:20:29] <Agbeladem> okay I've solved it (phew finally), I had to apply "revalidate" instead of "validate" in the container of my Canvas3D
[17:20:30] <Fanook> right...but your problem is that the menu appears to still be lightweight
[17:20:43] <Agbeladem> how come that worked ?
[17:20:47] <meoblast001> i'm looking at this code on oracle's website as an example: http://java.sun.com/developer/technicalArticles/xml/JavaTechandXML/#code14
[17:20:53] *** horte has quit IRC
[17:20:59] <meoblast001> it seems the DocumentBuilder is never initialized
[17:21:21] *** titankiller has quit IRC
[17:21:31] <meoblast001> does anyone know what i should initialize it to in that case, as DocumentBuilder appears abstract
[17:21:38] *** caverdude has joined ##java
[17:21:39] <freeone3000> You looked at that and thought it was a good idea?
[17:21:41] <freeone3000> ~xml
[17:21:41] <javabot> xml is like violence; if it's not working, you're not using enough of it. see http://www.w3.org/XML for more information on the "eXtensible Markup Language"
[17:21:42] <Fanook> meoblast001: no one in their right mind uses the built in stuff for parsing xml
[17:21:47] <freeone3000> ~xml parsing
[17:21:47] <javabot> Parse XML with - XOM @ http://www.xom.nu/ - JAXB @ http://java.sun.com/xml/jaxb/ - JDOM @ http://www.jdom.org/ - Simple @ http://simple.sourceforge.net/ - XStream @ http://xstream.codehaus.org/ - JAXP (incl. StAX as well as legacy SAX/DOM) @ https://jaxp.dev.java.net/ - JiBX @ http://jibx.sourceforge.net/index.html - DONT use SAX or DOM unless you like pain. Those APIs suck.
[17:21:54] <freeone3000> And most of those can generate, too.
[17:22:09] <meoblast001> ah
[17:22:18] <meoblast001> which do you guys recommend for DOM?
[17:22:58] <Fanook> read the factoid again, then ask your question if you don't have an answer
[17:22:59] <freeone3000> Building as "sax" makes no sense. I use XStream, mostly.
[17:23:47] *** eyesUnclouded has quit IRC
[17:24:19] *** pantokrator has joined ##java
[17:24:52] <meoblast001> hm, ok, don't want pain
[17:25:23] <ronr_> but that goes against the explanation of xml.
[17:25:39] <meoblast001> hm, i know back in Python land, with lxml, i liked the XPath thing
[17:25:40] <meoblast001> that was nice
[17:25:49] <freeone3000> But XML Is the best way to create custom document languages.
[17:26:05] <freeone3000> Uh, future-compatable, heirarchial, custom document languages.
[17:26:22] <Agbeladem> =) true
[17:26:22] <ronr_> ~python
[17:26:23] <javabot> ronr_, python is a dynamic object-oriented programming language . It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. If you wish to use python on the JVM, please check out Jython at #jython and http://www.jython.org/
[17:26:36] *** pipeep has quit IRC
[17:26:38] <meoblast001> nah, i'm not looking to use Python >.<
[17:26:47] <meoblast001> i'm just wondering if any of those libraries have XPath support
[17:26:50] <ronr_> wasn't talking to you, though
[17:26:56] <ronr_> you're not at the center of this channel.
[17:27:01] <meoblast001> ooh, i thought you were since i mentioned Python
[17:27:22] <ronr_> that may be a big part of the problem.
[17:27:37] *** platzhirsch has left ##java
[17:28:08] *** pipeep has joined ##java
[17:29:37] <freeone3000> ~xpath
[17:29:38] <javabot> freeone3000, what does that even *mean*?
[17:29:46] <freeone3000> meoblast001: Answer tends to be yes.
[17:30:22] <freeone3000> Heck, there's even a library for XPath with JAXB, despite it being for dumb conversion of schema to objects.
[17:31:02] <meoblast001> it also seems like a lot of the javax stuff is on Android
[17:31:18] <meoblast001> i'll probably be considering Android in the future for this project
[17:31:42] <meoblast001> so, in that case, would it be best to stick with the standard stuff?
[17:32:13] <freeone3000> No, it'd be best to find a library which also works on android.
[17:33:27] *** bitshuffler has joined ##java
[17:33:40] <siyb> meoblast001: the best way (imho) would be to create your own xml API that accesses an arbitrary xml library in the background, so that you can exchange libs if you like to (obviously, this is more work)
[17:34:11] *** pipeep has quit IRC
[17:34:22] <meoblast001> well, i won't be using XML all over the project, just in 2 or 3 places
[17:34:30] <siyb> meoblast001: the point is that android has its own xml facilities
[17:34:33] <meoblast001> so switching libraries wouldn't be too too tedious
[17:34:52] <siyb> meoblast001: still, encapsulating 3rd party code is always a good idea
[17:34:55] <siyb> (imho)
[17:35:38] *** Qation has joined ##java
[17:36:02] <Qation> Hi, on linux I can extract a .jar file into a directory with the unzip command right?
[17:36:09] <freeone3000> Qation: Yes.
[17:36:11] *** pipeep has joined ##java
[17:36:15] <siyb> meoblast001: http://www.ibm.com/developerworks/opensource/library/x-android apparently, SAX works fine with android#
[17:36:20] <Qation> Okay thats what I thought
[17:36:30] <Qation> but can I recompile it into a jar when its a directory?
[17:36:31] <freeone3000> I wouldn't be suprised if the other ones did, too. Well, slightly at XStream, but not at all at the rest.
[17:36:37] <freeone3000> Qation: Yes, with zip.
[17:36:37] *** homie has quit IRC
[17:36:46] <Qation> Oh okay
[17:36:49] <freeone3000> Qation: `jar` is preferred if it has a manifest, due to TOC issues.
[17:36:52] <Qation> it wont' but just a .zip?
[17:37:01] <freeone3000> Qation: Rename the .zip to .jar. Done.
[17:37:05] <Qation> oh
[17:37:16] <Qation> So a .jar is jsut a .zip..?
[17:37:20] <freeone3000> Yes.
[17:37:21] <Qation> but renamed
[17:37:31] <Qation> Oh thats makes sense then
[17:37:41] <Qation> thanks
[17:37:49] <meoblast001> siyb: is that referring to the built-in SAX? javax.xml.parsers.SAXParser?
[17:38:07] <siyb> meoblast001: read for yourself, i guess so
[17:38:10] <freeone3000> siyb: I'd agree with that, if Java libraries weren't already cross-platform, and most apps didn't spend most of their time patching together libraries.
[17:39:30] <meoblast001> oh, looking at the code, it doesn't seem to be including that.... although i did see it in the Android library API, so i can assume it's also there
[17:41:40] *** PhoenixSTF has quit IRC
[17:41:43] *** sebrock has joined ##java
[17:42:17] *** homie has joined ##java
[17:42:28] *** gmunk has joined ##java
[17:43:14] <siyb> freeone3000: well there is more to it than cross-platform. if i use a library i tend to create interfaces as i would like them to be and adapt them according to the library. it feels more consistent and in addition, i have a clear border, which i can also use to restrict functionality i don't want to be used
[17:43:25] *** eluctari has joined ##java
[17:43:54] *** mateobur has joined ##java
[17:43:56] *** eluctari has left ##java
[17:44:01] <mateobur> Hello
[17:44:14] <mateobur> how can I create a drop down Jpanel in swing ?
[17:44:28] <siyb> freeone3000: and it makes testing my code easier, since i can use mock implementations
[17:44:44] <freeone3000> mateobur: You mean a JComboBox, most likely.
[17:45:01] <siyb> or a normal menu
[17:45:20] <mateobur> freeone3000, no, it's like this messages where you can click, "see details"
[17:45:26] <mateobur> and then you have a panel with extra info
[17:45:49] <freeone3000> So you mean a panel with hidden content. Okay, CardLayout. One card has the "See details" label, one card has the extra info.
[17:45:54] *** Agbeladem has left ##java
[17:46:07] <freeone3000> Clicking the "see details" label flips the card in the CardLayout. Couldn't make it any simpler.
[17:46:08] *** jmotta has quit IRC
[17:46:24] <mateobur> freeone3000, that's what I'm looking for
[17:46:25] <mateobur> thanks!
[17:47:32] *** Fx21 has quit IRC
[17:48:03] *** Error404NotFound has quit IRC
[17:49:04] *** ventsislav has quit IRC
[17:51:17] <Fanook> the Swing Hacks book has an example of creating a spindown dialog or popup frames like Mac OS has too
[17:51:39] *** nmx has quit IRC
[17:52:07] *** Fx21 has joined ##java
[17:55:13] *** horte has joined ##java
[17:56:32] *** HardDisk_WP has quit IRC
[17:59:45] *** nmx has joined ##java
[18:05:48] *** guidj0s has quit IRC
[18:08:09] *** chandan_kumar has joined ##java
[18:08:28] *** Behold has joined ##java
[18:09:50] *** dob1 has joined ##java
[18:11:46] <dob1> hi, i have a File in a directory like c:\foo\bar\file i want to extract as String the bar directory name, the name of the directory where the file is, but just the "bar" in this example not c:\foo\bar\
[18:11:49] *** Qation has quit IRC
[18:11:52] *** BeholdMyGlory has quit IRC
[18:12:14] <dob1> how can i do this?
[18:13:04] *** frivol has quit IRC
[18:13:24] *** sebersole_ has quit IRC
[18:15:24] *** Bombstone has joined ##java
[18:15:53] *** yoshx has joined ##java
[18:16:01] <Fanook> ~~ dob1 javadoc File
[18:16:01] <javabot> dob1: http://is.gd/3okTU [Wicket1.4: org.apache.wicket.util.file.File]; http://is.gd/iHD3J [JDK: java.io.File]
[18:16:12] *** lunatik210 has quit IRC
[18:16:14] *** gmunk has quit IRC
[18:17:02] <ojacobson> dob1: that'd be the name (getName) of the parent file (getParentFile) of your file
[18:17:09] <ojacobson> assuming it's already in that form
[18:19:41] <dob1> ojacobson: what you mean with "assumin it's already in that form" ?
[18:20:22] <ojacobson> Assuming you have new File ("C:/foo/bar/file") and not, say, new File("file")
[18:20:24] <ojacobson> or any equivalent
[18:21:20] <dob1> i don't get the difference, once you have created the file object it points to a file, not?
[18:22:49] *** winux has joined ##java
[18:23:12] <ojacobson> Some File objects identify absolute paths (paths rooted at some filesystem root that are unambiguous) and some identify relative paths (which are relative to some base path - usually the current working directory).
[18:23:22] <ojacobson> An absolute path and a relative path can name the same file without being equal
[18:24:27] <dob1> and if you are in the second case, how do you do that?
[18:24:40] <ojacobson> by turning it into the first case, usually
[18:24:49] <ojacobson> It does rather depend on the results you want, though
[18:24:57] <Fanook> and there are methods on File for doing that, of course
[18:26:21] <dob1> it is getAbsoluteFile ?
[18:26:32] <dob1> of File class
[18:26:49] <Fanook> you tell us
[18:27:14] *** HardDisk_WP has joined ##java
[18:27:38] <mateobur> how can I insert an image in a Jpanel ?
[18:28:51] *** Matuku has quit IRC
[18:29:30] <Fanook> use a JLabel
[18:30:28] *** eyesUnclouded has joined ##java
[18:31:32] *** rchern has quit IRC
[18:31:32] *** webczat has quit IRC
[18:32:17] *** webczat has joined ##java
[18:32:35] *** caverdude has quit IRC
[18:34:14] *** rchern has joined ##java
[18:34:14] <dob1> seems this
[18:34:44] *** xil has joined ##java
[18:35:06] <xil> hi, is there a standard library for linear algebra in Java?
[18:36:02] <Fanook> not that I know of
[18:39:36] *** BSWolf has quit IRC
[18:40:13] *** nytek_ has joined ##java
[18:40:50] *** nytek_ has joined ##java
[18:42:09] *** X-Scale has joined ##java
[18:42:09] *** epalm has joined ##java
[18:42:50] *** nytek_ has quit IRC
[18:43:49] <Terabyte> I have a choice of retriving a Reader object or an 'asciiStream' (InputStream). either way I want to get a string, and I want to do it efficiently, there's a lot of these, so i presume i need to use a string builder. but i'm not sure which of these answers is the best. http://stackoverflow.com/questions/309424/in-java-how-do-a-read-convert-an-inputstream-in-to-a-string
[18:45:26] <ojacobson> What didn't you like about the various proposals on that page?
[18:45:36] *** yoshx has quit IRC
[18:47:32] *** BSWolf has joined ##java
[18:47:43] <Terabyte> the apparentl lack of character encoding by the highest answer...
[18:47:55] <Terabyte> number '28' looks nice...
[18:47:56] *** FatCookies has joined ##java
[18:48:01] *** [switch] has joined ##java
[18:48:09] <Terabyte> (reading the docs that are linked on it)
[18:48:20] <ojacobson> The top answer also considers encoding
[18:48:40] <ojacobson> It merely doesn't propose an encoding to use - and accepting the internet's advice on the encoding to use would be dumb anyways
[18:48:43] <Terabyte> ok i did wonder, there are comments talking about "+1 for considering character encoding" they must be for the previous ones.
[18:48:47] <ojacobson> You're best positioned to know what encoding to use
[18:48:52] *** pipeep has quit IRC
[18:48:59] <ojacobson> They're talking about that answer and only that answer
[18:49:11] <ojacobson> giving him credit for considering the encoding doesn't imply no other answer did the same thing
[18:49:20] *** eyesUnclouded has quit IRC
[18:49:40] <Terabyte> well the '46' answer seems to be different to '28'. is there one you would prefer?
[18:50:02] <Terabyte> rather why did people seem to prefer 46 to 28, they both produce a string from an input stream given an encoding..
[18:50:20] <ojacobson> I'd read the docs and then do the one that did what I wanted
[18:50:33] <ojacobson> In practice I suspect the results are identical, though
[18:50:35] <Terabyte> they both seem to do what I want. which is why after reading the docs i'm here asking
[18:50:37] <ojacobson> therefore: no preference
[18:50:40] <Terabyte> ok
[18:52:22] *** BSWolf has quit IRC
[18:53:45] *** pipeep has joined ##java
[18:54:40] *** horte has quit IRC
[18:56:46] *** choongii has joined ##java
[18:57:04] *** gmunk has joined ##java
[18:57:13] *** RLa has quit IRC
[18:58:31] *** [switch] is now known as switch
[18:59:34] *** BSWolf has joined ##java
[19:00:09] *** chandan_kumar has quit IRC
[19:00:26] *** jor has quit IRC
[19:02:51] *** xil has left ##java
[19:06:05] <mateobur> this is strange, I have a try, catch block, and the Exception enters the catch block, but it stills continues and prints in the terminal
[19:06:15] <aless67> hi guys
[19:06:22] <aless67> can i generate a makefile with Eclipse?
[19:06:24] <Fanook> ~~ mateobur show us
[19:06:24] <javabot> mateobur, Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems.
[19:06:32] *** bojo has joined ##java
[19:07:16] *** BSWolf has quit IRC
[19:07:18] <mateobur> http://pastebin.com/YW6CrbMa
[19:08:11] <ojacobson> aless67: using make(1) or any of its variants to build Java programs is way more trouble than it's worth. Use maven, or ant.
[19:08:45] <mateobur> this catch somewhat doesn't catch the exception
[19:08:51] *** switch has quit IRC
[19:09:48] *** BeholdMyGlory has joined ##java
[19:10:05] *** switch has joined ##java
[19:10:07] *** mazzen has joined ##java
[19:10:20] *** xiliax has joined ##java
[19:11:12] *** tilerendering has joined ##java
[19:12:31] *** neuro_sys has quit IRC
[19:12:58] *** neuro_sys has joined ##java
[19:13:14] *** Behold has quit IRC
[19:13:23] *** BSWolf has joined ##java
[19:16:28] *** BeholdMyGlory has quit IRC
[19:19:21] *** jjido has joined ##java
[19:19:34] *** lisak has joined ##java
[19:21:07] *** bitshuffler has quit IRC
[19:21:16] *** jtheuer has joined ##java
[19:22:01] <lisak> could anybody explain to me, how to set up java Logger for various classes from concrete package ? if I get this one and set it up Logger logger = Logger.getLogger("com.google.api.client.*");
[19:22:33] *** gelignite has joined ##java
[19:22:38] <lisak> there are conditions like this " Logger.getLogger(HttpTransport.class.getName()).isLoggable(Level.CONFIG); " in the library
[19:22:58] <lisak> HttpTransport is part of com.google.api.client.*
[19:23:14] <lisak> but different logger is obtained
[19:23:46] <lisak> so even if I set this one Logger.getLogger("com.google.api.client.*"); to DEBUG
[19:23:53] *** dmlloyd has joined ##java
[19:24:04] <lisak> Logger.getLogger(HttpTransport.class.getName()).isLoggable(Level.DEBUG); is false
[19:24:52] *** lunatik210 has joined ##java
[19:27:14] <webczat> Is using java.util.logging.* a good idea, or should I have my own logger thing?
[19:27:39] *** dmiles_afk has joined ##java
[19:27:52] <webczat> for server logging it's activity or so
[19:28:54] <cheeser> it's what glassfish uses
[19:31:16] <lisak> here is the question reformulated http://stackoverflow.com/questions/5291433/setting-up-java-logger-for-a-specific-package
[19:31:20] *** naquad has quit IRC
[19:31:31] *** GreYFoXGTi has joined ##java
[19:31:42] *** deSilva has joined ##java
[19:36:13] <mateobur> if I create a new Exception and add a String, the new String dissapears as soon as I throw the Exception, is this behaviour normal?
[19:36:22] *** riotz has quit IRC
[19:36:45] *** andrewfree has quit IRC
[19:36:49] *** javobiwan has joined ##java
[19:37:24] <SeriousWorm> what?
[19:38:06] *** RLa has joined ##java
[19:38:08] <mateobur> I have this Exception class http://pastebin.com/q6kbJXBG
[19:38:16] *** LadySerena has joined ##java
[19:38:27] <mateobur> but "mainError" is set to null when I throw the exception
[19:39:01] <Fanook> how are you constructing your ParseConfigException?
[19:39:51] <mateobur> http://pastebin.com/ZtP4XG1Y
[19:40:20] *** andrewfree has joined ##java
[19:41:03] <Fanook> okay, you're gonna have to pastebin a test case where you're seeing this behavior
[19:41:09] <Fanook> ~~ mateobur test case
[19:41:09] <javabot> mateobur, sscce is a minimal independently runnable program, which demonstrates the problem; see http://www.pscode.org/sscce.html for details and a HOWTO
[19:41:32] *** jjido has left ##java
[19:42:43] *** cmxiv has joined ##java
[19:42:50] <mateobur> Fanook, well it's just that before throwing it contains the String message, after throwing and catching it doesn't
[19:43:29] <Fanook> and your pastebinned test case will show this. It's not that I don't trust you. I just don't trust you.
[19:43:47] <mateobur> :)
[19:44:15] <Fanook> essentially, code doesn't lie or make assumptions. People do (even if they don't mean to)
[19:44:30] <mateobur> ok
[19:44:37] <mateobur> I will do one
[19:44:38] *** webczat has left ##java
[19:44:53] *** andrewfree has quit IRC
[19:44:54] *** webczat has joined ##java
[19:45:11] <webczat> Hmm sorry for that... Is it possible to make the program I'm running be daemonized?
[19:45:28] *** andrewfree has joined ##java
[19:45:47] <Fanook> threads inherit the daemon status of the thread that created them. Before you start them, you can change that status
[19:47:26] *** magentar has quit IRC
[19:47:33] *** ninja_sense has joined ##java
[19:48:53] <webczat> But the api doc says that vm exits when all threads become daemons
[19:49:45] <Fanook> no, it says the VM exits when all remaining threads are daemons
[19:50:52] <X-Scale> http://upload.wikimedia.org/wikipedia/commons/8/84/2011_tsunami_wave_height.jpg
[19:51:09] <X-Scale> ops..wrong window
[19:51:20] <Fanook> indeed. cool representation though
[19:52:28] *** titankiller has joined ##java
[19:52:29] <webczat> Fanook: but this means i must have at least one user thread...?
[19:52:51] <Fanook> correct. the thread running your public static void main() is always a user thread
[19:53:14] <webczat> But what if I don't want any user threads? I want to run something in the background.
[19:53:45] <Fanook> then you really want a service
[19:54:30] <webczat> So where/what?
[19:54:49] *** cheeser sets mode: +b *!*echelog@*.0.fullrate.dk
[19:54:49] *** echelog was kicked by cheeser (you're looking like a log bot)
top

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