|
|
I take it you didn't write this because if you did you would know how to do it.
What letters are given to the axes on 2d graphs?
X and Y.
Which axis controls horizontal movement?
The X axis.
Which axis controls the vertical movement?
The Y axis.
How would someone go about stopping the vertical movement of an object on a graph?
Remove the commands(lines of code) which control the Y axis.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
i m working on a rpoject..and i need to save the image in a directory with name as current date and time...but problem is this that ":" i.e. the colon is not suppoted in name....so can anyone suggest me how can i name the image file with date and time??
|
|
|
|
|
replace colons with underscores (or something else), remove all of the colons, use epoch time . . .
|
|
|
|
|
i found the code for sending e-mail , but my problem is that mail is not received by the recipient .
public void postMail(String recipients[], String subject, String message, String from) throws MessagingException {
boolean debug = false;
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
System.out.println("step 1 ");
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);
Message msg = new MimeMessage(session);
InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++) {
addressTo[i] = new InternetAddress(recipients[i]);
}
msg.setRecipients(Message.RecipientType.TO, addressTo);
msg.addHeader("MyHeaderName", "myHeaderValue");
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
}
i call this method with
String [] st = new String[1];
st[0] = "nuwan";
this.postMail(st, "test", "prasadbuddhika42@gmail.com", "prasadbuddhika42@gmail.com");
can anyone tell me what is wrong in this code ?
|
|
|
|
|
Gmail SMTP server requires authentication and uses SSL.
You should add following to your properties:
mail.transport.protocol=smtps
mail.smtps.host=smtp.gmail.com
mail.smtps.user=your gmail username
mail.smtps.password=your gmail password
mail.smtps.auth=true
-------------
Gil Messerman
|
|
|
|
|
Im also developing an email client
adding the lines given by you it gave an error from gmail
Issue STARTTLS command
how to code for this??
|
|
|
|
|
hi all i am trying to implments a java method in which given a string of digits as a parameter, prints all the combinations of letters that string of digits could represent.
for combination of letter we are using mobile text pad 2 is for abc,3 is for cde
123 is entered then max length of words will be 3
adg, adh, adi, aeg, aeh, aei, afg, afh, afi,
bdg, bdh, bdi, beg, beh, bei, bfg, bfh, bfi,
cdg, cdh, cdi, ceg, ceh, cei, cfg, cfh, or cfi.
The 1 can be a, b or c
The 2 can be d, e or f
the 3 can be g, h or i
this method is to be implemted using recursion i m totally confused where to start of with can anyone help me with some algorithm of code ....
|
|
|
|
|
Please, check carefully the code, I'm a bit rusty with Java...
public class Main {
static String []_keys= {"abc", "def", "ghi", "jkl","mno","pqrs","tuv","wxyz"};
static char [] _out;
public Main() {
}
static private void comb(int [] iKeys, int iIndex)
{
int i;
int iKey = iKeys[iIndex]-1;
for (i=0; i<_keys[iKey].length(); i++)
{
_out[iIndex] = _keys[iKey].charAt(i);
if ( iIndex == iKeys.length-1)
{
System.out.println(_out);
}
else
{
comb(iKeys, iIndex+1);
}
}
}
public static void main(String[] args) {
_out = new char[100];
int [] iKeys = {1,2,3};
comb(iKeys, 0);
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yeah the code is not a problem but i m actually trying to input String of digits from user and the same String should be passed to the method in the above method we are passing array of integers... please help ....how do we get to change with that....
|
|
|
|
|
Just add the method StringToArray and change a bit main , for instance:
public static void StringToArray(String sKeys, int [] iKeys)
{
int i;
for (i=0; i<sKeys.length(); i++)
{
iKeys[i] = (int)(sKeys.charAt(i)-'0');
}
}
public static void main(String[] args) {
int [] iKeys;
String s = "123";
iKeys = new int[s.length()];
StringToArray(s, iKeys);
_out = new char[100];
comb(iKeys, 0);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
thx for help but my problem isnt solved yet...
the method comb is required to have the parameter passed as a String not integer of arays
thx in advance....
|
|
|
|
|
harshad bhatia wrote: the method comb is required to have the parameter passed as a String not integer of arays
Why?
Is it an assignment (i.e. homework?)?
Anyway you can easily figure out the necesary modifications, I suppose
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
yeah it is part of assignment its is like where i m struck in makin the method plz if u can help me out....
|
|
|
|
|
i think i could do it now really thx for ur help......
|
|
|
|
|
Please can some send me the code of this program:
A Bus company charges $1 for distance upto 10km. For any additional Km, a passenger is charged $0.2. These are charges for adults during weekdays. Children and students are charged $0.5 and additional $0.1 for any additional Km. During weekends everyone is charged $0.7 irrespective of whether is adult,child or student. Write am object oriented program that allows you to print tickets for passengers with the fate on them.
Please help me. you can either give me the general idea of how to do it. Thank you very much.
|
|
|
|
|
This sounds like school work to me.
Read number 9.[^]
The idea is that your actually ment to learn how to do this, not pass other peoples work as your own.
IMO your a lazy cheat.
My failometer is detecting vast quantities of FAIL!
|
|
|
|
|
What have you done so far?
Have you troubles with the Java language or with program logic?
Please be specific.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
hi there
Trying too write a java program on towers of hanoi
It supposed to written in stack class.
There is a Peg class and Board class.
I have no where to begin with this
Please Help???
Thanks
|
|
|
|
|
Hohepa Hori wrote: Trying too write a java program on towers of hanoi
It supposed to written in stack class.
There is a Peg class and Board class.
I have no where to begin with this
Well, begin with Board class...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I have spent all day trying to figure out this junkstuff and seem to be getting nowhere.
I could have had this damn application done by now using ASP.Net or Silverlight but Nooooooooo.
Anyone have any words of wisdom on how to get simple navigation to work in JSPs?
I just want to be able to click on button on a templated page to move tot he next page and it doe snot seem to work. Of course I can just sett he navigation destination of the button.. Noooooooo I have to set this, then that, draw a link between pages in two areas, then blah blah blah blah blah blah..
ENOUGH!
|
|
|
|
|
what's wrong with Myeclipse7(all in one)???too slow,always stuck when I open a file
Undeniable:More information,more abilities,more energies,more time!
http://www.blogjava.net/tidelgl
|
|
|
|
|
I'm having troubles learning the concept of classes that extend Comparable. Any suggestions out there that could help my understanding? Same thing with abstract classes, I don't get the importance.
thanks in advance.
|
|
|
|
|
jonig19 wrote: I'm having troubles learning the concept of classes that extend Comparable
Which point don't you understand specifically ? If you want your objects to be comparable, you simply implement the Comparable interface and implement the CompareTo function. I really don't understand what you don't understand
jonig19 wrote: Same thing with abstract classes
Again, what is the point you don't understand ? Abstract classes are classes which should not be instanciated, they are only meant to be implemented by child classes. Thus, when you have abstract functions, it means that you have to implement those in your child classes.
|
|
|
|
|