Sean McGurk

Greenhorn
+ Follow
since Jun 05, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 Sean McGurk

Hi folks;
I am in the process of creating a spell checker program that reads in text and returns the corrected text including any amendments made by the user.

However, this procedure returns a string when the program encounters an error, rather than when the text has all been checked.
Has anyone any suggestions so that I can amend this program so that it returns a value only when all the text has been checked, rather than when the first error is encountered please.
Thanks and regards,
Sean

[This message has been edited by Sean McGurk (edited August 21, 2001).]
Sorry Punnam, just to clarify: are you checking words or sentences?
Are you checking multiple text boxes or text from a single text box?
Obviously, checking single words is easier as you don't have to break up a sentence into a series of words.
I'll try and send you (or post up) all the links I can.
I am currently doing this very thing @ the minute. From what I can see, the basic steps are:
1. Find out how many text areas there are to check
There is a Document.Form.Elements[i] array as part of javascript you could probably use. I am not sure if there is a JScript equivalent of the UBound function but if there isn't you could always use a Do While Document.Form.Elements[i].value ! Null loop.
2. Create a dictionary
For this, I have used a flat text file to create Hash Tables that are interrogated using a binary search algorithm
3. Start at the first text area
4. Pass in the first area to the spell checker program using a JavaScript function
5. Start at the first word
6. Check the spelling of this word
7. If the spelling is correct then go to the next word
Use StringTokenizer class to break up a string into a list of words

8. If the word is not found in the dictionary, then:
�highlight the word
�suggest alternatives,
and give the user options to:
8.1.'Ignore',
8.2.'Change' or
8.3.Add the word to the list of words in the dictionary
9. Until there are no more words to check
10. Go to the next text area
11. Until there are no more text areas
12. Return the corrected text to the appropriate area.
There are a lot of tips and resources you can use for this and I will post them up at a later date. For now, I hope this helps.


Hi all!
I have created a java applet and wish to access one of its methods in Javascript, so I am using the following HTML code:

The java code is as follows:

There doesn't seem to be a problem running the applet, but when I call the javascript function I get the following error message:
'Object doesn't support this property or method'
Does anyone know why this is? And how I remedy it?
Thanks and regards,
Sean
Yup- can now read from and write to a file located within the same directory. I'm just running the applet on a stand-alone machine. I know that if I need to read from or write to files across a network, that the applet needs to be signed, but if anyone is looking for an application that can do a simple read/ write to and from a local file, then I can assure you it IS possible!!!
Sean
20 years ago
Hi all!
I have used the HTML converter to convert an applet so that it can run using Sun's Java 2 Runtime Environment, Standard Edition (JRE) instead of the web browser's default virtual machine by using the Sun Plug-in.
The converter seems to work by converting the applet to an Active X object. If this is the case and the applet ceases to exist as a java applet and instead exists as an Active X then how can I reference its methods, for example from within a Javascript function? Is this even possible?
For example, if I have an applet with the methods init(), sayHello() and Quit(), and wish to activate the sayHello() function once the user submits a form, then how do I go about this?
Thanks,
Sean
[This message has been edited by Sean McGurk (edited August 08, 2001).]
20 years ago
In no particular order:
1. The Usual Suspects
2. The Filth and the Fury (a documentary on the Sex Pistols)
3. La Haine (Hatred)

No, I'm not making any of these up to sound intelligent and/ or interesting- I can honestly say that after having watched every one of them I was speachless they were that good.
Also worth a peek: Withnail and I, Goodfellas, Raging Bull, In The Name of the Father, Tesis
Sean
20 years ago
In no particular order:
1. The Usual Suspects
2. The Filth and the Fury (a documentary on the Sex Pistols)
3. La Haine (Hatred)

No, I'm not making any of these up to sound intelligent and/ or interesting- I can honestly say that after having watched every one of them I was speachless they were that good.
Also worth a peek: Withnail and I, Goodfellas, Raging Bull, In The Name of the Father
Sean
20 years ago
Hi!
I am in the process of developing a spell checker applet. This applet creates a dictionary from a flat text file and also allows users to add their own words to the custom dictionary. At the minute, however, users are only able to add words to the .txt file, which is located in the same directory as the applet. I have tried to enable the applet to read from the text file by using the following code:

but I keep getting a NullPointerException error every time I run the applet
I think this is a syntactic, rather than a security issue, as I am able to write to the file but not read from it.
Any suggestions?
Thanks and regards,
Sean
[This message has been edited by Sean McGurk (edited July 30, 2001).]
21 years ago
Okay;
I am now able to state the following:

where SpellCheck is the name of the applet that loads the GUI.
But I am still unable to state:

As this gives me an error message. Anyone know how I might work around this or suggest alternatives?
Regards,
Sean
21 years ago
Hi folks!
By using the FileOutputStream class, I am able to write to a file located in the same directory as my applet. However, I am unable to read from a file as I am unable to create a URL.
I cannot state something like:

as the program that I am running is not an applet, but rather a java GUI program whose methods are accessed by an applet. It extends Frame, not applet.
Therefore, getCodeBase() is not recognised.
Are there any other protocols that do the same thing i.e. that allow reading from a file.
Regards,
Sean
21 years ago
Anyone know how I could modify this code so that it doesn't overwrite the prevoius entry in the file?

I think this code proves conclusively that Applets can read and write files on the server on which they are located.
i.e. That it is a syntactical rather than a security issue when writing files to the local disc.
Regards,
Sean

[This message has been edited by Sean McGurk (edited July 26, 2001).]
21 years ago
Hi!
Like many of the visitors to on this forum, I refuse to believe that applets are not able to write to files that are located within the same local folder, which leads my to believe that I have a syntax problem with my code.
I am using :

to define the URL. However, I get the following error message when I go to run the code:
MalformedURLException: no protocol: words.txt
I am unable to state either:

or

possibly because the program is not an applet, but rather contains methods that are called by an applet (a servlet?)
Does anyone know how to or have any examples of an applet writing to a local file ?
Thanks and regards,
Sean
21 years ago
Wow!
Cheers for that, yeah, you're right.
How do I know which browsers do and which don't support Swing? As I'm building a browser-independent component, I take it it would be safer to implement the whole thing in AWT. Is this tricky? I have built my interface using swimg components with an AWT layout. Will it be difficult to convert all these to AWT? Sorry, this might not be a question for the applets forum, possibly for GUI or AWT or something.
Many thanks again,
Sean
21 years ago