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 need a cheat sheet for Java and started looking around, but could not find one that seemed "canonical" - which surprised me considering how widespread the language is. Could experienced Java coders please suggest a cheat sheet that is useful (organized so well you actually use it often) and complete (covers real-world daily usage) please?
By contrast, here's what I'd consider a canonical cheat sheet for Python: http://rgruet.free.fr/PQR26/PQR2.6.html
It is complete (syntax, types, statements, built-ins, common modules, idioms) and useful (well-organized: sectioned and hyperlinked; easy to search, and easy to explore).
Also, I have looked at the listing here already: http://devcheatsheet.com/tag/java/ and did not find a cheat sheet comparable to RGruet's Python cheat sheet above. The top listing in Google for "Java cheat sheet" is http://www.cs.princeton.edu/introcs/11cheatsheet/ which is fairly complete, but not organized to be useful. There's gotta' be something better out there!? BTW, it need not fit on 1 page. I'm aware of the Java API docs, but that's more what I'd expect a cheat sheet to link to, not be.
Update
Some SO members thought this question was subjective, but I think I explained my criteria to be fairly objective: completeness (content) and usefulness (presentation) are not hard to judge in this context. I've accepted one of the more useful answers, but remain surprised that Java doesn't have a canonical cheat-sheet.
This one didn't seem too bad.
http://mindprod.com/jgloss/jcheat.html
found one interesting cheat sheet here..
http://introcs.cs.princeton.edu/java/11cheatsheet/
This Quick Reference looks pretty good if you're looking for a language reference. It's especially geared towards the user interface portion of the API.
For the complete API, however, I always use the Javadoc. I reference it constantly.
Here is a great one
http://download.oracle.com/javase/1.5.0/docs/api/
These languages are big. You cant expect a cheat sheet to fit on a piece of paper
I have personally found the dzone cheatsheet on core java to be really handy in the beginning. However the needs change as we grow and get used to things.
There are a few listed (at the end of the post) in on this java learning resources article too
For the most practical use, in recent past I have found Java API doc to be the best place to cheat code and learn new api. This helps specially when you want to focus on latest version of java.
mkyong - is one my fav places to cheat a lot of code for quick start - http://www.mkyong.com/
And last but not the least, Stackoverflow is king of all small handy code snippets. Just google a stuff you are trying and there is a chance that a page will be top of search results, most of my google search results end at stackoverflow. Many of the common questions are available here - https://stackoverflow.com/questions/tagged/java?sort=frequent
It's not really a cheat-sheet, but for me I setup a 'java' search keyword in Google Chrome to search over the javadoc, using site:<javadoc_domain_here>.
You could do the same but also add the domain for the Sun Java Tutorial and for several Java FAQ sites and you'd be OK.
Otherwise, StackOverflow is a pretty good cheat-sheet :)
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 9 years ago.
Improve this question
Problem description: i want to load image pixel data in excel sheet.
what i have tried: using apache POI for writing the data to excel, but i found there are some limitations in apache POI (as elaborated below)
I have come to know of some workarounds, which are tedious on the part of the programmer and i am not really willing to do that for such a trivial looking task.
Details:
i have been using apache POI for quite some time, and i have come across few limitations:
the whole file is in memory at once, so cant use directly for bigger files.
(specific to HSSF) :
no more than 255 columns
no more than 4000 cell styles
cant use custom colors directly.
my requirement is to read an image(say, 1024x764) pixel by pixel and write pixel value in rows and columns of the excel sheet, every different pixel value is styled differently.
the problems i have faced are:
out of memory exception, while writing to the excel sheet, because of so many rows/columns and styles
writing a logic for reusing styles would slow down the whole program
even if i reuse styles, what to do about the huge number of rows/columns
I have come to know that there are workarounds for these problems:
reusing styles
writing logic for efficient memory usage
but i do not intend to take much pain for a job as simple as that, and since these are not directly the limitations of excel (atleast not .xlsx), i am looking for a library that can do it for me.
can someone please suggest another library which can do this,or can you suggest some easier workarounds for these problems?
can someone please suggest a good library to do this, or else i would change from java to csharp
In short, nope - the POI libraries are, in my experience, the best ones available for the job. They're not perfect, but I don't know of an alternative that's better. You may want to try checking trunk out and seeing if any of your issues have been resolved there - entirely possible, it's a relatively active project.
The only other thing I'd suggest looking at is the OpenOffice API, but note that requires OO to be installed (or distributed with your app.)
In all honesty though, POI's strength is it's cross platform nature - it's a pure Java implementation with no native components. If you don't care about this and could therefore go with C# and use the native office APIs, this would seem like the logical approach surely? It seems odd to me that you're not doing this already.
JExcelApi
http://jexcelapi.sourceforge.net/
It works in declarative mode, as Adobe LifeCycle e JReport: you create a Template file xls andin every cell you put the reference to the beans.
Invoking the engine, a the end you have a XLS file.
Sorry for the extreme synthesis, but I worked with it a lot of years ago and I don't remember the details, but in the website there's the documentation.
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 never done anything in Java before but I'd like to use Lucene for the search on a site.
I'm having trouble find a good step by step tutorial for a complete beginner at this.
Can anyone recommend a good tutorial?
Thanks
Along with user428747 answer, you can also read this article.
As well as this one (which is kind of old compared to the first one).
On a side note, if you want to use Lucene, did you consider using Solr?
It uses the lucene search library and extends it as you can read here.
The classics: Lucene in Action
this website might help you a bit..
http://www.lucenetutorial.com/lucene-in-5-minutes.html
This is not a direct reply to your question on Lucene tutorials (For that, my answer is same as some of the other posters: Bob Carpenter's Lucene in 60 seconds tutorial on the Lingpipe blog).
If you don't want to learn Java just for Lucene, any full-text search database (Postgres/Mysql/etc) should solve your purpose. In particular Sphinx is recommended.
This decision particularly relevant if you need your search app to have high performance / scalability (since you will be learning two things - Java and Lucene). Unless you have an in-house java expert, it is better to fight one war than two at the same time.
maybe apache solr is better for you: http://lucene.apache.org/solr/
If you're using Zend, why aren't you using Zend's PHP port of lucene? See here for a tutorial on it.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
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.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I need some advice in learning Java and getting Java certification. My target is to get Certified. I am acquainted with C, C++, feel quite okay with the topics.
As I already mentioned that I need some suggestions about, how to start Java and where to start. Please help me in this regard.
I already downloaded,
SCJP Sun Certified Programmer for Java 6.pdf
Osborne - The Complete Reference Java 2 (5th Edition).pdf
And some free Java tutorials, from sun website and other places
So, please suggest me what more I could do, and where else I need to look. Is there any better resource for Java Beginners? I really need to learn it fast. And yes, I am dedicated with all my efforts.
It would be nice if someone can pass me links to some online Java compilers.
Head First Java is a good book for beginners.
See the Oracle Java Tutorials section on Getting Started.
Also check out the question that has been previously asked
Best Java book you have read so far
Java Ranch is a good website for Java forums and FAQs
The book Java Language specification is also available online.
My suggestion is that you should get a hard copy of Head First Java.
It is the best book for beginners.
Java Compilers
Download JDK
IF you want to use an IDE then Download Eclipse
Want to use an online compiler? Use IDEONE
Apart from reading books and doing multiple choice question tutorials the best way to learn something is to actually use it. I suggest you start doing some actual programming in Java. Think of a couple of smallish apps and just start trying to use what you have learned studying.
Look for some books, they are really helpfull (and java doc of course!):
Google Books
I have read (spanish): Estructura de Datos en Java from Mark Allen Weiss, it is a GOOD beginning...
If you think you are OK with C and C++ then you are OK with Java, its easier to learn I think, good luck with that...
and of course search for JAVA API 1.6 on GOOGLE (i cant post more links sorry)
Can u able to suggest me some sites to
learn a bit easily...a tutorials. But
i need to learn with in short time.Iam
keeping my full efforts for this to
achieve.
Aside the Java Standard Tutorials, referred by #org.life.java, if you need to learn Java EE (Servlets, JSP, EJBs, SOAP, etc, etc, etc), con can check the Java Blue Prints, with lot of code examples.
Provide me some links ---> online free
compilers for java
You can download the last JDK from Oracle page for free. With the JDK you'll be able to compile.
Anyway, you better download a IDE to start programming. The easiest to learn is NetBeans. Other option, with more functionality and more customizable is Eclipse IDE.
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
I am in a project where previous programmers have been copy-pasting codes all over the place. These codes are actually identical (or very similar) and they could have been refactored into one.
I have spent countless hours refactoring these codes manually but I think there must be a better way. Some are very trivial static methods that could have been moved into an ancestor class (but instead was copy pasted all over by previous junior programmers).
Is there a code analysis tool that can detect this and provide reports/recommendations? I prefer free/open source tool if possible.
I use the following tools:
PMD/CPD (BSD-style License).
Checkstyle (LGPL License) - support was removed, see details.
Both tools have code duplication detection support. But both of them lack the ability to advise you how to refactor your code.
JetBrains IntelliJ IDEA Ultimate has good static code analysis with code duplication support, but it is not free.
Most of the tools listed on the Wikipedia article on Duplicate Code Tools will detect duplicates in many different languages, including Java.
SonarQube can detect duplicated codes but does not give recommendation on eliminating them. It is free and - although with the default setup it can only detect lexically identical clones
Either Simian or PMD's CPD. The former supports a wider set of languages but is non free for commercial projects.
http://checkstyle.sourceforge.net/ has support for finding duplicates
See our SD Java CloneDR, a tool for detecting exact and near-miss duplicate code in large Java systems.
The CloneDR will find code clones in spite of whitespace changes, line breaks, comment insertions deletions, modification of constants or identifiers, and in a number of cases, even replacement of one statement by another or a block of statements.
It shows where each set of clones is found, each individual clone, an abstraction of the clones having their shared commonality and parameterization of the abstraction to show how each clone instance can be derived from the abstraction.
It finds 10-20% clones in most Java systems.
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
Does anyone know of a good online compiler/runtime (for C++, Java, Python, ObjC etc.) that I can access on the web?
What I'm looking for is something that would allow me to type in a program in a web form and to run the program and see the results online.
(Let's not get into the why for now. Suffice it to say for the moment that I don't always have access to a compiler/runtime, and firing up an IDE is just overkill for testing out some code snippets)
I know of codepad.org -- but I'm looking for something better.
ideone is something better but what particular advence do you need?
http://codepad.org/
codepad.org is an online
compiler/interpreter, and a simple
collaboration tool. Paste your code
below, and codepad will run it and
give you a short URL you can use to
share it in chat or email.
Languages:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
Right now, you can use http://sagenb.org. This is a free open source online Google Docs-like programming notebook environment, which I provide (thanks to a generous grant from the National Science Foundation). Once you create an account and create a new worksheet, click on the box (fourth from left) labeled "Sage" and change it to Python. Now all the code you type in is evaluated using Python. The main drawback is that there are well over 30,000 users of this resource, so sometimes it is slow.
I found this online java compiler and runner. It works in realtime and also with threads. Amazing !
http://www.browxy.com
For C++, you could try CodeControl, Comeau or the one from code.vcer.net.
This one is good for ruby.
Here is an open source one: http://codenode.org, which supports Python and Sage well, but also aims to support other languages like Ruby, R, etc. Probably the best description of Codenode is "Google docs combined with Mathematica Notebooks".
CodeIDE is an ok one: http://www.codeide.com/
You can practice your SQL here.