how to Autofill my data in java program - java

Hello people,
I just learned java & it's basics. I really new to programming. I'm really ambitious to create my first project. My Application kind of used for ** grocery store** type. Please Understand.(I couldn't explain it)
Details:
It's just kind of Seller ledger book
It has all types of products prices & their other important details & which is updatable
It's design kind of Ms-Excel where default columns are generated
when a item is typed in respective column in the product name. The application retrieves that particular item & it fills in the details. ( main feature)
I'm sorry for very vague details.Well my take is
Java Swings for GU-Interface
I think I need database for my application
I clearly don't have enough knowledge but trying to implement this project only way I can motivate my self to learn. Internet is my only resource. Please Help me.. in anyway.. Thank you.

Considering you are new to programming, I would suggest create a CSV file and put details in there. When you start your program you can read the details from there. The format of File could be like:
ProductId,ProductName,Price,Description
P1,Soap,10,Cleaning
P2,Shampoo,50,Hair Wash
.....
and so on.
You will easily find ways to read a CSV file as in this link.
Here

Related

How to get topic vector of new documents and compare with pre-defined topic model in Mallet?

I'm trying to somehow compare a sole document's topic distribution (using LDA) with, other files and their topic distributions within a previously created topic model, using MALLET.
I know that this can be done through MALLET commands in terminal but I'm having problems in finding a way to implement this in Java.
To give a gist of what the functionality of my program is:
The already created topic model was created with a large corpus of texts. I want to use this to compare topic distributions with a tweet that contains a certain hashtag and to then pull out the file most similar to the tweet from the corpus.
Ive read through Mallet's Java API docs but they seem very confusing and not really explanatory.
If anyone could give me a few tips I'd appreciate it
First, take a look at these:
Developer's guide
Tutorial slides after slide 97
Code examples in the source directory: src/cc/mallet/examples
Now, these examples show the basic functionality, but they don't show how to save and load the model if you need to separate training from testing. Basically what you need is to save both the model and the instances after training (since you need to train and test with the same pipeline), and load them before testing.
Save model and pipeline after training:
model.write(new File("model.dat"));
instances.save(new File("pipeline.dat"));
Load model and pipeline before testing:
ParallelTopicModel model = ParallelTopicModel.read(new File("model.dat"));
InstanceList instances = InstanceList.load(new File("pipeline.dat"));
Hope this helps.

cheque printing application in java

I want to develop an application in Java which takes data (ex.name of person, Amount) from excel-sheet and print it on cheque. I can able to access data from excel-sheet but don't know how to print that data on cheque. Data must get print on appropriate location on cheque (ex. name should get print where blank space is given for name). please give me a guideline for this. Thank you in advance. I am not native English speaker so kindly ignore my mistakes.
You can use a reporting tool. You can see examples here: http://www.dynamicreports.org/
I would create a PNG image for each record, with a transparent background and data at the right place. Then I would launch the printing of these images .
That sounds hacky and someone might have a better idea.

Using WEKA classifier model in Java for classifying real time text

I had used the GUI to train a classifier for some sample arff files . After training I saved the obtained model .
Now that I need to use this model file in my java code to classify some text , could you please tell me how should I proceed ? I dont want to do an evaluation but would like to classify the input text given .
I had gone thru the http://weka.wikispaces.com/Serialization & http://weka.wikispaces.com/Use+Weka+in+your+Java+code .
But still couldn't find code for it .I just got an way to load a model file .But didn't get any clue on classifying text directly to classes . Any help on this regard would be helpfull .
Although the previously suggested post is very nice, I believe that the one I produced some time ago better fits your needs, as it specifically deals with text, and it is generic regarding the classifier. Please check "A Simple Text Classifier in Java with WEKA".
See here, similar tutorial by Hidalgo - Java code with slides and textual dataset. It trains a machine, loads the model and classify real time unseen textual data. Very easy to follow
https://github.com/drelhaj/MachineLearning

Java - Get data from JRMapCollectionDataSource

I'm new into the forum.
I want to take this opportunity to thank everyone for the support you have given me many time.
My problem is the following:
I'm trying to get data from a JRMapCollectionDataSource from a java class.
Let me explain better...
I want to test the resulting PDF file from a batch operation.
I can access to the first level fields of the report (made with iReport), but not with the datasource of the internal TABLE represented into the PDF and populated with a JRMapCollectionDatasource.
My question is:
HOW can i access to a JRMapCollectionDatasource from java???
Thanks to all

How should I save a dictionary database with java?

When I google "how to make a dictionary", it gives me a great measure of the explanation of "make", which is very helpful. But I need something else, so I put this question here.
I want to make a small project. I want to make a dictionary with java or android. But I don't know how should I organize the words. I have considered a JSON file, a XML file or I can also simply output all the words as ojbects into a file. Could anyone please give me some adivce?
Assuming that you want to be able to read (quickly) values from your dictionary, and maybe update values or create new values then I suggest that you store your dictionary in a Database. For a simple Java database I suggest that you use an embedded Derby Database.
see http://db.apache.org/derby/

Categories