Login   Register  
PHP Classes

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ricardo Gamba  >  Matrix algebra  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Console index
Class: Matrix algebra
Perform operations with matrices
Author: By
Last change:
Date: 4 years ago
Size: 2,471 bytes


Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <meta name="author" content="Ricardo Gamba" />
    <script language="javascript" src="jquery.js"></script>
    <title>Matrix Console</title>
    <script language="javascript">
        function send_cmd(){
                type: "post",
                url: "cmd.php",
                data: {
                    'cmd': document.getElementById("txt_cmd").value
                cache: false,
                success: function(res){
        function example_code(){
            var codigo="// Indice de comandos\n"
            codigo+="// Matrix creation\n";
            codigo+="$a = mat.create('[1 4 2;6 5 9;4 1 7]');\n";
            codigo+="$b = mat.create('[12 3 78;8 5 45;0 9 45]');\n\n";

            codigo+="// Basic operations\n";
            codigo+="$suma = mat.sum($a,2);\n";

            codigo+="// Functions\n";
            codigo+="print 'Determinant of a:' . mat.det($a);\n\n";

            codigo+="// See help for more functions...\n";

        font-family: arial, tahoma, sans-serif;
        background: #e6e6e6;
        font-size: 12px;

<h3>Matrix Console</h1>
<div><b>Instructions:</b> type the command sequence on the left box (PHP) and click the 'Execute' button. For help, type <i>help;</i></div><br />
<table style="width: 100%; table-layout: fixed">
<div>Command line:</div>
<div><textarea id="txt_cmd" name="cmd" style="width: 100%; height: 500px;background: #000; color: green"></textarea></div>
<div style="float: left"><input type="button" onclick="send_cmd()" value="Execute" /></div>
<div style="float: right"><input type="button" onclick="example_code()" value="Example code" />
<td style="width: 10px"></td>
<td style="vertical-align: top">
<div><textarea id="console" style="width: 100%; height: 500px;" readonly></textarea></div>