http://cache.gizmodo.com/assets/images/gallery/4/2007/07/medium_838002600_a3601e705e_o.jpg (holy crap at the icam cars)
er whatever they are called
heh
i wish i coul dhave convinced my grandfather to buy about 100k worth of good stock when it was released
er google
wow total brain fart there...
good stock is good though!
findLoadedClass0 is native, where to look up its code?
openjdk has (almost) the full source to the jdk
~openjdk
ernimril, openjdk is http://openjdk.dev.java.net
^^^
do any IDE's any of you use currently implement a default constructor generator. given all variables in a class, create a no-argument constructor which initializes each variable to some default?
1) ide:s suck 2) why would you need such a constructor?
for a bean
what's suitable to parse config file lines in the form "option = value"? i tried Properties, but that's not suitable since it can't handle multiple "properties" which is needed for directives like "include = file" which there might be more than one of
"class Foo { private int bar=1; }" ?
that class has a default constructor and bar will always be set to 1 on construction...
tell me you use _SOME_ IDE?
why do you need a default constructor? it is implicitly there
emacs
no jde, no jdee, ...
oh crap - never used that, and when i did it was annoying
jde?
:P
never used it but when you did... makes sense.
class browser and other stuff...
heh
s the VM main source code open source or only the api?
is*
~openjdk
cheeser, openjdk is http://openjdk.dev.java.net
ok thx
class browsers tend to be unusable when you have 6k .java source files...
everything sun has the authority to opensource, did
ernimril, thanks that makes sense, just initializing them when defining them
go to the site and read the docs, download the code and have a look for yourself
i would use textmate if i could (windows here) and i am forced to use eclipse api hosting =\
i got in trouble for using VIM =\
i hate heavy weight IDEs
IDEA++
change job to someplace where they do not force you to use any tool
wish i could
ah ide vs notepad, i think we should all write code using 'echo' one line at a time into a file.
I used vim, then found it was more trouble then it was worth, vim is good for editing small things
if you do not have the authority to select your own tools you are in the wrong place
have you tried JDE with 6k java host files?
I have a set of working packages that I use in one web application that I want to basically share with another web application ... how do I go about doing this?
JohnnyMoons_ass
8^)=
not recently, no
have you?
cheeser, atleast you didnt use a pipe |
the job force where i live is small so until i can get my business started im kinda forced to work here =\
I'll have to check how many java files there are these days
they want me to use "myeclipse" because its the standard
and they dont understand that its just a bunch of plugins for eclipse. and when i showed them i already have all the plugins and got them for free they gawked at me
like i had done something illegal, its quite funny
anyways enough ide talk
im not either
Aradorn, by using the WTP tools?
JohnnyMoon yea
well, with myeclipse you're not paying for the plugins, per se, you're paying for the preconfigured environment
true cheeser
What's myeclipse?
but i dont use any of that stuff anyways
i dont even use the tomcat5 hosting eclipse plugin dealy, because i like having control
hm, no one knows how to resolve a relative path from a webapp?
so i start and stop tomcat using cygwin and have aliases for tailing etc...
only about 1300 files, but I don't think it would be a problem to go to 6k
jdolan_ what are you trying to do?
I've seen myeclipse before...
ok, it may have improved speedwise... what parts of it do you use?
I want very little, I want a full screen emacs with no toolbars, no menues, no nothings. I split the screen in 1-6 visible buffers (changing over time)
jump to definition of whatever is at point, show subclasses, show callers
usually about 200-300 buffers opened.. :-)
hi, When I get the Calendar.getDate() it returns the correct time zone without the daylight saving time adjustment, how can I make it check that?
yeah, same for me, but I usually use 5-6 frames with one buffer in each
Aradorn, i need to write a file to a relative resource path in my webapp.
I seem to get it.
jdolan_, one sec i have a line i used.
well, I just know where the other classes are so I just change buffer and search for the method. It can be slower in some cases faster in some (you know what subclass you want to go to)
so you need the path to your webapp right?
it's because a .swf file my webapp embeds needs a configuration .xml :-/
Aradorn, yep
It says "PDT" for me.
...oh wait...
jdolan_, try something like, String myPath = config.getServletContext().getRealPath("/");
i'll give you a _HINT_
look at Calendar's api hosting docs
if that doesnt work try "/nameofWebApp/" instead
JohnnyMoon, thanks -- gotcha
when you program against interfaces the "go to definition" tends to go to the interface and that is just bad...
jdolan_ try this pageContext.getServletContext().getRealPath("/") + "\\";
I did but could not catch that part, will look again, thanks
im not sure if that will give you exactly what you want or not
before() after() equals
but from what i understand it should
yes and no, you can then see the implementors of the interface
three methods that jump out at me
btw you may have to add the slash on the end depending on your server config
another things is that I also do C, some C++, perl, make and a few other things. If all modes work the same I am happier...
also, I suaully just switch to the correct buffer if it's open, but even with 200-300 buffers you osmetimes need to open new file, and that's considerably nicer with jump-to-definition or find-file-of-class
yes, I can see that
also, JDEE is a pain to set up, so I haven't started using it at home
well, one has to try different tools from time to time...
sometimes they work out, sometimes not
heh
yes, I tried Eclipse, liked the Java support, hated the editor, went back to emacs and missed the Java support
what i hate about eclipse is, sometimes when i copy a few method declarations, i cannot paste them in the same class or even in a new class file
i have to paste them one at a time or sometimes it wont even paste at all
its so annoying
DST_OFFSET returns 0 is my system settings wrong? I am sure that out territory is applying dst currently
it's open source so you can fix it
crap
from an org.w3c.xml.Document how do I get an xml file ?
Javabot has an entry on beer? Figures. Most of you are probably over 21 and find it one of the few ways to deal with idiots.
Transformer, DomSource, StreamResult
thanks
Hi, anyone know of a good natural language date parsing library
bah, I should not encourage xml usage... :-(
one that takes an expression like "six months ago" and converts it to a date
~tell cilquirm about joda-time
cilquirm, joda-time is an excellent date/time implementation for Java. http://joda-time.sourceforge.net
i don't think joda time has any natural parsing ability
You may have to write a class to do it yourself.
hmm DST_OFFSET returns 16 for me.
ZONE_OFFSET returns 15.
^^ MrKeuner.
anyone know of a good plugin for eclipse that allows you to automatically insert a Comment and have it formated to a few lines?
jblade, it's called ctrl-j
found what I wanted: System.out.println(document);
I didn't know that toString() was overwritten :-)
I would not count on that working for what you want...
didnt know that
it may work in your jvm, but it will not work for well in others...
ctrl + j does nthing?
I am _writing_ an implementation of Document. I was looking for the 'natural' way of doing it.
ctrl+j doesnt do anything
bah, alt+shift+j
still a bad idea, the next person to look at the code and needs to debug it will change toString...
oh
thats not what i am looking for though
I mean like so if I paste a huge ammount of text, it will make it into a formated comment for me
what about toXmlString(){...} and toString(){return toXmlString();}
having a toXMLString is ok, counting on toString() using that is bad.
I have seen to many bugs introduced by people chaning toString. Swing and renderers is a very good place to start looking for such breakage...
if you do such a thing, then at least add a big comment that say something like "// Do not change this method, used by ... "
if I develop a webapp is based on GPL'd Java libraries and get a 'fee for service' from people who access it over the web, but don't resell the software, does the GPL impose any obligations such as opening the code?
ask your lawyer
I thought the GPL required that code is always published when modified
only to the people who gets the binary
distribution or sale of the product is the key
getting _correct_ legal advice from irc is not something to count on
ask your lawyer
I would say that you are fine and you can keep your code to yourself....
You can charge for the distribution of GPL software.
if you use any GPL'd code (albeit from a library), you are legally obligated to release it under the GPL); hence why GPL is considered 'viral
'
As i've come to understand GPL
You'll have to release the code to the app, but you can still charge for its use as part of your service.
I'm not a lawyer, but that's my best understanding of it.
if you dont care about releasing the code of your app under gpl, then you should be fine either way. If you do care, follow ernimril's advice
you're right. I'll use Transformer
I guess if I am unethical, no one will know, right?
we already know...
the BSD license is far less restrictive
this is logged you know
this is a webapp we are talking about, no distribution of the app, just results (web pages) generated by the app...
Lets' say you make a java applet game that links GPL libs. The game's code will ahve to be released to the public. But I think you'll be okay to charge say for access to the site. I'm not sure if hte art and media of the game have to be released too, but the code definitely would.
anonymity is a good thing
you could release it but not publicise it, so no-one ever looks at it
don't use GPL -- what i know about it makes me _HATE_ it.
probably not on art and media.. I know ID released DOOM under gpl, but they still charge for levels and stuff
All it takes is for somebody run jad on it and you'd be slapped with a GPL violation
That's true.
they can't run anything on it if it's a hosted web-based app
like researchsoftware said, it's just down to his conscience. no-one will be able to tell it's derived from GPL cos they'll never receive a binary
So what's up with this, my java.exe process is supposedly using over 350mb of ram but JMP says heap is only at 127mb, does that make sense somehow?
the jvm mmaps native libs, they are not part of the heap
native bytebuffers are not part of the heap.
hm ok, I guess that means it's not my code (I have no native code) ?
the code for the jvm is not part of the heap
ok
still better be safe, imo.. whos knows, maybe they'll decide that the software is worth a lot of golden coins and sell it or something.
I have some crazy memory leak going on and am trying to figure it out, was hoping a profiler would be panacea but it's only further confusing me oh well.
yeah I agree. breaking a license is not a good basis for a business/product
so it can be ok... also note that ps/top usually have problems reporting correct values if you thread a lot and have multiple overlapping mmap:s
http://www.gnu.org/licenses/why-not-lgpl.html
this only happens under certain conditions, also it's in windows
ok...
and so far it's related to MS SQL jdbc drivers, so I'm gonna try mysql and see if the same code has the same problem ... *sigh*
running memory profiling is not easy...
clearly
thanks for the input
I think technically the art and media to a GPL program is something that the program "uses"
yes, but that's how to license libraries. Since you're using them, they have a well defined license (GPL or LGPL) so that debate shouldnt really both ya, i think
it gets easier over time...
but you really want to change to my new profiler... (but I guess you are stuck on java/1.4 or java/5)
well, as i said.. I know for a fact that that doom's engine is licensed GPL but I could never find the original levels for it anywhere. So had to pull out my doom cd.
if I can't make progress through deduction I'll try it on 1.6
if level info were also GPLed, I'm sure it'd had been posted somewhere.
The levels were not GPLd
"if the work is plain GPL, then running it as a web service doesn't count as conveying, so you don't have to distribute source (though it would be nice if you did) ... if the work is Affero GPL, then you have to make the source available to users of the web service (that is, those that pay
for the service)"
that's my point to svm_invictvs
Yeah, but over and above that.
You can still charge for access to the GPL software.
http://www.khelekore.org/jmp/tijmp/screens.shtml == check the memory usage image...that is my small proxy running...
i think it all boils down to the question: do you mind if you have to release source or not. If you don't, then you probably can go ahead and if someone asks you to, do it. If you do mind it, ask lawyer
regardless, you can charge for the web service.
Mainly because the GPL allows for you to charge for the distribution. A pay for access website is a form of distribution.
how did you learn all this shit?
you can clearly see that the jvm size is quite much bigger than the heap space
Right. The GPL doesn't restrict charging for distributing software (in fact, the FSF encourages it)
yes but in my case the jvm usually doesn't do this
even if you did have to release software you can probably still meet the letter of the law without meeting the spirit of it. e.g., obfuscating the source code so although people can compile from it, they find it near impossible to actually modify it
what shit?
Regardless, if you are doing this for your enterprise, it's best to spend some money on a lawyer to have him/her tell you what's best.
jvm
depends how valuable your source is of course, obfuscation wouldnt stop someone who really wanted to derive from it
i think that officially GPLv2 states that code needs to be legible or something like that...
the gpl vs lgpl debate is not recent. it's years old. feel free to discuss it all in ##licenses.
via the jvm spec?
whether you can just ignore it is a different thing, of course
oh ok. I wonder if 'legible' is defined though
How stable is gosling?
jvm spec, a few whitepapers, developing profilers...
not very atm
cheeser:
my unobfuscated code woiuld probably be considered illegible by some
once i finish up this bit with javabot, i'm going to return to it, though.
Anyone have any pointers or suggestions on how to execute an Oracle PL/SQL script from within a Java (JUnit to be exact) test class?
One of the things I'm tasked with is finding a build system for our project...we're lacking one for java...
do you mean generically, how do you call PL/SQL from Java? Or is there something special about doing it in a test case?
which is why I asked.
GPLv3 states: "The source code for a work means the preferred form of the work for making modifications to it."
make is very nice
i thought it was worded stronger in v2, but cant find it... :P
TomJ_: please take this to ##licenses
ugh, I know. Don't get me started.
I am trying to set up data in a few tables as part of a setup method using a script that a DBA already wrote instead of having to migrate the entire script into appropriate Java/JDBC calls. As in: in setup, read the script, execute it, wait for results back from Oracle, then continue the JUnit
test.
automake et al.
I am serious, it is what I use personally and it is what we use at work. It scales well from a few classes to 10k+ files
hola
you do not need auto*-stuff for java
I know...
I do use autofoo for my profilers though
(but that is mixed C and java)
gnu make?
Look at unitils
yes
the "gnu" is the problem.
this is the makefile for my small proxy: http://www.khelekore.org/~robo/Makefile2 it is very similar to what we use at work (big project)
unitils... thanks, I'll go take a look.
I'm playing around with Lucene and PDFBox. Both have .jar files I need to add to my javac -cp when I run and compile. Can I place the jars in a folder and export CLASS_PATH=that_folder to bypass having to specify the -cp every time? is there some location under JAVA_HOME that would be the
right place to put them? thanks.
WEbsite is blocked? Do you have pr0n on there or something
blocked?
no
The IT Gods here have deemed it inappropriate, heh.
it is my home server, it is adsl so the entire block could be blocked for reasons other than mine...
yeah
's all good ^_^
They're actually pretty unrestrictive here.
They dont' block myspace, heh
odd, if you have the chance then ask them why they block my site...
I would be very interested
write a shell script
I'll seee. It appears to not be websense here at work. It's some software taht all it says is "Request Blocked"
don't screw up your whole environment for one executable
there are no reasons given, etc.
is it filtering the contents?
cybereal so there isn't a default location where you dump .jars you want to use?
There's a fear or anything GNU at my company, make being gnu...
I had hoped that was what the classpath was for.
no it doesn't work that way
I dont' know how it works. I'd assume it's just searching the page for things that look fishy and not actualy using a blacklist.
that global classpath thing is an antiquity and should never be used
7,50 ¬; ADSL 2+ bis 16 MBit ab 95,20 ¬ ADSL ab 11,90 ¬
-cp somdir/*.jar
crap, sorry... wrong key
I've been reading old books
that supposedly works under 1.6 but i've not tried it.
I tried and the shell battled me, so I gave up because I didn't care
well, a makeifle have several things that are fishy in it...
if I wanted to bundle it all up in one file could I unzip the lucene and pdfbox jars and put them together in a single jar alone with my classes?
along with that is.
heh
gnu make for windows?
*work
does gnu make work well for windows?
works with cygwin...
Tahts' why I can't use it. It would require *everybody* to install cygwin. Of course it's okay if everybody were to install ant/maven
*everybody* being everybody int he entire company.
I thought there was one without cygwin, or at least, without much of cygwin...
O'Reilly use boring animals for their covers, unlike , say, http://www.planetacurioso.com/wp-content/uploads/2006/10/Almiqui1.jpg
The mkdirs() method in Java.IO says that it creates all directories, even the ones that do not exist. Is there a way to determine which of those files didn't actually exist?
File.exists
They use OPUS Make for the rest of the stuff here.
you can make the File object thatwould represent the final directory and then ascend its structure even though the directories may not be there, using .exists at each level until .exists() returns true
Thanks
just um, do it BEFORE you create the dir
cybereal
its not possible to perform "whois" commands while using the built in freenode client huh?
built in freenode client?
java.freenode.net
oh the applet.
its very nice actually
compared to what?
telnet?
Is there a channel to call about java applets?
*call=talk
the sun forums
I think javabot might need an update...
~tell me about java fx
researchsoftware, I guess the factoid 'java 2d image processing' might be appropriate:
researchsoftware, java 2d image processing is http://schmidt.devlib.org/ Good stuff for Java2d image processing / image manipulation / custom filters and classes / algos
~javafx
waz, I have no idea what javafx is.
hello
anybody home ^^
hey!
~forget st
I forgot about st, cheeser.
here someone can help me java nub question ?
~forget eflection
I forgot about eflection, cheeser.
~tell G1ta0 about anyone
G1ta0, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
omg talking bot!
i wonder, is it possible to create class with 'hidden typecast' or smth, w/o using methods or fields
like u know, example:
SomeClass x = New SomeClass(,,,);
int y = x; // x will return int
String z = x; // x return String
never had a chance!
another 'tard who can't read the topic.
assuming I have two File objects, and there file paths overlap. If one file object's path is a subset of the other, is there a way to delete all directories that they do not have in common.
cheeser, too many words. Not enough pictures.
you want to delete the directories? or just create a string such that only the common elements are there?
yeah. we'll have to fix that i guess
sleepster, one path is going to be contained entirely in the other, correct?
sleepster, so the directories that they do not have in common is going to be the parent directory of the one that is contained.
[are going to be the parents]
flippo yeah
flippo but there could be tons of parent directories
I was just hoping for a simple method to do it
but I guess I will have to create my own
sleepster, if you delete the parent directories, then you will have to delete the contained file as well
sleepster, it sounds like a very odd thing to want to do.
here i am again ^^
heres the pastebin http://pastebin.ca/625261
sleepster, a is a parent directory of b. So you must delete b and all parent directories up to, but not including a. That's what you want?
no. that's not possible.
yeah
that is what I want
sleepster, look at parent directories of a and b one by one until you figure which contains the other. All you need is getParent(). Doesn't sound very hard. It's too odd to be a standard function.
too bad, thanks
Is there a way to automatically paste comments in eclipse that will be formated so that one paragraph doesnt remain on one line?
G1ta0, that example would almost work if SomeClass were the class Integer. "Autoboxing" will convert Integer to int automatically, according to context. And in most String contexts, a class will have its toString() method called.
well, i just want to 'hide' this methods like .toString, .getInt, etc etc
"mist string contexts"? I thought this only happens when concatenatinating strings with +
in what other case does it happen automatically?
Duesentrieb, Hmm, can't think of one.
G1ta0, getInt() isn't so bad really.
G1ta0, it clarifies your intention and makes it easier for a reader to know what methods were used.
java is not c++. java is intentionally verbous.
verbose
maybe java have something like 'pointer' to assign some simpe type var like int, and if i change this assigned value to something in one place, it also be changed for actual var...wel u know, like pointers
G1ta0, like an int[] ?
G1ta0, or maybe like a class IntContainter { int myInt; }
Yksilibyksili bimmsalabomm
zArmon, sure.
hey, can anyone recommend a good decompiler?
we've got one version of an ap that's working
kaylee, I like jad
does anyone know if java has an interpreter like ruby irb somewhere?
me engrish sucketh. especially the spellinck
but the code in CVS does NOT match it....and is not working
so all we have is the classes of the wroking one
well if i have some vars like int x,y,z; and 'assign' 'put' in some class, and if i change this value in class methos - it also be changed for x,y,z
beanshell is probably the closest
not with primitives
you'd need a mutable wrapper
i guess what you want is an "int holder". the quick and dirty way is a one-element array, int[1]. Or write an entity-type class.
thanks
sure
in java, objectsand arrays are accessed via references (which is what you want), but primitives are copies of values (which you don't want). Integer would be the object equivalent to int, but it's imutable.
well, i need mostly floats and integers, int/floats with it independent live from containing this values/assignes class. i understand -- int - its where im stack
i come from Delphi to Java ^^ rewriting some project with 'old thinking' ^^
look at the holder pattern.
thank you all for help, i should visit this channel more often, now i knew rules ^^
and knowing is half the battle....
the other half is violence
GI Joooe
hi there
wow beanshell is cool
makes java fun again
bb
whats the java reflection way of getting all the methods of a class?
Beanshell used to be built into Eclipse, but I can't find it.
(It's hard to find anything in Eclipse.)
Does anyone have tips on debugging "java.lang.VerifyError: Wrong return type in function" exceptions?
ah class.getMethods
recompile everything.
some part of your code is incompatible with class files created earlier.
you could write one...
i have tried, but it's tricky. calculating the "distance" is not easy. it would be nice to have the compiler's algorithem in a standard api class.
the compiler source is all open...
(Just don't define a method foo(Object... stuff))
hehe
ugh. need coffee.
yea, duh.
i doubt it can be easily isolated.
okay
dotNET
hi
is it possible to do ORM only using standard EJB libraries (without tools like hibernate) ?
What's the short if for java again? if ? : something like that :P
huh? short if?
if (x) foo();
Yeah, forgot the syntax. if test ? outcome true; outcome fase;
Tertiary operator?
ah
condition ? truevalue : falseValue
yep thnx. With that word I googled it.
i always called it the ternary operator
me too. though there *could* be other ternary operators, in theory.
is it possible to do ORM only using standard EJB libraries (without tools like hibernate) ?
~ternary
cybereal, ternary is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op2.html
Ternary makes more sense
ternary is what it is
it's not a level of something but it does have three parts
no one for my question
How do I load a lazy @Entity field using em.createNativeQuery()?
i don't even know what ORM is
Object Relational Model
(or Mapping?)
Object relational Mapping
a relational database mapping?
ah
yes mapping relational databases to java objects
code auto generated with wsimport blocks on webservice calls and doesn't seem to respond to thread.interrupt
dotNET
that makes my code crappy
~tell j0pf about j0pf
j0pf, I have no idea what j0pf is.
~tell j0pf about .net
j0pf, I have no idea what .net is.
~tell j0pf about dotnet
j0pf, I have no idea what dotnet is.
sop
stop
Anyone here willing to help a rookie out with writing a junit test via PM
~tell j0pf about idea
j0pf, idea is a non-free (as in beer and speech) IDE held in high regard by the ##java community. http://www.intellij.com/idea -- check it out
~ide war
eclipse 0wnz
~tell jblade about junit
~start ide war
jblade, junit is a unit testing tool for java. See http://www.junit.org/
I guess the factoid 'backwards compatibility' might be appropriate:
the operative word in "backwards compatibility" is "backwards"!
~tell j0pf about being a cock
j0pf, I guess the factoid 'stop being a loser' might be appropriate:
j0pf, stop being a loser
Can one force the mouse cursor to display the busy state from java? Starting a new project in my app takes a few seconds, I would like to change the cursor while it's doing that.
~tell me about yourself, javabot
saksoz, I guess the factoid 'javabot desktoptd' might be appropriate:
saksoz, DesktopTD stats is http://www.handdrawngames.com/DesktopTD/GroupScoreboard.asp?group=##java believe dat
My google queries turn up nothing.
~tell me your problems
tell nick about factoid - you missed out the 'about', saksoz
~tell me about your problems
saksoz, I have no idea what your problems is.
~easy, dick
saksoz, I have no idea what easy, dick is.
~hahah sure you don't
I guess the factoid 'don't catch exception' might be appropriate:
saksoz, don't catch exception is http://findbugs.sourceforge.net/bugDescriptions.html#REC_CATCH_EXCEPTION and http://checkstyle.sourceforge.net/config_coding.html#IllegalCatch
~leave
doesn't java have a to_string method?
toString
saksoz, please use /msg javabot
ahhh
camelCase
gotta love it
toString()
oops. I'm to late.
too*
hm I thought CamelCase and innerCase
can someone here recoomend an open source webapp that has a horrible interface ?
Ah, found it, changing the cursor. http://www.devdaily.com/java/edu/pj/pj_hourglass_cursor/
Hm an open source web app with a horrible interface
Why?
trac used to hava a pretty piss-poor interface
oh and nearly every open source forum
just for a project I'm working on
a number of those webmail apps are pretty bad
\msg cybereal hi
looking for good candidates for rewrite of a pretty well used open source app
~tell j0pf about msg
rewrite of the interrface
WHERE ARE YOU?
don't msg please
\msg cybereal why not?
in case you didn't know, the backslash is a fake /msg
not an actual message
anyone use advanced installer to create msi for windows?
come on... there has to be a couple that come to mind right away....
you just look like a noob who can't type, actually
could be construed as various elements
and the "why" is irc etiquette, you don't privmsg before asking permission
oh yeah of course I must have forgotten
If I need to be ChanOp to ask JavaBot to return, then how did j0pf make him ~leave!?
you have to be chanop to do invites to a channel
Oh....
~leave is just a command that causes javabot to part the channel on his own
how do you get the java window back in eclipse
with packages etc..
\msg j0pf hi
"window: Show View"
(menu)
omg, can someone help, it doesn't work!
Then select Package Explorer.
what doesn't work?
my javas
just use IDEA
I need more than that.
haha, i'm kidding
dont underestimate the power of a crystal ball! :P
Or Mind Reading. Something you have to do when handed a program you didn't write.
StupiJ sucks
~ide war
j0pf made Javabot leave for an hour.
it wasn't on purpose
just the mention of IDEA scares him off
usually he doesn't obey me
That's still no excuse...
??
he will come baclk
ack
back
I an hour.
yeah
Who's the REXml guy?
Somebody just yelled at me for my java classes not having a desctructor.
WTF!
Java has destructors?
yes
Besides .dispose() ?
theres a finalize() thats called when something is collected
and the applet interface has a dispose/destory i think
Is there a method I can set up to be called when a program is terminated, System.exit(0) or otherwise?
look at shutdown hooks in Runtime
No, java doesnt' ahve destructors.
Somebody is just an idiot.
That's what I thought.
one thing! does java listen to unix signals yet
if you make your main to only generate instance of some class and ensure it's done only once, you can use the aforementioned finalize method
No, why do you need that?
I have a singleton class that logs to a file, and keeps it open during the duration of the program until I call .close() on the log class. I, being a good programmer woiudl like to be able to call .close() before the program shuts off.
tell a daemon to reload it's config files etc
would*
what about finally { }
um....
There are several ways you can accomplish that.
finally is only used to try catches.
no
AFAIK
it executes when the try{} ends
tell me a good way
Shutdown hooks, I think were mentioned.
you might be able to handle unix signals if you run your app with the java service wrapper
Well, JNI is one.
That's what I said.
Shutdown hooks.... ugh.
so isn't that what you need?
finally {} is used for stuff like that
No, finally isn't.
Finally is always guaranteed to excute in the case of an exception.
I don't need to try catch finally anything.
umm
svm_invictvs:
Click to email this message
Pretty much any resource should be released in a finally block. Additionally, you don't want any exception that that task might throw to propagate and change how the try statement (and, usually, your method) completes. That is, you don't want finally to throw an exception. So you need to wrap
the close() calls in their own try/catch.
Is it possible to FETCH JOIN in em.createNativeQuery() or JOIN on non-Entity tables in em.createQuery()?
http://forum.java.sun.com/thread.jspa?threadID=551078&messageID=2692461
Thats' only if you put main() { try { ... } finally { foo.close(); }
spam much?
sorry for spam
I take it no ops are around
cheeser, I think somebody needs to show j0pf the door.
Tee, hee, hee...
Thanks.
I was gonna ask you next.
It looks like an honest mistake, though.
Thanks.
He was beinga dipshit.
Any time. Was he really spamming?
there's a difference between finally and finalize. Look @ Object api for finalize
no, he was just not getting the point
Well, he was being an ass.
i dont see how
pasting 5+ lines in the channel, that's how.
thats not true tho
he pasted exactly 5 lines
of which three were empty anyway
what do I do when my applet is missing some graphics when other windows have been over the applet?
well, you could convert it to a webstart application.. other than that, i recommend a noose.
YES!
NO!
...yes?
Maybe?
Wolfborg, okay... never heard about webstart
should look it up
its this lovely thing that does wonderfull feats like removing all those applet restrictions
~jnlp or ~webstart are both good places to start
Javabot has not returned yet...
pr3d4t0r, get javabot back here
hm, NikkiWade is the right nick i guess
javabot is cheeser's thing
But any OP can invite him back.
NikkiWade, the person who made Javabot leave has been kicked. Can you invite Javabot back?
Okay... moot point. Thanks.
~hi
Hello, svm_invictvs
Any time.
...
Whats' with the name?
pr3d4t0r == NikkiWade right?
I'm a lesbian today.
That turns me on a little bit.
I'm a lesbian with a penchant for killing asshats.
ah
Scott McCoy!
svm_invictvs, http://www.urbandictionary.com/define.php?term=penis+tuck
um
no
that'll explain everything
lol
fishermans tuck.. i need to remember that one
...
shit
I just found out that I used the word "fucking" in checked in code.
anyone know any fun java libraries
PircBot
the math package sure is a fun one!
lol
Is there a channel for applets and javaagents?
the sun forums
kk
http://lolbots.com/?attachment_id=550
anyone know why in Emma, some lines are yellow
in particular, I am running some code that has a finally block, and inside the finally block there is only 1 statement
which is colored yellow
and I am thinking that it must be either green ( it was executed ) or red ( it wasn't )
read the manual
hmm.. yeah I tried looking through it
but no luck. I will try again I guess
Is Java 6 out for Mac?
hahaha, he kicked me from my own channel
there was a preview release of it, not sure if its gone beyond that
Yeah, only preview.
Trixsey:
;_;
will I gain speed using java binary support from kernel ?
i mean linux
Whoohoo. Success. I found a way to add a shutdown hook.
(I was busy until now with other things, that's why it took so long)
guys, does anyone know if cruisecontrol can ignore a dir in an scm?
bguys, does anyone know if cruisecontrol can ignore a dir in an scm?/b
Oracle? Ouch. I didn't find it all that bad to use... but setting it up was a pain in the .... never did get the software installed correctly.
At least it sort of followed the standard for SQL commands...
Does Enumeration guarantee order?
what kind of order?
Apples before Oranges?
Well I'm getting an Enumeration from request.getParameters() in a servlet.. and if I get a list passed in as arg1, arg2, arg3... will the order remain when i conver to a list?
passed in meaning HTTP post params to the servlet
If you turn it into a list yourself, that will guarantee the order it has in the enumeration, but I do not know if they will come from the enumeration in the ofer they were passed to it. I would think that they would, as methods ans such usually don't sort things.
oder*
order*
hmm, okay
CAn you make a test case?
I mean, try it out with a test set of params?
i'm working on it now
hehe
I just sold my phone on ebay for $425, I paid $400 incl. shipping when it was new 6 months ago... whiskey tango foxtrot!
Nice phone then... or idiot buyer. Either way, you still win.
it's no longer selling direct from factory in this region so I'm only minorly surprised
and yeah it's a pretty damn nice phone (by specs at least, software is too buggy for my taste but generally it was rather good)
still after this much time and with the iPhone out I would've expected more like $250
I get nervous when the auctions do this well because I wonder if I mislead the buyers somehow
I like my phone because it doesn't have a whole bunch extra features, camera etc. I ignore the net. I like my phone being just a phone.
yeah, some people like that
I tend to like them either packed with features or fairly simple (but at least offer a bluetooth network tether for my laptop)
No text messages either. The only one I got was from some idiot who had the wrong number.
This one I sold, had wifi, was a symbian s60 smartphone, with a fold out full size keyboard
If I want to talk to someone, I'll e-mail or call them.
heh, well you're a modern luddite
yes, I email with my phone though...
I see it as a communication device and pda, mainly because I don't want to carry both.
But have uses for both.
What would I use a camera for? It costs money to get the pictures off the phone, and I see Blackberryesk phones as electronic leashes. My Mom had to get one for work, she hates it.
It's all J2ME's fault. I got interested in it a few years ago and seeked a phone with a non-shit j2me implementation and ultimately that led me to symbian phones which have the best impl. by far.... got me all hooked on the features.
bIt's all J2ME's fault. I got interested in it a few years ago and seeked a phone with a non-shit j2me implementation and ultimately that led me to symbian phones which have the best impl. by far.... got me all hooked on the features./b
only if you're an idiot does it cost you money to get the pictures off the phone
seriously you program java but you can't figure out cell phones? hm....
Well, I wouldn't take any anyways. I have a nive Canon for that....
nice*
see, I always thought that, so i got a phone without a camera
oh man I missed it because in reality the ONLY time I took snapshots was with my phone
because I never knew before hand that I was going to want to take shots!
Anyone happens to know how to get a Javaagent to run in unrestricted mode?
I'm not carrying a camera around everywhere when I have a phone anyway
wtf is a javaagent?
java.lang.instrumentation
Whatever suits. I'm not a total luddite. I love my notebook.
Java program which is meant to run before other program's main()
and modify its classes
or do whatever
yes, I realize, I just remember having your opinion on the matter til I found myself with capable, good quality devices for other reasons and realized how nice they can be... it doesn't work and it doesn't add up until you have the right phone. Most are shit quality and would turn me off to
the whole idea.
sorry don't know (obviously )
dun wry nobody seems to
it's somewhat new isn't it?
at any rate, now I have to make the decision to go with a nice simpler phone or another smartphone hm... choices choices
sadly I don't even care about j2me anymore
Is there an implementation of Ternary Search Tree in standard Java collections?
don't think so
Ok, thanks.
is there anyway to get observer and observable to work with jframes ?
of can the jframes only be observables?
or Observer's sorry
hm let's look
~javadoc Observer
cybereal, please see java.util.Observer: http://java.sun.com/javase/6/docs/api/java/util/Observer.html
~javadoc Observable
cybereal, please see java.util.Observable: http://java.sun.com/javase/6/docs/api/java/util/Observable.html
~javadoc JFrame
cybereal, please see javax.swing.JFrame: http://java.sun.com/javase/6/docs/api/javax/swing/JFrame.html
i am familiar with the 3 but you need to extend Observable and JFrame but java allows only one class extension .... so the question is how do you setup something like an mvc when the input form can not send information back to the controler
you cannot make a jframe into an Observable because Observable is a class and you can't subclass from two classes, but you could consider a subclass that contained an Observable that related to the JFrame and just returned it from a getter or something maybe?
JFrame is part of view
all you ever need to do with the swing components is alter state and let the EDT display it
respond to state changes with the controller or commute them as messages to a controller
and your model is... whatever
I think that many swing tutorials wrongly promote things like subclassing the components and adding non-view functionality to them, or compiling view/controller into one class as a subclass of some swing component, which is silly imho
oh and, I pulled the links for me, I wasn't meaning to be condescending
i agree about the composition over inheritance for gui's. the only time i ever subclass a component is if i want to compartmentalize my logic/layout
hmm ok i think im getting retarded again
ok i need a little help... I have a gui app and its driven by a socket back end. Obviously i can update the gui using the observer/observable methods, but there are also a hand full of config classes. These need to be accessed from anywhere in the application as they are read by parts of the gui
and socket backed and updated by additional separate gui dialog boxes. How/Where should i stick these classes? Singleton? public static?
create a
"Helper" class
yah thats what i originally thought but then i need to pass it around to all the classes.... (queue bad jokes)
you pass around ONE class and that class does all the backend shit
uyou pass around ONE class and that class does all the backend shit/u
access the configurators through your controller
the front-end should _JUST_ be the front-end
or why pass it around at all? usea ThreadLocal instance and just grab it when you need.
i need it in the sub dialogs to save and populate the info... cheeser: singleton would get what i want but i was just wondering if there was a "better" way
Singleton
though if you're in a GUI ThreadLocal can get tricky
yah its kind of a pain when you also have sockets threaded and you need access across the board
thats' why you use singleton..
hm
I never knew ThreadLocal existed.
heh
I mean, I know how to set one up, just didn't realize it was a class in the framework.
hi
I want to lock until a certain field is set to zero from another thread...
what's the simplest way to do this?
you probably shouldnt be using observer and observable for mvc no ?
wait() and notify()?
http://lolbots.com/wordpress/wp-content/uploads/2007/05/soundwave-copy.jpg 3
you checking in the running thread if that field is zero or are you notifiying the waiting thread when the value becomes zero ?
well essentially I have a buffer that is requested by another thread through a method. Once the buffer has been requested I set it to null. The method that fills the buffer should wait until the buffer is null before filling it again
simple reader/writer problem
Is there any native class / method to open a link in a user's default browser?
~pastebin
http://rifers.org/paste
I'm calling this.notify() in the method that sets the buffer to null. In the method that fills the buffer I call this.wait() and only then fill the buffer
is that the standard way of solving this problem?
~tell BlueLaguna about jdic
BlueLaguna, jdic is The JDesktop Integration Components. It aims to make Java applications properly fit into current desktop platforms without sacrificing platform independence. See https://jdic.dev.java.net/
is there some "outer" keyword like "this", but gets a reference to the containing class of an inner class?
OuterClass.this
aha, thanks
sure
How do I load a lazy @Entity field using em.createNativeQuery()?
die!
I'm not alive anyway.
God I hate Eclipse.
God I love Eclipse.
OMG!
~version
I guess the factoid 'unsupported version' might be appropriate:
unsupported version means you compiled your code on a newer version of the VM than you're trying to run it with. Recompile for/with the older VM or upgrade your VM.
~about
I guess the factoid 'the truth about garbage collection' might be appropriate:
cheeser, the truth about garbage collection is http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html
damn you
cheeser, I have no idea what damn you is.
~bomb r0bby
that's not in _ANY_ of the operations nor is there a factoid for that
Is it reseanable to conclude the only way to make a recursive method (that is adding something to a data structure) thread-safe is to synchronize the entire method?
so cheeser, where's the front-end
WTF is up with that Eclipse auto-complete selection highlighting where it's like just ever-so-slightly off-white?
Are they trying to make me blind?
on my server
8^)=
i'm not quite ready to reveal *that* part just yet.
it's customizable, also what are you talking about autocomplete highlighting? It's probably based on your os settings.
heh
found some bugs in it actually.
Why should I have to customize it?
That is retarded.
admin section, if an admin exists already in the table added manually, it doesn't show
hardly, it's pretty normal for apps attempting to integrate with the OS
that's one bug i noticed
you bitch too much, go write your own IDE and see how few people lik eit
he who calls his tools stupid often finds the same can be said about him
he who calls his tools stupid often finds the same can be said about him
~tool
A tool is only as good as its user. Tool.
And um
He who makes vast, general statements is generally ... vast?
that was deep
~javadoc String
that's probably broken...
er...
this is probably irrelevant but has anyone ever used http://meebo.com and seen how the windows can move around inside the actual website
is my patch in cheeser?
how is that possible?
~383++
383 has a karma level of 1, r0bby
it needs the docref
Nope.
it's not
so it still needs a bit of touch up.
I could see that it isn't because my patch would _NOT_ allow that
i need to fix that javadoc before it can really go live
how so?
you broke the javadocs?
the new bot doesn't have the docref.xml handy atm
user must be on the channel
ah
which makes sense.
since, why the fuck would you increase karma of a user who's not here? And quite frankly it handles _ALL_ invalid nicks because you can't use an invalid nick to begin with
it used to do that and I pulled it back out
why?
e.gl
~google++
google has a karma level of 65, cheeser
statically positioned elements
simple javascript tricks
all fine and dandy, but this shouldn't happen
~++
~karma
that's an entirely different case
has a karma level of -1, r0bby
I guess the factoid 'help karma' might be appropriate:
To increment someone's karma, use ~nickname++, e.g., ~r0bby++. To decrement, use -- instead of ++. To view someone's karma level, use ~karma nickname, e.g., ~karma r0bby
anyway. i'm off to bed. have fun with the bot. i'll probably roll it back tomorrow morning.
it's either the way I have it, or 4 checks in an if statement
only two ways i see fit to fix it
2 of which are regex
Does anyone know of a concurrent implementation of ternary search tree?
Hah, ok. I am wondering whether it's even possible to do it any other way.
sync all mutating methods probably
or COW
What's COW?
which would probably defeat the purpose
~cow
cybereal, I have no idea what cow is.
~replyCow goes moo.
I guess the factoid 'plural of moose' might be appropriate:
moose
~Cow is replyCow goes moo.
Okay, cybereal.
~tell evosh about Cow
evosh, Cow goes moo.
Copy on Write
Uh, I see.
it's how ConcurrentHashMap does it
I have many threads searching the tree but very few insertions.
w0w
javadocs work on my local bot
...
i don't know _WHAT_ cheeser did ...then again i don't have his codebase probably
he lost the javadoc xml file
heh
the new bot doesn't have the docref.xml handy atm
er
is HSQLDB the lightest weight in-memory JDBC/SQL package for doing unit tests on code that expect a DB?
I don't need transactions or anything fancy at all
really just a table store
javadb? it's included in the jdk
ooh, thanks
ah.. jdk6... i'm on 5
guess i can install Apache Derby
what part of it's included with the jdk did you not understand :P
javadb _IS_ apache derby
~javadb
Fanook, I have no idea what javadb is.
~derby
Fanook, derby is Apache Derby, an Apache DB subproject, is a relational database implemented entirely in Java and available under the Apache License, Version 2.0. Small, embeddable, client/server. http://db.apache.org/derby
did they add it to the jdk in 5? or 6?
6 i believe
from what i read
ah.. jdk6... i'm on 5
what part of "jdk6, i'm on 5" did you not understand
thanks, Fanook
upgrade!
no thanks
why not?
because there aren't prebuilt packages for debian etch for java6
grab it yourself, install it into /usr/lib/jvm/*
except I don't want to do that on every one of my application servers in a production environment
so install it yourself
I'd rather stick to packages in stable
heh..
i dislike package managers. they refuse to tell me where they hide stuff
unless you can convince me why java6 is downright superior
it's one better!
I could have forseen that
yea. java5 is nice for generics and enums at least
i haven't used java6 recently
why not! why don't you install it! raar!
is java 6 released now? for reals?
you're on 7?
I haven't used *FEATURES* exclusive to java 6.
I'm using java 6
aye, that was worded badly
java 6 update 2
Thanks for the link earlier, but I'm going to end up using the Desktop Integration Features in Java 6
^^
?
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/ new java 6 desktop stuff
telling Toad a reason to switch
I could care less about desktop Java
I see
heh
so i see
I haven't done any desktop Java since I made a bouncing ball application as my first Java program in '99 or so
You should at least upgrade your JRE
Swing is drastically better in Java6
I don't run any desktop Java either
"On the Solaris Operating System and the Linux platform, this API is dependent on Gnome libraries."
Well that blows :-/
Do they just mean GTK or GNOME itself?
hopefully just gtk
hola
Is it considered a bad design to throw an exception in the construction?
not necessarily
depends on you school of thought
my opinion is constructors should not be doing anything that can have a checked exceptional state, if a constructor fails it should be so bad the whole program has to end.
better to do that than to construct an object in a bad state
like, missing files or no memory
also depends on what your constructor has to do
in the compile target, but it doesn't seem to be using it. any tips? thanks.
if you need to init and require checked exceptions you should have a second phase constructor, a.k.a. initialize() method
that's often bad practice though, imho
why?
objects should be immutable after construction if it's easy to do
that's silly
what do you do when people forget to initialize() ?
immutable objects should be immutable, obviously.
throw exceptions
here's my current build.xml http://pastebin.com/m546b66d5
it's a programmer error
IllegalStateException
use asserts if you like that better
I'd do IllegalStateException too
but I'd rather (e.g.) throw an IOException from a ctor that has to read from a file
Hmm... How about "construct" a default state if the state is not define?
Bad idea I guess.
also, all the java.* classes throw exceptions from ctors
quite frankly, Sun is not the best role model for good design practices
alright, agreed. But books like "Effective Java" agree with me, I think
and I trust Josh Bloch
~tell toad about javadoc Float.Float(float)
you have a right to your opinion, but i am not going to agree just because some silly guy you mention agrees with you
ha
currently javadoc command is broken
I'd consider parking my bot here for a bit, but it'd get annoying...since it uses the same response prefix
yes, i see that
ok, well then, in my experience, having objects set up their core state at ctor time is better design than doing so later
and has mirror databases
it is entirely dependent on the object and how it is used
I'm not saying that as a rule... just more often than not
any class that connects to or represents an external resource, for example
I don't think it applies, ever, if the constructor's functionality seems to require checked exceptions. That's just daft imho.
bI don't think it applies, ever, if the constructor's functionality seems to require checked exceptions. That's just daft imho./b
that type of class shouldn't be constructed directly anyway
factory method?
nevermind, figured it out.
a factory method should be creating it so it can check things as necessary before bothering with mocking up an object that is just going to die right away
what's wrong with an object that dies during its ctor?
it's not like object allocation is such a big deal
it was pointless, it never served any purpose as an object, it only misplaced functionality that should've existed elsewhere
.. or it made clearer usage for the object
it doesn't matter, you don't buy a car to put a box in it and drop it in a lake just because a lake can hold lots of cars
you do if... I can't follow that analogy. But if other things become cleaner for it
isn't that what most Design Patterns are?
extra objects/classes for the sake of clean and consistent design?
nothing becomes cleaner because it's counterintuitive to have checked exceptions for object instantiation
how is it counterintuitive?
furthermore resources are often cacheable and easier to provide that cache behind a method than a constructor
yes, I'd use a factory for things that are cacheable, too
but, e.g., constructing something or other from a file on disk, I'd definitely expect an IOException
I'd expect it to, FROM A METHOD.
I'm saying, constructors should only fail in unrecoverable circumstances
that's my position
I don't see why "try { File f = SomeFactory.open("foo"); }" is that much different than "File f = new File("foo");" except for clarity of naming
the former makes far more logical sense in an OOP environment, you are asking an object to do a thing that it can do and in response you get a resource
you don't just pop objects out of thin air in real life, so why do you ignore than idiom in a language style that seeks to emulate reality?
another analgy
Does throwing exception make the object instantiation sort of half-dead/half-alive by any chance?
if I asked you for a paper with your name on it, you would not say "Oh damn i can't do that because there isn't already a paper with my name on it." You would first getAPaper() then paper.putMyNameOnIt("me"); then hand it to me
~shoot evosh
bang!
joed, That was totally unnecessary.
ok, if you're advocating factory methods, I agree
But fun.
it is constructed, and never references so it's collected
but that's because people can deal with paper without a name on it
but in a lot of systems, you don't want to deal with the half-constructed "nameless paper"
indeed, and if you can find something that won't work without proper construction, then that should be a runtimeexception, halting execution of the whole program if not just the unit
oh this is just silly fapper
waste of my time here
I avoid RTEs when possible, since I don't like programs that can quit due to rpogrammer error
I assume programmers make mistakes wherever possible ;-)
E62, decent phone for good price.
and yes, it's a bit silly. Though at least fairly educated discussion compared to a lot of IRC arguments ;-)
you see I am in opposite position there too, I think programs should quit as quickly as possible from programmer errors to increase the chances of catching them in Q&A
I am done with the nokia business phones for a while, I just sold my E70
I'd rather make them impossible
but yea, I assert() like crazy for that reason
that is not possible
even the strictest languages, in order to be useful, allow programmers to do stupid things
I'll give ya a ++ for the above though.
ok ;-) but when easy, I'll minimize the stupid things they can do
lots of examples of that -- Typesafe Enums pre-java5 for example
making the program end when they do it is pretty effective
i intend to get an iPhone when my t-mobile contract expires in january, so I'm thinking of just getting a nice middle-low end Sony Ericsson til then. SE's smartphones as of late are total trash but their feature phones are pretty slick, K-series especially.
ui intend to get an iPhone when my t-mobile contract expires in january, so I'm thinking of just getting a nice middle-low end Sony Ericsson til then. SE's smartphones as of late are total trash but their feature phones are pretty slick, K-series especially./u
?
a song about an irc bot :p
anyone know anything about javascript interacting with java applets? is it possible?
yes it's possible and easily found on google
but since you didn't look there you probably didn't read the topic either...