Whenever i try to display a two dimensional array object in a diagram using NClass for example it keeps giving me an error saying its invalid declaration, however it doesn't give any error using a 1 dimensional array. Any tips would be appreciated
I have posted a screenshot of the error
enter image description here
It's so difficult to discover what the tool is used in your question. In any way, the same tools support the object description, relations etc. From your screen, I can guess, that your soft don't support java format of description like: "int[][] board" and attribute "protected". I can guess that you need to write only "int[][] board" or only "board" and in its description int[][], but attribute "protected" you need to write in another place.
Related
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.
I am a beginner at Java. I want to display an array of objects (of my class) in a Frame. For example, the object has a name field and I want to display the fields's value of all the objects in the array.
Can someone help me find a way to resolve this without necessarily providing code?
I currently use iReport 5.1.0, Tomcat 7, Java, Spring MVC amongs other things.
I believe my current problem lies within the iReport itself, although it may be more complex.
I currently have an Object (Guide),
My Guide has a list of Objects, (itemsGuide)
My itemsGuide has a list of Objects, (itemsTeam)
My itemsTeam has a list of Objects, (professional)
My professional has a name.
My jasper file, receives as parameter the Guide, in the iReport software I must assign the fields and the current variables, although I must print, in a single line, parameters from the itemsTeam object (a couple of strings), and in this very specific case I will always have only one professional, although the variable lies within a list, therefore I must access the first object in this array to then display its attribute.
I keep getting the most unusual errors as I try to do this rather simple process.
The iReport either doesn't find the variables in itemsTeam or the ones in professional, when, for some unknown reason it "works" my preview of the PDF (it says "The document has no pages", to avoid the error msg I change the attribute in my report proprety, but now, it simple shows the iReport file without any field/variable, only the graphical elements).
I am utterly confused, would anyone be so kind as to lend a hand to this poor newcomer?
the JRXML file has over 37k characters and I can't post it as an edit, I uploaded as a txt file insted.
Thanks in advance.
No more need for the link to the xml ~
-- CATURDAY EDIT --
Allright, I seem to be getting closer to my solution.
At this point I've tried quite a few different approaches to my problem.
Although I couldn't completely solve it, I managed to get closer, or so I believe.
Now, all I have to find out (it seems) is:
How to access an array within an array.
I managed my way around the guide and the itemsGuide, I can't access the array within itemsGuide, I need to access a variable named "team" within that array (itemsGuide) and then print the value of a few strings in this array (which is of a specific class, itemsTeam) and a string in an object (professional).
All this, without subreport.
Anyone ?
Allright, what I spent about 4 days trying to find out, my co-worker with more experience than me found out in about 20 minutes.
The issue wasn't within iReports itself, it was necessary to create methods in the class in order to return the desired object/list, something I did not even consider given that I know very little of how iReports (and java honestly) works.
But according to what I understood from what has been done it has something to do with reflection and a couple of methods in the java class.
Thanks guys. :>
I've been searching for an answer to this for a while to no avail.
First a bit of background: I'm trying to create an AI for robocode using Weka.
I'm first logging the required data from a manual robot to an ARFF file, this is working as it should.
This data is then processed this using Weka and a model created, I'm then saving this file.
I can successfully import the model and classify a dataset that has been imported from another arff file and use the results.
What I want to do now is every time the game status changes is assemble an instance and classify it, to decide for example which way to move etc. using my previously saved model.
I've tried to look it up on the wiki: http://weka.wikispaces.com/Programmatic+Use
and this ibm tutorial: http://www.ibm.com/developerworks/opensource/library/os-weka3/ to name a couple, I've also been looking through the APIs but that hasn't given me much to go on.
Much of what I've tried is deprecated, for example creating a prototype with the attributes and fast vectors then creating an empty dataset. Then creating a new instance with the required values using somthing like inst.setvalue(attrib, value) and adding it to the dataset.
Also what about the class index, or the attribute I'm predicting, in the instance does it have to be null or set to missing or something, as surley I won't know that value as I'm trying to predict it?
So are there any ideas how I can go about this?
any help is greatly appreciated,
Thank you muchly.
Managed to find the answer a while ago.
For anyone else having trouble with this basically what you have to do is in the Weka manual included with every download, (its a pdf).
Page 202 onwards in the manual - Section 16.3 "Creating datasets in memory".
Follow the steps there and it works perfectly.
Is there a way of using Android's auto correct / predictive text capabilities with a bespoke input method? I'd like to be able to access a list of the nearest words to the word entered, similar to what happens when we send a text. For example if I entered the string "hapy" I would get a list containing "happy", harpy", "hazy" ...
Looks like a yes.
And the place to start: http://developer.android.com/guide/topics/text/spell-checker-framework.html
You wouldn't want to. First off, predictive text was only turned into a service with 4.0. Before then it was just part of the keyboard, and most keyboards still implement their own I suspect. Secondly, it would be optimized for typing mistakes, not voice mistakes. Typing g instead of f is common (they're next to each other), doing it by voice is not. It wouldn't work well.
But the built in voice to text behavior does return alternatives- it returns an array list of possible texts. That is your auto-correct.