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
Has anyone seen an example or done the following in Java:
http://duganchen.ca/single-page-web-app-architecture-done-right/
That is a design a single page web app that will work with Google SEO with out massive violation of DRY using Java technologies?
It doesn't seem terrible hard to do this on my own but I was curious (and lazy) to see if someone had already done it with either Spring or JAX-RS.
I have built quite a large "single-page" javascript website, that generats all HTML on the client. Server provides JSON only responses. I used Google Closure tools for the following reasons:
Google Closure Templates allows designing templates in high level templating language (named soy) which is compiled either to pure javascript functions to run on the client or java code to run on the server site.
Google Closure Compiler, which allows separating javascript code to modules and provides autmatic dependency injection for uncompiled mode. Good program structure and modularisation is necessary for any project exceeding simple html decoration. This is hard to achieve with frameworks like jQuery or dojo. In advanced compiled mode it transforms your javascript to shorter an more efficient equivalent, eliminates dead code and do dramatic reduction in size, which can shrink the original codebase to few % of the original size.
Google Stylesheets is meta css language which works great with closure compiler.
Google Closure Library is huge and well tested javascript library and with closure compiler, you only take what is needed.
To streamline the development, I'm using plovr, written by Michale Bolin, a former googler, one of the members of the original Closure Compiler Team.
I can recommend reading Michale's book: Closure, the Definitive Guide.
I must but warn, the initial leraning curve might be quite steep, but it is well worth the pain. Google used this tools to write almost all their web projects.
Just one more thing
If you feel really adventurous, and want to peep in to the future, I recomend upgrading the former strategy with Clojure/ClojureScript. For the start, watch this very persuasive talk of Rich Hickey and make sure to check Clojurescript one project.
I recommend AribaWEB for its advanced AJAX usage.
http://aribaweb.org/
Take a look to ItsNat, is a Java framework focused on Single Page Interface SEO compatible websites.
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
I want to create a website using HTML and the languages that i am most familiar with like C, C++, and Java in order to generate dynamic content. I am aware of the framework Django for Python which lets you do that(i think?) I know of the Common Gateway Interface/and FastCGI for C/C++/Java that lets me do just what i want. I think JavaEE/Servlet also lets me do what i want with Java. My question is are there any other more commonly(keyword: popular) used tools to let me do what i want for C, C++, and Java? I am new to web development so i do not know where to start, i want to become familiar with the technology used to develop C, C++ and/or Java programs for the web.
I can only speak about Java, but I would take a look at Velocity. This open source framework does a good job of allowing you to keep HTML and data generation code separate. Using things like Servlets and JSP are also commonly used for what you are trying to do. Try googling a little more, there are plenty of resources out there to learn web development.
A framework usually creates all the HTML, CSS, and Javascript code (the building blocks of a website) for you (no need to write it, it has been abstracted). Some C++ web frameworks are:
cppCMS
Poco
Tntnet
Wt
Google App Engine has a version in Go language which is a language developed by Google and is statically-typed with syntax loosely derived from that of C. Java has alot more web framework that are more popular and widely used. I personally have been using the Java web framework Vaadin.
Here is a comical article on frameworks: http://discuss.joelonsoftware.com/default.asp?joel.3.219431
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
What are some modern, more-productive alternatives to Freemarker as view technology for rich web-applications using Spring? Is Spring MVC/Freemarker still one of the best combinations, or are there others?
The application I have to build is small, but complex that will likely require a lot of custom javascript as all of the controls and ui is very non-standard (it's not really a business application). Blizzard's gaming websites like for Diablo 3 is an example of what I'm trying to do.
Is this combination still the best to suite my needs, or are there other technologies I should take a look at?
Thanks
There are several good and well established template engines on the market. Most of them play nice with Spring.
Velocity - a classic and one of the most popular template engines out there. Quite good, quite flexible, ugly syntax but good Eclipse plugin.
Thymeleaf - one of the most feature rich and flexible template engine on the market. Performance is good, although not ground breaking. My personal choice for most of the projects.
String Template - really good performance, quite hard to use. Very flexible, thought...
MVEL - seems to be really, really fast and quite feature-rich. For me it was to complex and quite hard to use in a project with junior devs.
Rhythm - from a Play framework to Java, nice and very flexible. Razor syntax is great. Rhythm is really fast, very flexible and nice to use. Another personal choice for my projects, next to Thymeleaf. There is a nice article on how to use this engine in Java.
httl - small, easy to use, not that fast but still good enough. Quite flexible but not that feature rich.
Trimou - another fairly new kid on the block. Looks decent, uses Mustache templating syntax and is fairly easy to use. But for my taste a bit too simplistic and missing some features.
Rocker - apparently a fairly new development, actively maintained and extended at this time. I like it, it has a nice idea for the syntax but it is nothing that resembles other syntaxes. A lot of simple features, missing some advanced ones IMHO. Very performant according to a test we just made.
Pebble - we used it for a couple of different purposes and it proved rather simple to use with a decent syntax inspired by Twig from PHP world. Performance is really good, one of the fastest we tried.
Performance wise, according to our tests, in order from the slowest:
Thymeleaf
Freemarker
Velocity
Trimou
Mustache
Pebble
Rocker
Your mileage may vary!...
There is a nice comparison of few of those (quite old article).
Also a nice tutorial on how to use some of them by Baeldung
There are plenty of template engines out there. Check this directory if you need more...
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 need tools to:
Conveniently parse Java source code and easily access given elements.
Easily generate source code files, to easily transform data structures into code
Any good tips, libraries, frameworks, tools? Thank you for help.
If you need to parse existing source code, use JavaParser. It gives you visitor-based access to the AST. You can write new code, but many things are a pain (e.g. referencing other classes)
If you need to generate source code use CodeModel. It lets you programmatically create classes, packages, methods etc, and it's very easy to use. However, I don't think it can import existing code.
Both are pretty awesome in their respective domains.
Since Java 6, the compiler has an API included in the JDK. Through it you can access the results of the Java parser through the javax.lang.model APIs. The same functionality was present with JDK5 in the form of the Mirror API. There's a good introductory article here.
The best code generation tool I've seen is CodeModel. It has a very simple API and can generate multiple Java source files at once.
Our DMS Software Reengineering Toolkit and its Java Front End can do this. They are designed to enable the construction of custom analyzers and code generators.
DMS provides generic parsing, abstract-syntax tree (with comments) and symbol table building, tree navigation/inspection/modification facilities, and the ability to regenerate the complete source code from the modified tree. Additional facilities includes source-to-source transformation rules ("if you see this syntax, replace it with that syntax"), and patterns (used to build or recognize subtree), attribute grammar evaluators, control and data flow analysis, and call-graph construction. The Java Front End specializes DMS to do all of this for Java 1.4-1.6 with 1.7 nearby.
(EDIT May 2016: Now handles Java 1.8)
DMS is also designed to handle scale: it is often used to process many compilation-units (source files) at the same time, enabling analysis and transformations that cross file boundaries. It can also handle multiple languages at the same time; DMS has front ends for a wide variety of languages.
Check out Antlr. One of its examples is a Java grammar.
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
We are currently researching ways of enhancing image quality prior to submission to OCR. The OCR engine we are currently utilizing is the Scansoft API from Nuance (v15). We were researching the Lead Tools but have since decided to look elsewhere. The licensing costs associated with Lead Tools is just too great. To start with we are looking for simple image enhancement features such as: deskewing, despeckling, line removal, punch hole removal, sharpening, etc. We are running a mix of .NET and Java software, but java solution would be preferred.
Kofax is good for pre-processing, but for the types of cleanup you are talking about may be overkill unless the images are really bad. Unless your specialty is in image processing, I'd recommend working with a provider that does the image cleanup and the OCR so you can focus on the value you actually add.
We license the OCR development kit from ABBYY (ABBY SDK) and have found it to be superb for both image processing and OCR. The API is quite extensive, and the sample apps, help and support have been beyond impressive. I definitely recommend taking a look.
Disclaimer: I work for Atalasoft
We have those functions and run-time royalty-free licensing for .NET.
http://www.atalasoft.com/products/dotimage/
We also have OCR components including a .NET wrapper for Abbyy, Tesseract and others and Searchable PDF generation (image on top of text in a PDF)
Not sure if this would be quite up to the standards that you guys would need, but perhaps you should look at some of the Paint.Net APIs. I don't know how easy it would be to extract their image processing algorithms for use in your project, but I believe they do some of the things you are looking for. Plus it is an open source project with an MIT License, so it should be pretty friendly for business use.
Research about KOFAX VRS at KOFAX.com
Maybe JMagick, it is an open source Java interface of ImageMagick. It is implemented in the form of a thin Java Native Interface (JNI) layer into the ImageMagick API. It's licensed under the LGPL so it shouldn't be a problem license wise.
http://sourceforge.net/projects/jmagick/
I would suggest Intel for its zero-cost runtime licensing.
Depends on the number and quality of the original images. Managed code and imaging tool kits will work but it's not always the best solution if you haved several million images to process. For small batches and tight budgets, I agree with the previous posters that projects like Aforge, Paint.NET, and other open source computer vision libraries will do the trick. Of course, you are on your own if the results are not improving... At least this let's you put everything you need under one application for a low cost.
If you are processing several hundred thousand images a month, then I would suggest you divide up the process into smaller workflow step and tweak each one until your cost per image gets as close to zero as you can. You will find that the OCR results rise quickly at first and then level off sooner than you expected. (I'm not a big fan of OCR but it has its place)
I use commercial Windows product from Recogniform to process and clean up the images prior to OCR in a batch mode using scripts adjusted for various kinds of images. If an image fails QC or is rejected by the OCR engine, it is "repaired" by hand using a custom .NET application built with Atalasoft's toolkit. Batch process everything and only touch what fails.
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
Are there any good tools out there for automatically converting non-Java source code into Java source?
I'm not expecting something perfect, just to get the worst of the grunt work out of the way.
I guess there is a sliding scale of difficulty. C# should be relatively easy (so long as you ignore all the libraries). (well written) C++ not so bad. C requires making a little OO. (Statically type) functional languages may be easy to grok. Dynamic OO languages may require non-local analysis.
One thing you can try is find a Java bytecode compiler for the language you're talking about (there are JVM compilers for all kinds of languages) and then decompile the bytecode back into Java using a decompiler like Jad.
This is fraught with peril. The regenerated code will suck and will probably be unreadable.
Source-to-source migrations fall under the umbrella of Program Transformation. Program-Transformation.org tracks a bunch of tools that are useful for language recognition, analysis, and transformation. Here are few that are capable of source-to-source migrations:
ASF+SDF Meta-Environment - As noted, there is no new development on this tool. Instead, the developers are focusing on Rascal.
Rascal Meta Programming Language
Stratego /XT
TXL
DMSĀ® Software Reengineering Toolkit (commercial)
If you spend any time with one of the open source tools, you'll notice that even though they include source-to-source migration as a feature, it's hard to find working examples. I imagine this is because there's no such thing as a one-size-fits-all migration. Each project/team makes unique use of a language and can vary by libraries used, type complexity, idioms, style, etc. It makes sense to define some transformations per migration. This means a project must reach some critical mass before automatic migration is worth the effort.
A few related documents:
An introduction to Rascal - includes a migration between the toy language Pico and Assembly starting at page 94.
Cracking the 500 Language Problem
An Experiment in Automatic Conversion of Legacy Java Programs to C# (gated) - uses TXL
Google: ANTLR
The language conversion is fairly simple, but you will find the libraries are different.
This is likely to be most of your work.
If you just want to use some legacy C/Pascal code, you could also use JNI to call it from Java.
If you want to run it in a Java applet or similar constrained environment, and it does not have to be very efficient, you can use NestedVM (which is a MIPS to Java bytecode converter) in conjunction with a gcc cross-compiler that compiles to MIPS). But don't expect to get readably Java code from that.
Any of those tools might help only if your non java code is not huge enough.
If its huge non java code and if you want to seriously translate it to java, then few things need to be thought of, its not just hundreds of lines of code, there is a design beneath it, there are few decisions taken by people beneath the code due to which certain problems might have been solved and few things have been working there. and investing time on any good translator won't be worth as it won't exist, it's not just syntax translation from one language to another.
If its not so huge code, its better to re write in java, as it has so many APIs packages out of box, it might not be big deal, hiring few interns for this also might help.
ADA to Java can be done with a find-and-replace!