11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

56 webMathematica User GuideIf[MSPValueQ[$$Compute],MSPReturn["Date[] returns " ToString[Date[]], "text/plain"]]Here is an applet that gets a result from Mathematica.Hitting refresh will cause the page to update.Here is the source for the applet TextApplet.java.package com.wolfram.msp.example;import java.applet.Applet;import java.awt.*;import java.net.*;import java.io.*;public class TextApplet extends Applet {public void paint(Graphics g) {super.paint(g);try {URL url = new URL(getDocumentBase(), getParameter("ArgumentURL"));InputStream in = url.openStream();ByteArrayOutputStream out = new ByteArrayOutputStream();byte[] b = new byte[1024];int len;while ((len = in.read(b, 0, 1024)) != -1) {out.write( b, 0, len);}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!