Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is there a utility class (e.g. in commons-io or Guava, if not in core Java) that's the equivalent of FileReader, but for resources? I mean, yes, I can write
Reader myReader = new InputStreamReader(getClass().getResourceAsStream("myResource"));
but it would be nice to do it with less boilerplate noise.
There is no more concise what of writing this using core Java classes.
Guava has some helpers for dealing with resources, but nothing that wraps a resource as a Reader.
There is nothing relevant in Apache commons.
And in fact, what you've written is arguable wrong. It depends on the platform character encoding being the same as the encoding of your embedded resources. IMO, that is a more important issue than the amount of boiler plate code you need to write.
You can address the boilerplate "problem" by writing your own utility methods.
Re: this "reason" for not writing your own utility method.
Because if somebody's already done it I don't want to maintain it myself.
Assuming that you write the method correctly, the maintenance effort will be almost zero. And since (with the hint above) you now know how to write it correctly, the implementation effort will be almost zero too. You've probably expended more effort looking for an existing helper (and asking here) than you would have saved ... if you'd found one.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is there any programs that are simple and stand-alone that can convert UML diagrams to java code? If there isn't what is the best eclipse plug-in?
You can also try a web application like genmymodel
It enables to generate from UML to Java. If you use a github repository, you can also preserve your changes between each generation (using JMerge annotations).
You have two way to work with UML.
First approach is to model then generate code from model. The best tools are Rational and Modelio Soft.
Second approach is to live syncrhonized java and UML. The best tool is with no doubt EclipseUML Omondo.
No. Usually they produce very bad code which is unusable. From my experience it takes a lot of work to produce UML model and it does not survive first week of implementation.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for an obfuscator for java. Found one, proguard. This is working only upto one level when i decompile using jad, all codes are visible. Only the method names and some variable names are getting renamed rest all are visible. Are there any better obfuscator which is impossible to get source out of it? Thanks
As long as you deal with software, all you can do is making retrieval of the source code harder. In Java you will almost always be able to get a quite readable source back from the class files. In applications that are compiled into machine code, you might get worse results, but someone who wants to get it, will still be able to retrieve the information. Even when you write software in C, compile it and burn it into a microcontroller, there might be some people eager enough to retrieve the binary program and decompile it.
Honestly, if you want to slow down successful decompilation (and that's all you can achieve), try to find the obfuscator that makes debugging of actively deployed applications least painful for you. Because, if you obfuscate, debugging and maintaining might be painfully slow as well.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I can't find any documentation for Jagatoo, except for a single PDF in the doc folder. Is there any at all?
Would make it a lot easier to read about the structure, rather than investigating it all.
Read the source code.
Source code really is the best documentation in the absence of adequate documentation. I find that if I really want to wrap my head around a framework or library, the best thing to do is to dedicate an evening (or weekend, depending) to a proper deep dive of the source code. The added benefit is then that you know exactly where missing functionality needs to go if you want to implement it yourself, and better yet, contribute it back to the Open Source community.
PS I presumed you meant that the PDF on this page is the only one you could find.
You could potentially also look at how Xith3D makes use of JAGaToo.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've used Mina and Netty, but now I'm in the market for a lightweight library that may also be used in Android. I prefer Nio or AsyncIo over standard io implementations.
Update 1
The lack of responses really makes me think I should write my own library. Right now I'm using raw NIO and its not a lot of fun.
You might try using some pieces from Jetty as suggested in this email. I really like Jetty because it's small, self contained, and you can use some or all of it flexibly.
Since this seems to be dead on arrival, I'll answer it by saying my custom IO library will be the best.
To answer your question, there is no one size fits all async library. Netty and Mina might be the closest to such a thing, but most projects may still have to contain some pure NIO/ASYNCIO customized solutions.
I maintain you are on the right track. The more experience you have with low-level NIO/ASYNCIO the more you will appreciate and be able to get the most out of the somewhat-less-low-level Netty.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I haven't found many ways to increase the performance of a Java application that does intensive XML processing other than to leverage hardware such as Tarari or Datapower. Does anyone know of any open source ways to accelerate XML parsing?
Take a look at Stax (streaming) parsers. See the sun reference manual. One of the implementations is the woodstox project.
Since it hasn't been directly mentioned, I'll throw in Aalto, which is fastest java xml parser according to some measurements, like:
JVM-serializers (which compares, XML, JSON, protobuf, Thrift etc etc)
Alternative serialization methods for WSTest (Java web services)
which are not written by Aalto developers.
VTD-XML is very fast.
It has a DOM-like API and even XPath queries.
Piccolo claims to be pretty fast. Can't say I've used it myself though. You might also try JDOM. As ever, benchmark with representative data of your real load.
It partly depends on what you're trying to do. Do you need to pull the whole document into memory, or can you operate in a streaming manner? Different approaches have different trade-offs and are better for different situations.
Depending on the complexity of your XML messages you might find a custom parser can be 10x faster (though more work to write) However if performance is critical, I wouldn't suggest using a generic parser. (Also I wouldn't suggest using XML as its not designed for performance, but that's another story, .. ;)
Check Javolution as well