Save math formula into database [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've got a database of questions in SQlite that I read them from my java code. My questions are questions of Mathematics and I provide them as a text in the database.
My problem is that in several questions I want to include mathematical symbols and operators that I can include with my keyboard and provide it as a text.
Is there a way to include my math symbols inside the database?
Or I have to do it from my code?

I see two options
1. Unicode
In Sqlite choose text type that stores unicode. In unicode, you have plenty of math symbols https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode
If unicode does not contain symbol you need, you are out of luck, and you need some other solution
To store text as unicode, see http://www.sqlite.org/datatype3.html and https://stackoverflow.com/a/19397231/1849837
2. Math language
Store equations in some math language that is able to describe equations. In this solution, in order for your equations to look nice you will need something that translate quation description (pure text) into equation image.
If you ask this question on https://mathematica.stackexchange.com/ I am sure you will be advised component and data format that fit your needs.

Related

Run a math expression from string in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to know if there is any efficient method to Run a math expression from string in java , Having some example input and results of that function.
Starting from simple linear functions : a*x+b .To more complex ones
Or is there any good source i can start reading.
I take your task as: take observed input-output and learn some representation which is able to do that transformation with new inputs.
(Some) Neural Networks can learn an approximation-function (Universal approximation theorem
) (and probably other approaches), but there is something important to remark:
Without assumptions about your function (e.g. smoothness), there can't be an algorithm achieving what you want to do! Without assumptions there are infinite many approximation-functions, which are all equally good on your examples, but behave arbitrarily different on new data!
(I'm also ignoring special-cases as: random-data or cryptographic random-generators where this mapping also can't be learned (the former in theory; the latter at least in practice)

How to convert tamil string to english string in java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am doing a project which involves NLP. I need to transliterate Tamil String to English string(In tanglish form) like "இல்லை" to "illai"..
How can i do that using java ??
Help me with the code sample
As there are only 72 characters in the Tamil block, build a translation table and then build a new string by testing each if character can be translated before adding it to the list.
For example U+0B87 (இ) becomes i
If you are more familiar with Java and/or have a very large amount of material to translate, there are likely a few processing optimizations to speed up the process, but I suspect the above will be the base of a good solution.
If you only have a small amount of material to translate or this is a one-off job, it may make more sense to simply use Google Translate and get the input translation below the input box.

Write only one number in text field [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can i let user write only one number in text field? Other should be consume.
I have code for write number.
private boolean number(char zn){
if(zn>='0' && zn<='9')
return true;
return false;
}
You state that this is a Swing question, and so I assume that you are using a JTextField. If so, you have one of two possible solutions here:
Use a JFormattedTextField and use a MaskFormatter, something simple like "#" should probably work perfectly here.
Or get the JTextField's Document and set its DocumentFilter with one that restricts input to as you deserve it. I think that this would be unnecessarily complex for you, and I recommend the first option.
Check the tutorial on how to use JFormattedTextFields which you can find here: JFormattedTextField Tutorial. It will explain all of the above including how to use a mask formatter with JFormattedTextFields.
Also please check Jon Skeet's blog on Writing the Perfect Question. Writing questions on this and other sites is a learned skill which can get better with study and effort. The tips that this blog contains will help you so that you'll know what information to include in your question so that the volunteers helping you don't have to guess at things. They will appreciate it, and you'll likely get better and quicker answers.

Algorithm for finding trends in data? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm looking for an algorithm that is able to find trends in large amounts of data. For instance, if one is given time t and a variable x, (t,x), and given input such as {(1,1), (2,4), (3,9), (4,16)}, it should be able to figure out that the value of x for t=5 is 25. How is this normally implemented? Do most algorithms compute lines of best fit that are linear, quadratic, exponential, etc. and then chooses the line of best fit with the lowest standard deviation? Are there other techniques for finding trends in data? Also, what happens when you increase the number of variables to analyze large vectors?
This is a really complex question, try to start from: http://en.wikipedia.org/wiki/Interpolation
There is no simple answer for a complex problem: http://en.wikipedia.org/wiki/Regression_analysis
A Neural network might be a good candidate. Especially if you want to learn it something nonlinear.

What is the procedure to make code like Java Editors do, they make keywords of different colors and statements of different color [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
what is the way or logic to make code like java Editors do, the make keywords red and other statements black, i want to make the java code for it.any help will be appreciable.
Use JEditorPane. This is excellent tools to make your keyword color as well as HTML tags.
You need a component which shows HTML string. Some strings, which you consider "java keywords" are taking "blue keyword css style" and others ( static variables) bold style and so on. A long ways to do it, start with an open-source IDE and see it.
I guess they use an Abstract Syntax Tree.

Categories