Add examples or disable the warnings 09/9609/2
Sylvestre Ledru [Tue, 6 Nov 2012 17:45:54 +0000 (18:45 +0100)]
Change-Id: I7e05d6b7141ca764c94da222099b96f39a307873

14 files changed:
scilab/modules/api_scilab/help/en_US/api_scilab.xml
scilab/modules/atoms/help/en_US/_atomsGettingStarted.xml
scilab/modules/call_scilab/help/en_US/fromc.xml
scilab/modules/call_scilab/help/en_US/fromjava.xml
scilab/modules/console/help/en_US/clc.xml
scilab/modules/console/help/fr_FR/clc.xml
scilab/modules/core/help/en_US/keywords/symbols.xml
scilab/modules/helptools/help/fr_FR/percenthelps.xml
scilab/modules/javasci/help/en_US/javasci_step_by_step.xml
scilab/modules/jvm/help/en_US/jre_path.xml
scilab/modules/spreadsheet/help/en_US/read_csv.xml
scilab/modules/spreadsheet/help/en_US/write_csv.xml
scilab/modules/ui_data/help/en_US/filebrowser.xml
scilab/modules/xcos/help/en_US/xcos.xml

index a752da2..8341efd 100644 (file)
@@ -10,7 +10,7 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="api_scilab" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="api_scilab" scilab:needs-examples="no" xml:lang="en">
     <refnamediv>
         <refname>api_scilab</refname>
         <refpurpose>api_scilab is the Scilab interface to read/write data from/to Scilab memory </refpurpose>
index b5c1901..4ac144c 100644 (file)
@@ -10,7 +10,7 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="_atomsGettingStarted">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" scilab:needs-examples="no" xml:id="_atomsGettingStarted">
     <refnamediv>
         <refname>Getting started</refname>
     </refnamediv>
index 3c4ed31..bae052a 100644 (file)
             Returns <literal>%t</literal>Checks if current Scilab is called from an external C program or <literal>%f</literal> if not.
         </para>
     </refsection>
+
+    <refsection>
+        <title>Example</title>
+        <programlisting role="example"><![CDATA[
+fromc();
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index f80960e..bc31e10 100644 (file)
             Returns <literal>%t</literal> if Scilab is called from javasci or <literal>%f</literal> if not.
         </para>
     </refsection>
+    <refsection>
+        <title>Example</title>
+        <programlisting role="example"><![CDATA[
+fromjava();
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index 26c1351..703e890 100644 (file)
         </para>
         <para>
             <note>
-                Note that <literal>clc([nblines])</literal> cannot be used under Unix/Linux platforms when Scilab used in no window mode.
+                Note that <literal>clc([nblines])</literal> cannot be used under Unix/Linux platforms when Scilab used in cli or adv-cli (no window) modes.
             </note>
         </para>
     </refsection>
+    <refsection>
+        <title>Example</title>
+        <programlisting role="example"><![CDATA[
+rand(10,10)
+clc();
+rand(10,10)
+clc(5); // Delete the 5 previous lines
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index c895ec2..674519d 100644 (file)
             </note>
         </para>
     </refsection>
+    <refsection>
+        <title>Example</title>
+        <programlisting role="example"><![CDATA[
+rand(10,10)
+clc();
+rand(10,10)
+clc(5); // Efface les 5 précédentes lignes.
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>Voir aussi</title>
         <simplelist type="inline">
index 9a1cb8c..2dad03a 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="symbols">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" scilab:needs-examples="no" xml:id="symbols">
     <refnamediv>
         <refname>symbols</refname>
         <refpurpose>scilab operator names </refpurpose>
index c2c9064..19889b1 100644 (file)
@@ -22,7 +22,7 @@
         <para>
             <literal>%helps</literal> est une matrice de chaînes de caractères à deux colonnes. Chaque ligne est formée comme ceci
         </para>
-        <programlisting><![CDATA[ 
+        <programlisting role="no-scilab-exec"><![CDATA[ 
 répertoire_du_chapitre    titre_du_chapitre
  ]]></programlisting>
         <para>
index dc21ebd..9f16598 100644 (file)
         <para>
             <para>Here is an example of a classical use-case:</para>
         </para>
-        <programlisting role="java">/*
-            *
-            * This file is released under the 3-clause BSD license. See COPYING-BSD.
-            *
-            */
-            
-            import org.scilab.modules.javasci.Scilab;
-            import org.scilab.modules.types.ScilabType;
-            import org.scilab.modules.types.ScilabDouble;
-            
-            class Example1 {
-            
-            public static void main(String[] args) {
-            try {
+        <programlisting role="java"><![CDATA[
+/*
+ *
+ * This file is released under the 3-clause BSD license. See COPYING-BSD.
+ *
+ */
+
+import org.scilab.modules.javasci.Scilab;
+import org.scilab.modules.types.ScilabType;
+import org.scilab.modules.types.ScilabDouble;
+
+class Example1 {
+
+    public static void main(String[] args) {
+        try {
             Scilab sci = new Scilab();
             if (sci.open()) {
-            /* Send a Scilab instruction */
-            sci.exec("foo = [ 2, 4, 6; 4, 0, 10; 6, 10, 12 ];");
-            
-            /* Retrieve the variable foo */
-            ScilabType foo = sci.get("foo");
-            
-            /* Display the variable */
-            System.out.println("Representation of  : "+foo);
-            
-            /* Get the data and retrieve the 2,2 value */
-            double[][] aReal = ((ScilabDouble)foo).getRealPart();
-            System.out.println("foo[1,1] = " + aReal[1][1]);
-            
-            /* Change the value of 2,2 */
-            aReal[1][1] = Math.PI;
-            
-            /* Create a new variable */
-            ScilabDouble bar = new ScilabDouble(aReal);
-            
-            /* Send it to Scilab */
-            sci.put("bar",bar);
-            
-            /* Display it through Scilab */
-            sci.exec("disp(bar)");
-            
-            sci.close();
+                /* Send a Scilab instruction */
+                sci.exec("foo = [ 2, 4, 6; 4, 0, 10; 6, 10, 12 ];");
+
+/* Retrieve the variable foo */
+                ScilabType foo = sci.get("foo");
+
+/* Display the variable */
+                System.out.println("Representation of  : "+foo);
+
+/* Get the data and retrieve the 2,2 value */
+                double[][] aReal = ((ScilabDouble)foo).getRealPart();
+                System.out.println("foo[1,1] = " + aReal[1][1]);
+
+/* Change the value of 2,2 */
+                aReal[1][1] = Math.PI;
+
+/* Create a new variable */
+                ScilabDouble bar = new ScilabDouble(aReal);
+
+/* Send it to Scilab */
+                sci.put("bar",bar);
+
+/* Display it through Scilab */
+                sci.exec("disp(bar)");
+
+                sci.close();
             } else {
-            System.out.println("Could not start Scilab ");
+                System.out.println("Could not start Scilab ");
             }
-            
-            
-            /* Can be improved by other exceptions: AlreadyRunningException,
-            * InitializationException, UndefinedVariableException,
-            * UnknownTypeException, etc
-            */
-            } catch (org.scilab.modules.javasci.JavasciException e) {
+
+
+/* Can be improved by other exceptions: AlreadyRunningException,
+ * InitializationException, UndefinedVariableException,
+ * UnknownTypeException, etc
+ */
+        } catch (org.scilab.modules.javasci.JavasciException e) {
             System.err.println("An exception occurred: " + e.getLocalizedMessage());
-            }
-            }
-            }
-            
-        </programlisting>
+        }
+    }
+}
+
+
+        ]]></programlisting>
         <para>Note that the source are available in SCI/modules/javasci/examples/v2/</para>
         <para>The output of the program will be:</para>
-        <programlisting>Representation of  : [2.0, 4.0, 6.0 ; 4.0, 0.0, 10.0 ; 6.0, 10.0, 12.0]
-            foo[1,1] = 0.0
-            
-            2.    4.           6.
-            4.    3.1415927    10.
-            6.    10.          12.
-        </programlisting>
+        <programlisting><![CDATA[Representation of  : [2.0, 4.0, 6.0 ; 4.0, 0.0, 10.0 ; 6.0, 10.0, 12.0]
+foo[1,1] = 0.0
+
+2.    4.           6.
+4.    3.1415927    10.
+6.    10.          12.
+        ]]></programlisting>
         <para>
-            For more information about the objects and methods, browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser).
+For more information about the objects and methods, browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser).
         </para>
     </refsection>
     <refsection>
         <title>Step 2 - Build</title>
         <para>Path to Scilab data is also expected under GNU/Linux and Mac OS X (under Microsoft Windows, it is automatically detected).</para>
-        <programlisting># Variable SCI
-            # Under GNU/Linux with the Scilab binary, the path is:
-            /path/to/scilab-xxx/share/scilab/
-            # Under GNU/Linux and Mac OS X with the source tree, the path is the base of the source tree
-            /path/to/scilab/sources/
-            # Under Mac OS X, the path is:
-            /Applications/scilab-xxx/Contents/MacOS/share/scilab/
-            # On Windows, the path is:
-            C:\Program Files\Scilab-5.3.0\
-        </programlisting>
+        <programlisting><![CDATA[# Variable SCI
+# Under GNU/Linux with the Scilab binary, the path is:
+/path/to/scilab-xxx/share/scilab/
+# Under GNU/Linux and Mac OS X with the source tree, the path is the base of the source tree
+/path/to/scilab/sources/
+# Under Mac OS X, the path is:
+/Applications/scilab-xxx/Contents/MacOS/share/scilab/
+# On Windows, the path is:
+C:\Program Files\Scilab-5.3.0\
+        ]]></programlisting>
         <para>To build a code using Javasci v2, two jars files are necessary in the CLASSPATH.</para>
         <programlisting role="example"><![CDATA[# For example, create a variable CLASSPATH
 $(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar
@@ -125,43 +127,43 @@ $(SCI)/modules/types/jar/org.scilab.modules.types.jar
         <para>Like in the building step, both jars are expected. </para>
         <para>Path(s) to native libraries have to be set in order for Java to communicate with Scilab.</para>
         <para>Two libraries are needed by Javasci v2 on load libjavasci2.{so,dylib,dll} and libscilab.{so,dylib,dll}. Other Scilab libraries will be loaded transparently.</para>
-        <programlisting role="example"># For example, create a variable LIBPATH
-            # Under GNU/Linux with the Scilab binary, the path is:
-            /path/to/scilab-xxx/lib/scilab/
-            # Under GNU/Linux and Mac OS X with the source tree, the path is:
-            $(SCI)/modules/javasci/.libs/:$(SCI)/modules/.libs/
-            # Under Mac OS X, the path is:
-            /Applications/scilab-xxx/Contents/MacOS/lib/scilab/
-            # Under Windows, the path is:
-            set LIBPATH="C:\Program Files\Scilab-5.3.0\bin"
-        </programlisting>
+        <programlisting role="example"><![CDATA[# For example, create a variable LIBPATH
+# Under GNU/Linux with the Scilab binary, the path is:
+/path/to/scilab-xxx/lib/scilab/
+# Under GNU/Linux and Mac OS X with the source tree, the path is:
+$(SCI)/modules/javasci/.libs/:$(SCI)/modules/.libs/
+# Under Mac OS X, the path is:
+/Applications/scilab-xxx/Contents/MacOS/lib/scilab/
+# Under Windows, the path is:
+set LIBPATH="C:\Program Files\Scilab-5.3.0\bin"
+        ]]></programlisting>
         <para>The command to launch the  program is the following:</para>
         <programlisting>java -cp $CLASSPATH:. -DSCI=$SCI -Djava.library.path=$LIBPATH Example1</programlisting>
     </refsection>
     <refsection>
         <title>A sample Makefile</title>
         <para>A simple Makefile would be:</para>
-        <programlisting>SCI = /path/to/scilab/share/scilab/
-            CLASSPATH = $(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar:$(SCI)/modules/types/jar/org.scilab.modules.types.jar
-            LIB_PATH = /path/to/scilab/lib/scilab
-            all:
-            javac -cp $(CLASSPATH) Example1.java
-            java -cp $(CLASSPATH):. -DSCI=$(SCI) -Djava.library.path=$(LIB_PATH) Example1
-        </programlisting>
+        <programlisting><![CDATA[SCI = /path/to/scilab/share/scilab/
+CLASSPATH = $(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar:$(SCI)/modules/types/jar/org.scilab.modules.types.jar
+LIB_PATH = /path/to/scilab/lib/scilab
+all:
+javac -cp $(CLASSPATH) Example1.java
+java -cp $(CLASSPATH):. -DSCI=$(SCI) -Djava.library.path=$(LIB_PATH) Example1
+        ]]></programlisting>
     </refsection>
     <para>See build.bat for Windows in SCI/modules/javasci/examples/v2 directory.</para>
     <refsection>
         <title>See Also</title>
         <simplelist type="inline">
-            <member>
-                Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). 
-            </member>
-            <member>
-                <link linkend="compile_and_run_javasci_v2">Compile and run with Javasci v2</link>
-            </member>
-            <member>
-                <link linkend="javasci_faq_v2">Javasci v2 FAQ</link>
-            </member>
+<member>
+    Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). 
+</member>
+<member>
+    <link linkend="compile_and_run_javasci_v2">Compile and run with Javasci v2</link>
+</member>
+<member>
+    <link linkend="javasci_faq_v2">Javasci v2 FAQ</link>
+</member>
         </simplelist>
     </refsection>
 </refentry>
index 4b481e0..2fcf8d1 100644 (file)
@@ -25,7 +25,7 @@
             <varlistentry>
                 <term>p</term>
                 <listitem>
-                    <para>a string path of JRE</para>
+                    <para>a string path to the JRE</para>
                 </listitem>
             </varlistentry>
         </variablelist>
         <title>Description</title>
         <para>returns Java Runtime Environment used by Scilab.</para>
     </refsection>
+
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[ 
+jre_path();
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>See Also</title>
         <simplelist type="inline">
index d7a8a3e..55dc226 100644 (file)
@@ -10,7 +10,7 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="read_csv" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="read_csv" scilab:needs-examples="no" xml:lang="en">
     <refnamediv>
         <refname>read_csv</refname>
         <refpurpose>
index 394c2e3..498828d 100644 (file)
@@ -10,7 +10,7 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="write_csv" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="write_csv" scilab:needs-examples="no" xml:lang="en">
     <refnamediv>
         <refname>write_csv</refname>
         <refpurpose>
index c899c9a..096b746 100644 (file)
             </itemizedlist>
         </para>
     </refsection>
+    <refsection>
+        <title>Example</title>
+        <programlisting role="example"><![CDATA[ 
+filebrowser();
+ ]]></programlisting>
+    </refsection>
 </refentry>
index 9866932..a72b228 100644 (file)
@@ -30,6 +30,7 @@
     <refsynopsisdiv>
         <title>Calling Sequence</title>
         <synopsis>
+            xcos()
             xcos(filename)
             xcos(scs_m_list)
         </synopsis>
@@ -174,7 +175,17 @@ xcos(scs_m);]]></programlisting>
             </imageobject>
         </mediaobject>
         <para>Xcos requires a C compiler for simulation acceleration.</para>
-        <para>It is recommended that you install a supported compiler on your machine.</para>
+        <para>An installed supported compiler is recommended.</para>
+    </refsection>
+    <refsection>
+        <title>Example</title>
+        <programlisting role="example"><![CDATA[ 
+xcos();
+xcos(SCI+"/modules/xcos/demos/Discrete-KalmanFilter.xcos");
+scs_m = scicos_diagram();
+scs_m.objs($+1) = BIGSOM_f("define");
+xcos(scs_m);
+ ]]></programlisting>
     </refsection>
     <refsection id="SeeAlso_xcos">
         <title role="see also">See Also</title>