Compact image encoding in Java [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I would like to encode/decode an image in an encoding like base64. However, I'm not using base64 because the encoded result is too large: I want the encoded size to be small.
I've searched Google many times, but have not found any useful information for my requirement.
Can anyone help me to find a more compact encoding than base64?

If your requirement is that the encoded image must be printable in ASCII, then Base64 is probably a good generic bet. If your requirement is really to have as small a binary representation of your image as possible, look into JPEG and PNG (depending on the type of image, requirement of lossy/lossless etc). If you have a lot of time on your hands and want to fiddle with mathematics, try fractal compression?
As others have commented, if your requirement is to store an image in a database, most/all RDBMS provide some form of BLOB to achieve just that.
Cheers,

Related

Additive White Gaussian Noise Java in dB [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am trying to add AWGN to my audio file. I convert my wav file to byte array. I am trying to add 10dB AWGN to this array. In matlab there is imnoise which adds AWGN to image. In java is there any library? Thanks in advance.
If you actually need the additive Gaussian white noise output similar to that of Matlab's imnoise function, this is the extent of the code that you need to implement in Java:
B = A+MU+STD*randn(size(A))
where A is your input data, B is your output of the same size, MU is the mean of the noise, and STD is the standard deviation. Independent and identically distributed (IID) Gaussian white noise is added to each component of A. This calculation needs to be done in floating point (as many of Matlab's image processing routines are).
The randn function produces normal random variates. You can use java.util.Random.nextGaussian() to produce these. If you need some extra speed, try a Java implementation of the Mersenne Twister algorithm.
Not sure if i got the question correctly. Ist that the thing your are looking for and then just regulate the db over whatever player you are using?

Java library for text analysis and counts [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need a stable Java library that I can pass a huge string to (e.g., a few chapters from Moby Dick) and get "word count"-like stats:
Number of paragraphs
Number of sentences
Number of words
Number of characters
Preferably something internationalizable/localizable but not required. I figured Apache Commons would have something like this, but after a thorough search it does not.
I could write this myself but it would probably be buggy and take a lot of time; plus I don't want to reinvent the wheel if it already exists. I am thinking of using Apache Tika but cannot confirm if it will do what I need. It seems to handle word count, but not the others. Thanks in advance.
Take a look at Apache Tika. It might serve your requirements

Taxonomy API in Java or Javascript [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was wondering if there is any api or library available that provides a taxonomy for a given term in jSON.
For instance, if the argument is Shoes, it should return a data structure consisting of all the synonmys or types of shoes like Boots, Flip-flops, Slippers, Stilettos, and so on..
Thanks :)
Your best bet is to use the Java API for WordNet
http://lyle.smu.edu/~tspell/jaws/index.html
You can wrap this inside a servlet and call it via jquery in your application.
JSON is not typed by itself, you have to use another notation to add type to the data encoded in JSON. JSON-LD for example allows to add the concepts of linked data/semantic web to the json data. Using this information it is possible to query the taxonomy that defines the structure of the data.

java: csv...do I need a library? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Do I need a library if I only need to make csv formatted file. I don't need reading and parsing it.
No, you don't. And even reading/parsing can be easily done with a plain JRE.
CSV is a plain (ascii-)text format with only a few rules:
rows (objects) are separated with a \n
columns (fields, attributes) are spearated with a delimiter char (usually a comma, but define whatever you need)
row and column delimiters must not be part of the field values
Unless it's a really trivial part of your application and you're absolutely sure you won't ever need to parse a CSV file, you need a CSV-serialization library.
I have tried openCSV and I'm pretty happy using it. Of course you can write your own class to handle this serialization, but a library always comes with more features at the expense of an extra dependency...

What HTML parsing libraries do you recommend in Java [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to parse some HTML in order to find the values of some attributes/tags etc.
What HTML parsers do you recommend? Any pros and cons?
NekoHTML, TagSoup, and JTidy will allow you to parse HTML and then process with XML tools, like XPath.
I have tried HTML Parser which is dead simple.
Do you need to do a full parse of the HTML? If you're just looking for specific values within the contents (a specific tag/param), then a simple regular expression might be enough, and could very well be faster.

Categories

Resources