|
johtnkucz wrote: This is site is so much better than stackoverflow haha.
If nothing else you get a 5 for that comment.
Seriously, thanks for the feedback, it's always welcome, and good luck with your project(s).
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I never rely on luck. I prefer efficiency and preparation (and utilizing awesome resources like this site!)!! Seriously thanks for the positive feedback...on my positive feedback!!
Seriously though This is my number one code-help (I have other resources for tutorials and stuff but if get stuck and need help) this owns other sites, including stack overflow. Your response was extremely helpful. thanks again so much for looking at code.
And re stackoverflow. I hate that site. Most comments and posts have this gross disgusting milieu of (ooh look how much coding I know or some cheesy leet rubbish of "no, you're supposed to post this way..or that way.." or whatever.
I just was thoroughly stumped, chucked up some code:
1. got the EXACT answer that was the prob
2. learned somethign I never fully understood even after a wretched computer science class and most all autodidactic(== compares objects not content of objects and strings may be equal but diff objects, so if linked to diff objects same content will appear as not equal because their objects are not equal but their content is) .
That's the epitome of helpful. Anyways if one gets similar exchanges, this is num 1 code resource. good times. The layout of forum posts/responses is unique and novel but appealing, too. Good tiems.
Were you involved in making this site or something, or just prefer this (anti overflow) to other sites, too. Cheers. thanks.
|
|
|
|
|
johtnkucz wrote: Were you involved in making this site or something
No, I'm just one of the 8.5 million ...
If you want to know a bit more about the site see here[^], and if you want to know who are the great people who did make the site then look here[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Buy using stringBuffer and string equals method we can check try this following code
import java.util.Scanner;
import java.lang.*;
public class ReverseString{
public static void main (String[] args){
String inputString="";
int inputStringLength;
String reverseString="";
String stringHolder="";
Scanner in = new Scanner(System.in);
System.out.print("Enter a String: ");
inputString = in.next();
StringBuffer sb=new StringBuffer(inputString);
sb=sb.reverse();
if(inputString.equals(sb.toString()))
{
System.out.println("palindrome");
}
else
{
System.out.println("Not palindrome");
}
}
}
|
|
|
|
|
I have created a java servlet in which i have fetch the value from database using mysql i just want to use this fetch value in to my Js file.
So how can i do this????
Reply
swapnil
|
|
|
|
|
|
I display the progress bar for downloading attachments and it works fine … but when I am downloading some attachments I get the exception message:
Exception in thread "main" com.sun.mail.util.DecodingException: BASE64Decoder: Error in encoded stream: needed 4 valid base64 characters but only got 1 before EOF, the 10 most recent characters were: "Q3w5ilxj2P"
I found the explanation:
Certain IMAP servers do not implement the IMAP Partial FETCH functionality properly. This problem typically manifests as corrupt email attachments when downloading large messages from the IMAP server. To workaround this server bug, set the "mail.imap.partialfetch" property to false. You'll have to set this property in the Properties object that you provide to your Session.
http://java.sun.com/products/javamail/NOTES113.txt
So I turned off partial fetch:
Properties props = System.getProperties();
props.setProperty("mail.store.protocol", "imaps");
props.setProperty("mail.imaps.partialfetch", "false");
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("imaps");
store.connect("imap.gmail.com", "<username>","<password>");
this solved the problem ….however the method getInputStream() from the Part class blocks the thread until the attachment is completely downloaded and it is impossible to get the information about the number of bytes which have been already downloaded from mailbox. Without this information it is impossible to display the progress bar. So is there a way to obtain this information and display the progress bar?
|
|
|
|
|
Firstly, put the download on a separate thread so that you don't hang.
Secondly, can you get the size of the attachment?
You can always use a guestimate of how long is left, and then tick your progress accordingly.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
"Secondly, can you get the size of the attachment?"
Yes.
"You can always use a guestimate of how long is left, and then tick your progress accordingly."
This is good idea. Many progress bars are based on some estimations.
|
|
|
|
|
Where and how do you get that size? You need to have that before the attachment is received.
I have a similar request here and have declined it so far. Would be great to get some input from a different angle.
The estimation and some fake value to show to the user is complicated to manage.
|
|
|
|
|
I know the size beforehand because my program works with the mailboxes which ALWAYS have only 1 MB size attachments.
|
|
|
|
|
Hi All,
Does anybody know of any good tutorials for java and WIA integration? I am looking to create a java application that will integrate with a WIA compatible scanner and am just looking for a good place to start.
Many thanks,
Graeme
|
|
|
|
|
graeme.m wrote: looking for a good place to start.
You found it[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thanks Richard, but i have already searched that. Links provided are mainly products already developed or apis that have a large liscence fee behind them.
(Only posting here as I have exhausted my google searching abilities)
|
|
|
|
|
You said you were looking for a good place to start, and Google is it. If there are no reasonable tutorials or user guides in the list then chances are that they have not been published; although I did notice that the first link includes full documentation. Whether these products are free or not is, of course, another issue.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thanks Richard, I should have been more specific in my original post. After being unable to find any useful information through google for free apis, I can use JTwain etc if needs be, I thought I would post here to see if anybody has been down this road before and could provide me with useful information on getting started.
|
|
|
|
|
|
Hi Gerbi,
This is one of the sites I came accross. It provides a very good introduction to using java with scanners though the only downfall is that the solution uses JTwain (highest liscence fee i have seen) though if i cannot find any opensource APIs this may be the way I will go. I may also start looking into a C# implementation.
Much thanks for your reply
|
|
|
|
|
Dont be confused by JTwain name used in this demo, it has not relation to asprise products.
When you have installed twain sdk you can build demo mentioned on this article.
It is not complete api/product but it is good point to start from.
|
|
|
|
|
Ah I see , I will take a further look into this.
Many thanks for pointing this out Gebri.
Much appreciated.
|
|
|
|
|
can i move the control from one page to the previous page and again back ....i mean writing the contents to different pages as they come.
Actually i have a jpanel which has some 386 fields i am trying put the graphics2d object of the same to pdf by pdfcontentbyte.I need to scale each of this field and place it in the a4 size doc at right position....this fields are coming randomly and can be placed on page 1 or page 2...as jpanel has a height of 2036 and a4 doc has a height of 842 ....so it has to go to next page but come back to the 1st page if a field belongs to there...
i know i am sounding a bit messed up..pls reply for any clarifications
|
|
|
|
|
|
so what...i havent used any forums ..just trying to get help and do my work...may be i am not as professional as you are...but what matters to me is my help and thats my concern nothing else...i am here not to give a repo of gr8 developer....i am lacking and illl improove..if u can help then please do help....if not then i dont give a damm
|
|
|
|
|
My point being that you have already been given some suggestions; have you tried any of them and if so what was the result? However, given your attitude (repeated use of the word damn, and telling us it's urgent) it's unlikely that people will be keen to offer much more.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
there was one suggestion from one of the guy but may be i wasnt able to explain my problem so he gave a generic solution which wasnt applicable to my needs...i am looking for some control in itext where in i can move back and forth from pages to write into them as my fields can be for 1st page or second...and so on
|
|
|
|