|
My reply is about this thread. Open your original message, and you will see an Edit link at the bottom. Click that and away you go.
You can modify any of your own messages this way.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
hi
i am working with JML (java MSN library)
i found this code
but it doesn't work with me
any one help me please
this is the code
package example1;
import net.sf.jml.MsnMessenger;
import net.sf.jml.impl.MsnMessengerFactory;
public class BasicMessenger {
private String email;
private String password;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
protected void initMessenger(MsnMessenger messenger) {
}
public void start() {
MsnMessenger messenger = MsnMessengerFactory.createMsnMessenger(email,
password);
messenger.setLogIncoming(true);
messenger.setLogOutgoing(true);
initMessenger(messenger);
messenger.login();
}
public static void main(String[] arg) throws Exception {
String args[]=new String[3];
args[0]="william";
args[1]="rojjffjjj887hghgma@hotmail.com";
args[2]="uullro33";
BasicMessenger messenger = (BasicMessenger) Class.forName(args[0])
.newInstance();
messenger.setEmail(args[1]);
messenger.setPassword(args[2]);
messenger.start();
}
}
|
|
|
|
|
williamroma wrote: but it doesn't work with me
That is not very helpful; try explaining what you think it should do and what results you get.
I must get a clever new signature for 2011.
|
|
|
|
|
|
i have to make a chat messenger
so i think that a JML is a good API to connect with MSN
i begin to learn about it and i find that code
but it doesn't work with me
any one know tutorial to use this API
any one konw where is the wrong in that code
thanks you all
(SORRY FOR MY BAD ENGLISH )
|
|
|
|
|
A quick Google located this site[^].
I must get a clever new signature for 2011.
|
|
|
|
|
yes i found that website
and the code i put here is the first example on that site
but in that site there is no explain for the code
i am realy thank you but i have to learn this API
|
|
|
|
|
williamroma wrote: but i have to learn this API
Well the logical place is the site I gave you the link for. If there is no documentation provided then you will have to do it the hard way by working through the code. If there is a forum on the site then post your question there as you are much more likely to find someone who understands it on that site.
I must get a clever new signature for 2011.
|
|
|
|
|
really thank you
but there is no place in that side to ask
any way i am realy thank you and sorry to loose your time
|
|
|
|
|
williamroma wrote: and sorry to loose your time
I think you misunderstand, you are not wasting my time. I am merely trying to help you find the best place to get support for your problem. In the case of open source projects like this then the site that owns the product is always the best place. If you go back to that site and look around you will find that there are a number of links to help you, including a support forum.
I must get a clever new signature for 2011.
|
|
|
|
|
thank you again
i understand some of the code but i have this java question
this code:
B k = (A) Class.forName("X").newInstance();
that code associated the k object with the class X
when i run that code i make an exception (CLASS X NOT FOUND )
how can i make the code right?
(SORRY FOR MY BAD ENGLISH )
|
|
|
|
|
See this[^]. Class X not found means just what it says. In your first code snippet you were passing args[0] , which value was "william". It is telling you that class with "william" as fully qualified name does not exist.
|
|
|
|
|
The MSN Messenger Protocol Torn Apart[^]
this should bring some more information.
On the Sourceforge-Code - did you load the complete trunk or just this bit of code? Please go for the complete trunk.
Otherwise you've just ripped the engine hood off - which is obviously not a complete car
regards
Torsten
I never finish anyth...
|
|
|
|
|
Hello!
I have designed a website where a student reads a prompt aloud and words they miss are clicked by a teacher, parent or tutor.
I would like to add a speech recognition aspect to my program to allow for self administration by students, which will most likely involve a standalone client. I figured Java would probably be the most likely language to have convenient, inexpensive (or free) libraries available.
The student is presented with a prompt, such as "I want to eat ice cream.", the program records the user reading the prompt and then tells them every word they missed and has them say the word correctly.
Any library suggestions? I would need access to intermediary information - it would not be appropriate for the library to pick a "closest word" if the user mispronounces something, for example.
|
|
|
|
|
The Java Sound API[^] may be a good starting point.
I must get a clever new signature for 2011.
|
|
|
|
|
|
Thanks - I will look into this. If I can define my own grammar then I should be able to customize this to return syllables rather than words - which would enable me to parse the output myself - and hence check for mistakes.
|
|
|
|
|
Hi all,
I am writing a small 2D platform game and currently working on EventListeners. When the user clicks the 'blackSquare' JButton it is removed from the screen and placed within a different JPanel (the inventory). However once this event has occoured the player sprite no longer responds to the user input, can anyone help.
package com.brackeen.javagamebook.input;
import com.brackeen.javagamebook.graphics.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.EtchedBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
public class InvItems extends MenuScreen implements ActionListener
{
public static void main(String[] args)
{
new InvItems().run();
}
private JPanel panelZero;
private JPanel panelOne;
private JPanel panelTwo;
private JPanel panelThree;
private JPanel panelFour;
private JPanel panelFive;
private JButton quitButton;
private JButton blackSquare;
private JTextArea textArea;
private JLabel inventoryLabel;
private JList dropDown;
String [] items ={"Take", "Examine"};
String textOne = ("Text Area");
String textTwo = ("Its Just a black square");
public void init()
{
super.init();
NullRepaintManager.install();
inventoryLabel = new JLabel("Inventory");
dropDown = new JList(items);
panelZero = new JPanel();
panelOne = new JPanel();
panelTwo = new JPanel();
panelThree = new JPanel();
panelFour = new JPanel();
panelFive = new JPanel();
inventoryLabel.setFont(new Font("Blackadder ITC", Font.ITALIC, 16));
inventoryLabel.setForeground(Color.RED);
textArea = new JTextArea();
textArea.setText(textOne);
textArea.setFont(new Font("Blackadder ITC", Font.ITALIC, 16));
textArea.setBackground(new Color(0, 0, 0, 0));
textArea.setForeground(Color.RED);
panelFive.setBackground(new Color(0, 0, 0, 0));
quitButton = createButton("quit", "Quit");
quitButton.setBounds(50, 50, 64, 64);
quitButton.setVisible(true);
blackSquare = createButton("test", "Test");
blackSquare.setVisible(true);
JFrame frame = super.screen.getFullScreenWindow();
Container contentPane = frame.getContentPane();
Cursor cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
frame.setCursor(cursor);
if (contentPane instanceof JComponent)
{
((JComponent)contentPane).setOpaque(false);
}
contentPane.setLayout(null);
panelZero.setBounds(0, 0, 75, 75);
panelOne.setOpaque(true);
panelOne.setBounds(300, 10, 150, 30);
panelOne.setOpaque(false);
panelTwo.setBounds(190, 35, 378, 75);
panelTwo.setOpaque(false);
panelThree.setBounds(300, 200, 100, 100);
panelThree.setOpaque(false);
panelThree.setVisible(true);
panelFour.setBounds(400, 200, 100, 100);
panelFour.setOpaque(false);
panelFour.setVisible(false);
panelFive.setBounds(10, 550, 775, 40);
panelFive.setOpaque(true);
panelFive.setVisible(true);
panelFive.setBorder(new EtchedBorder());
panelZero.add(quitButton);
panelOne.add(inventoryLabel);
panelThree.add(blackSquare);
panelFour.add(dropDown);
panelFive.add(textArea);
contentPane.add(panelZero);
contentPane.add(panelOne);
contentPane.add(panelTwo);
contentPane.add(panelThree);
contentPane.add(panelFour);
contentPane.add(panelFive);
frame.validate();
blackSquare.addMouseListener(new MouseWatcher());
dropDown.addMouseListener(new MouseWatcher());
}
public class MouseWatcher extends JFrame implements MouseListener
{
public synchronized void mouseClicked(MouseEvent e)
{
panelFour.setVisible(true);
}
public void mouseEntered(MouseEvent e)
{
}
public void mouseReleased(MouseEvent e)
{
}
public synchronized void mousePressed(MouseEvent e)
{
if (dropDown.getSelectedIndex() == 0)
{
panelThree.setVisible(false);
panelTwo.add(blackSquare);
panelFour.setVisible(false);
}
else if (dropDown.getSelectedIndex() == 1)
{
textArea.setText(textTwo);
}
}
public void mouseExited(MouseEvent e)
{
}
}
public void actionPerformed(ActionEvent e)
{
Object src = e.getSource();
if (src == quitButton)
{
super.exit.tap();
}
}
public void draw(Graphics2D g)
{
super.draw(g);
JFrame frame = super.screen.getFullScreenWindow();
frame.getLayeredPane().paintComponents(g);
}
}
|
|
|
|
|
- don't use syncronized in Mousewatcher. You're not using Thread.
- dont let MouseWatcher extend JFrame (why does it do so? there should be no need to extend JFrame)
- do not override mouseEntered() , mouseReleased() and mouseExited() until you really need to modify them.
regards
Torsten
I never finish anyth...
|
|
|
|
|
Thanks Torsten,
Iv ammend my code as you said but to no availe. I think my problem lies within the event itsself. E.g when the black button is clicked a Jlist bocomes available, when the 'Take' index of the JList array is selected the black button is removed from the JPanel showing it on the screen and placed in a JPanel showing it in the inventory. I now beleive the event is still waiting for something else to happen when it should pass control back to the arrow keys so the user can move the player sprite again but i am unsure of how to do this.
Kurt
|
|
|
|
|
|
I am looking for any html parser, that could output xml from inputstream(IMDB search results) or just parsed code into structures with filter tags. I tryed with HTMLCleaner but it doesn't supports imdb site. I get this error
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: http:
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at java.net.URL.openStream(URL.java:1010)
at org.htmlcleaner.Utils.getCharsetFromContent(Utils.java:121)
at org.htmlcleaner.HtmlCleaner.clean(HtmlCleaner.java:299)
at org.htmlcleaner.HtmlCleaner.clean(HtmlCleaner.java:317)
at Main.main(Main.java:25)
I also tryed HTMLParser([^]), but i can't get correct data with it.
If anyone has experience with parsing IMDB html code i would be really thankful for any kind of help.
Thanks
|
|
|
|
|
Since you haven't shown any code helping you seems futile, but I'm sure you have checked the meaning of HTTP return code of 403:
http://en.wikipedia.org/wiki/HTTP_403[^].
Just a well meant hint.
Cheers!
|
|
|
|
|
Hi,
403 means "forbidden", which could be many things, however it is decided by the server, and the net result is you aren't getting any data. So it is not the parsing that is at fault, it is the way you ask for the web page.
I tried http://www.imdb.com with my existing C# program and it loads fine; one thing I remember very well doing after some sporadic failures, is provide a realistic "useragent", which is a string explaining what the client's characteristics/capabilities are. I use
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.17"
which was what FireFox emitted at that time.
I suggest you figure out where and how to specify such useragent in your code.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
The code is like this:
CleanerProperties props = new CleanerProperties();
HtmlCleaner test=new HtmlCleaner();
test.clean(new URL("http://www.imdb.com/find?s=all&q=burek"));
In c# i have no problems too. But in java there i have errors, which i specified.
Any other parser, that would be useful for IMDB?
Thanks
|
|
|
|