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 have 2 arrays containing time and voltage. I would like to convert time domain to frequency domain in Java. I would like to use FFT. If there is any open source library I could use, please point me to it. I have done a research and found few algorithms but they are asking for real part and imaginary part. If anyone got idea regarding that, please let me know how I could use that in my context.
Code I have found so far
Here is one library:
http://www.fftw.org/download.html
You can also use R with Java. See this link:
Java-R integration?
If you are not familiar with R check their home page r-project dot org (I can't post more links)
While I haven't checked the implementation you link to, you should be able to use that one by suppling 0s for the imaginary part. In that case you are going "forward", i.e. set DIRECT to true transforming from time-domain to the frequency domain. The function will return an array containing real parts of the frequency in even numbered seats, and the imaginary part in odd numbered.
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'm looking for an api/method/framework where I can compare strings. One is a string stored on the server whereas the other is a string given by user input.
For example:
Stored String : "Login"
User input : "login" "log in" "lOG IN" or any such permutation.
I'm using java in spring mvc (making a webapp). the server is getting a string from the user and then looks for a string similar to the given string and returns the found records.
Any help would be appreciated. Thanks
Unless your data size is small (< a few MB), you probably want something like Apache Lucene, which can be used to index and search large document sets, and can do fuzzy searches using Levenshtein distance and other algorithms for similarity matches.
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 add custom logic/class to my custom Jackson JsonSerialize implementation such that it parses out html based on certain rules. For example, if html is inclosed in single quotes '<b>'text'</b>' then the custom logic should accept the string as is. If its not in single quotes, like <b>text</b> then I want the custom logic/class to return just text. Additionally, if I have a block of html enclosed in three single quotes '''<html><head><title>example</title></head></html>''' it should accepted as is but if its not then only the example text should be returned and everything else parsed out. What is the best Java library to accomplish this? I thought about using AnitSamy but that leaves me open to an XSS attack since I need to accept anything inside quotes.
Examples:
input:<b>text</b>
output:text
input:'<b>'text'</b>'
output:'<b>'text'</b>'
input:<html><head><title>text</title></head></html>
output:text
input:'''<html><head><title>text</title></head></html>'''
output:'''<html><head><title>text</title></head></html>'''
You could use the Java Regex engine to look for patterns. Ex:
p = Pattern.compile("'''[\\w*]'''");
m = p.matcher(input);
if(m.find()){
//Do some logic
}
Here's a link to a Java Regex website:
http://www.regular-expressions.info/java.html
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 interpreting scientific (STEM) images into their component parts and adding semantics. These images are born digital, noise-free and either binary (monochrome) or have a small number of colours. I would like Java libraries/methods to partition the images into the whitespace-separated components and to identify (classify) the resulting segments. A typical image is:
where I would want the extracted segments to include numerals and other characters (some rotated) and the asterisks in the diagram. [I will use other methods to extract the geometrical components - e.g. the bars) . I would also like the library to identify identical segments (e.g. 6 zero characters, 5 decimal points). I have successfully used Tesseract for characters but many of the segments may not belong to a Unicode character set (e.g. purpose-created symbols).
UPDATE: I have opened a bounty. I am only interested in libraries, NOT suggestions for algorithms as I have already written a prototype one. If the functionality is part of a larger system (e.g. I think JBIG2 has this functionality) please make it clear where the entry points are.
NOTE: "born-digital" means that the image was created without noise, clean lines unlike - say - scanned documents.
I am only aware of openCV. With this you can analyze your image like:
binarizing it (if you have a few colors or greyscale)
gather blobs in Mat-objects
get the position of those Mats to get the correct label (which should be a Mat for each letter)
and then apply your algorithm to those Mats
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 used tf/idf to calculate consine similarity between two documents. It has some limitation and does not perform very well.
I looked for LDA (latent dirichlet allocation) to calculate document similarity. I don't know
much about this. I couldn't find much stuff too about my problem.
Can you please provide me any tutorial related to my problem? Or can you give some advices how can i achive this task with LDA???
Thanks
P.S: also is there any source code availabe to perform such task with LDA??
Have you had a look at Lucene and Mahout?
This might be useful - Latent Dirichlet Allocation with Lucene and Mahout.
You might be thinking of LSA (Latent Semantic Analysis) which is a very common solution to this kind of problem.
A bit old, but for anyone still interested, take a look at this blog post (disclaimer: this is my own blog). The algorithm described there and the linked code will probably do what you need if you don't have your heart set on any specific approach.
Regarding Shashikant's comment, the cosine similarity may not be a good option because the signatures are proportional in length to the documents. Constant length signatures are preferable.
Try this service for computing cosine similarity between two documents
http://www.scurtu.it/documentSimilarity.html
import urllib,urllib2
import json
API_URL="http://www.scurtu.it/apis/documentSimilarity"
inputDict={}
inputDict['doc1']='Document with some text'
inputDict['doc2']='Other document with some text'
params = urllib.urlencode(inputDict)
f = urllib2.urlopen(API_URL, params)
response= f.read()
responseObject=json.loads(response)
print responseObject
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
Can anyone tell me where to find a Java library that does Muslim prayer time calculation based on the city? Maybe a web service? I would prefer a Java library.
http://www.javafr.com/codes/PRAYER-ALERT-SALA_40601.aspx
hello, it's not a library but a student project. But quite well executed.
Or : http://www.directionsmag.com/article.php?article_id=2956
A method to calcul prayer time with google map+local time ( in short : check where you are, check how far your are from the Makkah , apply the right formula )
You can make use of the PrayTimes library.
http://praytimes.org/code/
It's originally written in JavaScript, but there are ports to other languages as well.
I think Ubuntu Muslim Edition uses this type of features in a calendar, maybe you could search around there
Best is https://github.com/abodehq/Pray-Times for this question. It includes java, objective C,PHP, C#, javascript, python, c++ code implementation. It supports different methods and calculation is based gps position.Calculation Methods are Ithna Ashari,University of Islamic Sciences, Karachi, Islamic Society of North America (ISNA),Muslim World League (MWL),Umm al-Qura, Makkah,Egyptian General Authority of Survey,Institute of Geophysics, University of Tehran,Custom Setting. Juristic Methods are Shafii, Hanafi. Adjusting Methods for Higher Latitudes. Formats are 24-hour format/12-hour format/12-hour format with no suffix/floating point number.
I think that is come out port of ITL for Java on sourceforge.net