|
Rabbi Dan posted:there is a recommendation in one of my assignment guidelines that i use the java debugger "jdb" but i can't figure out where it is. jdb should install in the same place as java and javac. If it didn't then you didn't get the JDK and you only got the JRE or some other poo poo that isn't the JDK.
|
# ¿ Oct 11, 2008 06:19 |
|
|
# ¿ May 9, 2024 14:04 |
|
zootm posted:No, they don't. That's what the include directive does but the directive stuff is very old-school and sucks a whole lot; don't use it.
|
# ¿ Oct 17, 2008 14:30 |
|
zootm posted:Yeah. It bugs the crap out of me. JSTL and EL make it infinitely better, though, especially once you can externalise your own stuff out into custom taglibs. Can I ask what you prefer using?
|
# ¿ Oct 17, 2008 18:31 |
|
Lazlo posted:I need a way to search for a value through a hierarchical list, while keeping track of each descent made. The hierarchy may have an arbitrary number of levels (nodes), though probably less than ten. As long as this file format is a regular language and not gigantic, I'd personally write a small parser in ANTLR. You'd end up writing a baby parser anyhow, but with ANTLR you have a ton of tools to help you, plus it's drat good at its job.
|
# ¿ Nov 1, 2008 19:25 |
|
huge sesh posted:So i'm working on a highway routing problem and it's looking fairly unavoidable that i'm going to be creating somewhere upwards of 300,000 objects (for the NY map, let alone the US) representing intersections that will be shrunk to allow faster queries. I have heard variously that this is a bad idea in java--object creation has a large overhead and the garbage collector will go crazy trying to keep track of everything. In order (for me, at least) to help in any real capacity, can you answer these questions: How large are the objects? How much RAM do you have to work with? Do you predict these objects will be very short lived or will they persist throughout the life of the appplication? Also, is this a desktop, server or mobile app?
|
# ¿ Nov 6, 2008 00:28 |
|
Where are you declaring a new ContentGetter?
|
# ¿ Nov 11, 2008 15:35 |
|
mister_gosh posted:As already stated, I tried to take out the fluff, such as variable declarations. I can tell that it is at the line marked HERE that it fails, based on my log4j output which I've also removed. But that particular variable declaration might not be fluff. The only thing I can see that this could even possibly be is a scoping issue.
|
# ¿ Nov 11, 2008 15:50 |
|
JulianD posted:I checked to see that's the problem after your suggestion, but I don't think that's it. I added this to my program to see how much memory I had before and after calling the last method of my program: If you want to see how much ram is available to your vm you should run jstat on the vm running your program. You can see how much ram is available to each object space (eden, survivor 0 and 1, old gen and permanent gen) over the duration of your program's lifetime. It's a really awesome tool and comes with the jdk.
|
# ¿ Nov 28, 2008 22:51 |
|
Cedra posted:Since FreePastry is used with Java, I figured I'd ask here as well. Windows firewall? Also, whenever I have network issues I always bust out wireshark.
|
# ¿ Dec 8, 2008 22:51 |
|
Cedra posted:I wish I knew how to make it track my packets, because it doesn't seem to be doing such a thing. I'm doing the usual 'pick an interface then start capturing packets' but whenever I try to start a node nothing on Wireshark seems related to packets being sent around the FreePastry ring. Unfortunately, Windows doesn't have a loopback adapter. You can't use libpcap to capture information on localhost, which is kind of stupid but them's the breaks.
|
# ¿ Dec 11, 2008 00:21 |
|
hexadecimal posted:vvvv Sorry if this is a really newbie question, but where does tomcat store its logs?
|
# ¿ Jan 7, 2009 04:49 |
|
hexadecimal posted:I see catalina.<date>.log no files with .out extension. I don't see any useful information in those log files, however. Win32 or Linux or ?
|
# ¿ Jan 7, 2009 06:12 |
|
fletcher posted:What's an easy way to encode html entities with java? Apache Common's StringEscapceUtils. http://commons.apache.org/lang/
|
# ¿ Jan 12, 2009 20:14 |
|
necrobobsledder posted:So has anyone else messed around with dependency injection frameworks / libraries in Java? Google Guice seems to be fine for the jobs we've got, but we've got ourselves a home-brew dependency injection framework that is extremely clunky and I'm trying to get a better grasp on other options before overhauling the clunkiness we've got. I'm trying to keep it simple, but I do know I'm going to have to write a code generator to use any framework since what I'm working with is generated code that would take basically forever to perform the bindings manually. There aren't any dependency injectors that load class files and generate code for found classes according to some rules by chance, are there? Spring has a DI framework and I've found it decently powerful. With annotations it's not too bad to use, and configuration with Groovy is pretty easy. To answer your last question, do you have an example of what you're trying to do? If I understand you correctly, you want to do something similar to what Grails does. Grails (uses Spring) will load (and reload) arbitrary classes based on className by introspecting all classes in a given location. The "rules" are basically that the classes have to exist in a certain location. I'm sure you could do something similar.
|
# ¿ Jan 29, 2009 00:10 |
|
necrobobsledder posted:Crazy poo poo. Holy poo poo... Well, you *can* pull Spring apart, it's pretty modular.... but I don't think I'd try to do what you are doing with it. Is there any reason you can't just bundle revisions of the APIs in individual jars and dynamically classload them depending on the version? You could then introspect the classes made available by that classloader (I found a particulary neat way of doing this just now), and make your interfaces that way. Then you don't have to play traffic cop. Or perhaps I still don't get it
|
# ¿ Jan 29, 2009 22:09 |
|
Dire Penguin posted:How do I tell how many elements are in an String array that I've created? If I read in a bunch of stuff to a String foo, then do foo.split() it gives me a String[] but if I want to loop through the elements I don't know how many there are. You can also for-each over arrays if you're using JRE5+: code:
|
# ¿ Feb 16, 2009 14:04 |
|
Pivo posted:Hi guys, I'm using Eclipse at work to do Java web dev. You can't Ctrl+Click into the method and see its source? I just have the standard 1.6 JDK and plain-jane Eclipse 3.4 and I can enter all of Java's standard classes.
|
# ¿ Feb 20, 2009 16:08 |
|
Pivo posted:As a follow-up, it looks like a class called Logger intercepts stdout so the JDK println is never even called. And, of course, I don't have the source code for the logger. Honestly I've never done webdev in Java before this, anyone have any good links for a quick rundown of logging systems in JBoss? Nearly half of our server logs are [STDOUT] null and the logger logging messages about the logger. Do you know the package Logger is in? I'll bet it's log4j or Apache Commons' Logger.
|
# ¿ Feb 21, 2009 01:30 |
|
Hey Pivo, a really good Java tip I have for you is to ALWAYS google for the names of classes or messages displayed when programs throw stack frames. I just googled for "com.arjuna.ats.arjuna.logging.arjLogger" and found a whole bunch of people who asked the same question you did about excessive logging, right on the first page.
|
# ¿ Feb 21, 2009 02:40 |
|
Pivo posted:Hey TRex, guess what page of Google I pulled that log-quote from? Oh and by the way, my question was only tangentially related to the topic of those particular log entries! Kid, I can't read your mind. I thought those were the actual log messages your program generated. Maybe if you were concise about the problem, we wouldn't be having this little exchange. In any event, gently caress you. If you're gonna act like a noob and then get all bent out of shape when someone gives you a tip, perhaps you should learn how to solve simple problems like this on your own.
|
# ¿ Feb 21, 2009 15:17 |
|
Ghotli posted:Edit: I've only scratched the surface of the available java frameworks. I come from a ruby on rails background where development speed, ease of use, and the community are a big deal. I looked for these qualities when delving in to the java world. I'm gonna sound like a broken record but Grails is Java's answer to ROR... unless you just want to run ROR on JRuby.
|
# ¿ Mar 4, 2009 03:22 |
|
capr1ce posted:What I need to do is store it in a database, and then it needs to be searched against and displayed, and maybe edited in an html form. Is there anything I can do to convert this string back to the 硼 character in the Java code, or is it perfectly fine to put the HTML String into the database and search on that? Apache has StringEscapeUtils in their Commons Lang package: http://commons.apache.org/lang/ Specifically, escapeHTML() and unescapeHTML() are what you are looking for.
|
# ¿ Apr 6, 2009 13:47 |
|
Warblade posted:That's some nice syntatic sugar. Now I just want Java to introduce unsigned values. Which will probably never happen What's sad is the jvm byte code interpreter actually uses unsigned short integers, and the Oak language (which was basically Java's daddy) had specific mention of allowing unsigned modifiers to integral types. Specifically, from the Oak spec: quote:Integer Types but then, sadly, in the sidebar: quote:unsigned isn’t implemented yet; it might never be. gently caress.
|
# ¿ Apr 16, 2009 17:49 |
|
HFX posted:I often have to work with implementing network based protocols in Java. Java's lack of unsigned type can make this a lot harder then it should be. We might be getting proper tail calls. I believe the JSR-292 defines them (part of the invokedynamic stuff, also known as MLVM) in fact: http://wikis.sun.com/display/mlvm/TailCalls YES.
|
# ¿ Apr 17, 2009 17:17 |
|
What do you need to know?
|
# ¿ Apr 23, 2009 04:30 |
|
LilMike posted:Alternatively, Warblade, check out the command line parameters for javac -source and -target, I think you'd want something like javac -source 1.3 -target 1.3... So it would only accept 1.3 compatible java and output 1.3 compatible bytecode. Bonus: you can specify these as attributes to the javac tag in your any build scripts. I don't think that would help, since warblade was running into a library issue and not a classload or verifier issue. Eclipse allows you to set up different jvms to build against, I'm on the train right now but I'm pretty sure sun still provides legacy jvms for download. e: here -> http://java.sun.com/j2se/1.3/download.html trex eaterofcadrs fucked around with this message at 13:48 on May 1, 2009 |
# ¿ May 1, 2009 13:06 |
|
Sorry, I was rushed this morning and didn't look at the link too closely Those sons of bitches made it hard to find, but here it is: http://java.sun.com/products/archive/j2se/1.3.1_20/index.html
|
# ¿ May 1, 2009 17:29 |
|
There's definitely a huge array of software in the Java ecosystem, so you end up with too much choice and it's hard to tell what libraries are best to use. What are you trying to accomplish? All those technologies have a place (it seems by the names you tossed out you're going to make a webapp) but some (like Jboss and EJB) are overkill for many projects, just like others (Faces...) are not robust enough for enterprise-grade systems.
|
# ¿ Jun 14, 2009 02:36 |
|
I had to do something similar... what I ended up doing was this:code:
|
# ¿ Jun 15, 2009 21:08 |
|
ssergE posted:Not necessarily a webapp, but mainly server-side apps that use things like queues, topics, persistence, etc. Either of those choices (Seam or Spring) would be good. I personally use Spring a lot and I like it, but maybe I'm just used to it.
|
# ¿ Jun 15, 2009 21:09 |
|
rhag posted:But, but....why? Classes in the java.nio.channels package are even faster for reading/writing.
|
# ¿ Jun 19, 2009 21:39 |
|
Randomosity posted:Hibernate question for everyone. I had this issue during development over a year ago. I just had to either manually modify the database or drop the table and let Hibernate recreate it, I never found a way around it.
|
# ¿ Jul 1, 2009 05:31 |
|
Randomosity posted:e:removed for brevity You might have to use Hibernate's collection annotations (@OneToMany I think) for Hibernate to realize it needs to handle List internals. That said, I DID just gently caress up the deepCopy() method on an immutable class for a UserType I implemented just last week (in Grails) and it caused Grails to trigger a db save. However, that class was not a List (Grails domain classes and Lists are a disaster). Any particular reason you are using a UserType and not another mapped Entity collection? Don't get me wrong, I use them myself, but the DB I work with is solid poo poo. I'd tend to stay away from them if at all possible. trex eaterofcadrs fucked around with this message at 20:21 on Jul 1, 2009 |
# ¿ Jul 1, 2009 20:16 |
|
Edmond Dantes posted:Ok, let's see... Yeah, you can use BigInteger(String val, int radix); I use this for base-36 (0-9A-Z) conversions.
|
# ¿ Jul 1, 2009 20:58 |
|
useless player posted:So I've tried decompiling the main .class file and examining the source. The class constructor calls a method with a really weird name, $$$setupUI$$$(), which does not appear in the source file I was given. Searching through every source file for the string 'setupUI' turns up nothing. This really sucks, but I guess the class file is from another source. What's the fully qualified package for that class? I googled $$$setupUI$$$ and found a groovy project for the intellij ide here: http://www.jetbrains.net/jira/browse/GRVY-2045 Anything look familiar?
|
# ¿ Jul 17, 2009 06:13 |
|
dealmaster posted:Something similar to C#'s decimal primitive would be useful. Tracking down small rounding errors with doubles and floats is a huge pain in the rear end. That's all BigDecimal is, the only dumb part is the lack of operator support for that and BigInteger (or all subclasses of Number, honestly). JDK7 was slated to bring operator support for that but, alas, it wasn't meant to be
|
# ¿ Aug 1, 2009 19:17 |
|
dealmaster posted:Yeah it's just too bad there's no primitive that'll do it, but at least they built the functionality into one of their standard library classes. It's just easier for actuaries and non-coders to look at: You could always use Groovy. By default fractional numbers are BigDecimals: code:
code:
|
# ¿ Aug 3, 2009 13:57 |
|
The jvm needs to perform extra work when unwinding stack frames. From what I understand, it has to rediscover the call path when an exception is thrown, since it doesn't keep the path around during normal calls.
|
# ¿ Aug 19, 2009 19:19 |
|
Anunnaki posted:My CS teacher's been telling me it's a "hybrid." vv That's somewhat correct, although it's a lazy way of explaining it. The bytecode is interpreted to machine code on the fly at first, until the hotspot just-in-time compiler identifies code that it should spend time compiling to native machine code. It looks for "hot spots" (hence the name) and it sends those units off for further optimization. At that point it's native code and therefore no longer interpreted.
|
# ¿ Sep 19, 2009 14:52 |
|
|
# ¿ May 9, 2024 14:04 |
|
FateFree posted:How do i generate a random long from 1-7 billion, when there is no range function like there is with integer? If it doesn't need to be cryptographically secure then you can use the same method they use in Random.nextInt(int n). In the javadoc they go over it: All n possible int values are produced with (approximately) equal probability. The method nextInt(int n) is implemented by class Random as if by: code:
|
# ¿ Nov 22, 2009 16:29 |