Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

Java On-Line Compiler

Thread view: 
Andrew Thompson - 11 Jan 2004 20:24 GMT
In addition to the recently posted article on the
'Short, Self-contained, Compileable Example', at..
http://www.physci.org/codes/sscce.jsp
I have added an on-line compiler,
(linked from the page) at..
http://www.physci.org/javac.jsp

The on-line compiler is an excellent way to
check that code is 'self-contained', as well
as being small - the page will only accept
source files up to 10Kb.

Comments welcome.

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
ak - 11 Jan 2004 21:26 GMT
> The on-line compiler is an excellent way to
> check that code is 'self-contained', as well
> as being small - the page will only accept
> source files up to 10Kb.
>
> Comments welcome.

works fine, except saving class file:

Not Found
The requested URL
/home/physci2/public_html/public_compile/aa8QmelfSqJe/Test.class was not
found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an
ErrorDocument to handle the request.

Apache/1.3.29 Server at www.physci.org Port 80

____________

http://reader.imagero.com the best java image reader.
Andrew Thompson - 12 Jan 2004 08:47 GMT
....
| The requested URL

/home/physci2/public_html/public_compile/aa8QmelfSqJe/Test.class
was not

That's odd, it's definitely there (I checked).
I will be looking into gathering all classes
into a .jar file for the user (in the event that
one source has a number of classes)

I'll look into that at the same time and see
if I can figure the problem.

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Andrew Thompson - 12 Jan 2004 15:09 GMT
| ....
| | The requested URL

/home/physci2/public_html/public_compile/aa8QmelfSqJe/Test.class
| was not
|
| That's odd, it's definitely there (I checked).
| I will be looking into gathering all classes
| into a .jar file for the user (in the event that
| one source has a number of classes)

I think I have fixed the link problem, at
the same time I took the opportunity to
'zip up' the class(es) and source into a
.jar file, I'll have to do further checking
before I can confirm I did it right..

[ And just to confirm - it will not work with
packages, and does not (yet) create a manifest.. ]

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Thomas Schodt - 12 Jan 2004 15:55 GMT
> ... does not (yet) create a manifest.

This might come in handy then
  http://www.javaworld.com/javaworld/javatips/jw-javatip127.html?
Andrew Thompson - 12 Jan 2004 22:17 GMT
| > ... does not (yet) create a manifest.
|
| This might come in handy then

http://www.javaworld.com/javaworld/javatips/jw-javatip127.html?

Thanks Thomas, yes that seems a good reference.
I should get it done in the next few days.
Andrew Thompson - 12 Jan 2004 14:56 GMT
| > The on-line compiler is an excellent way to
...
| Not Found
| The requested URL

/home/physci2/public_html/public_compile/aa8QmelfSqJe/Test.class
was not
| found on this server.

D'Oh!  What a dang fool.  Now I have spotted
my error (public_compile is at the root of my site)
should have it fixed soon..
ak - 11 Jan 2004 21:30 GMT
> The on-line compiler is an excellent way to
> check that code is 'self-contained', as well
> as being small - the page will only accept
> source files up to 10Kb.
>
> Comments welcome.

What I miss is possibility to start generated class file.
Job for your Launcher.

____________

http://reader.imagero.com the best java image reader.
Andrew Thompson - 14 Jan 2004 07:56 GMT
| > The on-line compiler is an excellent way to
| > check that code is 'self-contained', as well
| > as being small - the page will only accept
| > source files up to 10Kb.
....
| What I miss is possibility to start generated class file.
| Job for your Launcher.

I was looking into this, but unfortunately
there are dangers to allowing code to be
run straight off the server, even if it is
contained within the applet security
sandbox at the user end.

After all, it's easy to make an irritatingly
recursive Applet that works completely
within the confines of the sandbox.

I shudder to imagine what malevolent
people could come up with if they set
their nasty little minds to it..    :-(

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Alex Hunsley - 14 Jan 2004 10:50 GMT
> | > The on-line compiler is an excellent way to
> | > check that code is 'self-contained', as well
[quoted text clipped - 17 lines]
> people could come up with if they set
> their nasty little minds to it..    :-(

Just what I was thinking - you *don't* want to be running any pasted in
code on your server :)
You can bet your bottom dollar someone would abuse it.

alex
Andrew Thompson - 14 Jan 2004 16:05 GMT
<from your other post>
" ..that's very useful for testing code snippets people post!"

I had to smile when I read how you worded that,
as it is exactly to encourage people _not_ to post
'snippets'.  The compiler will reject snippets as
surely as javac from the command line..    ;-)

...
| Just what I was thinking - you *don't* want to be running any pasted in
| code on your server :)
| You can bet your bottom dollar someone would abuse it.

I think I may have been mistaken there...
Given the code is actually running in the
user's own JVM in their browser, it puts no
special demands on my server.

The _only_ malevolent thing I _think_
they could do is create an Applet
(assuming I offer to show them applets
in a page) that opens a new window
with the same page, before refreshing
itself [ I would call this applet
'BreedLikeRabbits' ;-) ]

That _might_ cause trouble on whatever
machine they run it, and cause a load on
the server (until the applet is cached?)

...hmmm.  I'll think about it further.
(See also the other interesting development)
Alex Hunsley - 14 Jan 2004 16:24 GMT
> <from your other post>
> " ..that's very useful for testing code snippets people post!"
[quoted text clipped - 3 lines]
> 'snippets'.  The compiler will reject snippets as
> surely as javac from the command line..    ;-)

Oops, I didn't really mean snippets in that way, I meant self-contained
runnable and all the rest of it! :)

> ...
> | Just what I was thinking - you *don't* want to be running any
[quoted text clipped - 21 lines]
> ...hmmm.  I'll think about it further.
> (See also the other interesting development)

Be interested to hear if you find out more about the possibility of this
and associated problems...
Someone could deliberately overload your CPU as a sort of DOS attack
which wouldn't be very desirable! Hmmm, any ways around that...

alex
ak - 14 Jan 2004 16:08 GMT
> | What I miss is possibility to start generated class file.
> | Job for your Launcher.
[quoted text clipped - 12 lines]
> people could come up with if they set
> their nasty little minds to it..    :-(

self-evident I didn't mean to run it on the server.
I mean that you could generate page with applet.
And user can decide if he want to run this applet.

____________

http://reader.imagero.com the best java image reader.
Andrew Thompson - 14 Jan 2004 21:06 GMT
| > | What I miss is possibility to start generated class file.
| > | Job for your Launcher.
...
| self-evident I didn't mean to run it on the server.
| I mean that you could generate page with applet.
| And user can decide if he want to run this applet.

I am still trying to sort out the details of it
in my own head ak [ it was not self-evident
to me at the time  ;-) ]

Interestingly, I've made some other posts,
wherein basically I am coming to the conclusion
that maybe it is _only_ applets that will be
a problem.  Ironic really.

Check for my post that mentions the
BreedLikeRabbitsApplet...

Still mulling it all over, but the apps are
definitely launchable now, straight from the
link.   :-)

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Alex Hunsley - 14 Jan 2004 10:49 GMT
> In addition to the recently posted article on the
> 'Short, Self-contained, Compileable Example', at..
[quoted text clipped - 9 lines]
>
> Comments welcome.

Thanks Andrew, that's very useful for testing code snippets people post!
Saves opening a new window, cutting and pasting the text to a new file
etc...

alex
Andrew Thompson - 14 Jan 2004 13:58 GMT
...
| I have added an on-line compiler, at..
| http://www.physci.org/javac.jsp

Now updated,  I implemented a suggestion
by Jim Sculley to allow the example PhySci
codes to be imported, by offering a link to
the plain source from each page that displays
'formatted' source (for both the displayer and
launcher pages) .

Then I went the whole hog and added a
drop-down list of the available source on
the 'javac' page itself.  The list excludes
any source that is over the 10Kb limit I have
set (so the ATM and Calculator are not listed).

What else.. Oh yeah.  I have switched on
'save ouput' by default, since it only seems
to _fail_ on my local machine, the web
server handles it fine..

Still working on the manifest file to allow
'double click launch' of the generated jar
files..

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Andrew Thompson - 14 Jan 2004 16:11 GMT
...
| Still working on the manifest file to allow
| 'double click launch' of the generated jar
| files..

Now done.  Since I could not work head
nor tail of Sun's 'Manifest' class, I sloppily
just wrote the appropriate bytes to the
JarOutputStream.

Interestingly, you can click the link to the
.jar file and if you choose 'open' rather
than 'save to disk', it should actually
launch straight from the link (I had
_completely_ forgotten you can launch
jar's  from a link!)

Of course, I would _prefer_ people to
save it to disk first, that way they save
bandwidth for themselves and me..

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.