Moojid Hamid

Ranch Hand
+ Follow
since Mar 07, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Moojid Hamid


As its for one column only i need to specifically
if (this column then )
use below sorting techinque.





And also i am not very clear about how to sort it based on folat and units values



How is the data for that column represented in your TableModel? If it is a String you can split it before doing the comparison in the compareTo method. I would suggest you read the tutorial that I mentioned earlier. Also look up information on how to implement Comparator/Comparable
10 years ago

I need to hardcode the column number



Could you please elaborate what do you mean by that? You might want to look at the setSortKeys and setComparator methods of the TableRowSorter.
10 years ago
The browser's "view source" does not show the JSP source code, if that is what you are worried about. It only shows the rendered HTML.
10 years ago
JSP
In your code


the lookup index "(crc >> 8) ^ b" can be as high as 0xFF, since your array length is also 0xFF the maximum index should be 0xFE, it looks like an 0 based vs 1 based index error, java arrays are 0 based.
11 years ago
Well, both error messages are self-explanatory: first one is telling you that it cannot find that constant that you are referring to (you need to qualify it with the class/interface name it is defined in). Second error message is telling you that the method is not static method, you need an object of type PdfStamper before you can call this method (remember stp object?)

IMHO, what it shows is that you need to get up to speed with java basics, copy pasting code from different sources is not going to take you very far. I am not attempting to be rude, you need to pick-up a good book on java and practice a little, it will help you figure out many things on your own.

This thread seems more suitable for OtherOpenSourceProjects forum.
11 years ago
instead of using pdfSecure try the setEncription methods of pdfStamper, that way you can sign and lock using same pdfStamper (stp) object.
11 years ago
Have a look at the Java Doc.

encryptType - - The encryption type to use, this value can be either PDFPermissions.ENCRYPTION_RC4 or PDFPermissions.ENCRYPTION_AES.




11 years ago
For that last parameter you can either specify RC4, or AES. AES only works for newer versions of acrobat reader, you can either use RC4 or update to a newer version of acrobat reader.
11 years ago
Look at the signature of the method you are calling, in your method call you are missing the last parameter of type int.
11 years ago

Christophe Verré wrote:Quoting this page : When you take an element out of a Collection, you must cast it to the type of element that is stored in the collection. Besides being inconvenient, this is unsafe. The compiler does not check that your cast is the same as the collection's type, so the cast can fail at run time.



As far as I understand the question is about the OO design principle "Program to interface not implementation", it is not about generics. There are many advantages, biggest one being loose coupling and flexible design. It allows for the implementation to be changed with minimal code changes.

This is one of the core OO design principles. To really appreciate the benefits, it would be a good idea to read a book on design patterns. Head first series has a good one on this topic that makes the design principles and design patterns easy to understand.

11 years ago
Try to use



11 years ago
Welcome to JavaRanch.

1- since ant.jar is nested it works.

2- Nested Jars are not loaded by default class loader. i.e. nested jar files are not supported.

3- There are some other tools (try google) that make it possible, but by default it does not work. If you want a single Jar, one option is to unjar all the jar files and create a single jar from the class files.
11 years ago

bob jacosin wrote:is it possible to use the method-local inner class as return type of the method where the inner class is in?



No but you can return the super type, or pass it as a parameter to a method that accepts its supper type or assign it to a instance variable ( of a type that is super class of your local class). If there is any outside reference to the local class object after the method finishes it will still be accessible.
11 years ago

Vijitha Kumara wrote:

Ketan Mohite wrote:I don't see that java.util.Date class checks up to seconds.


Yes, It does.You can try it simply running following code inside a main method,



If you uncomment the commented lines you will get the output true, otherwise false (i.e: second Date object is one second after the first one).



That hardly proves your point. Look at the javadoc for java.util.Date it clearly states that Date has millisecond precision. The reason that you get true in your example is that the your computer is running fast enough two create two Date objects in the same millisecond, since the Date is precise up to millisecond only they are equal. Millisecond may seem very short to you but to your computer it is quite a long time period.
11 years ago