Joe Riel

9660 Reputation

23 Badges

20 years, 2 days

MaplePrimes Activity


These are replies submitted by Joe Riel

For those of us who don't have ready access to DOS, how about a screen shot?
if you hadn't replied 8-). My preference would be to allow edits regardless whether there is a response. At least that way comments could get corrected at the source, rather than in the responses. The thorough poster would mention that the comment had been changed as a result of the following feedback.
Thanks, alec. At least I knew what I meant 8-).
I poked around the $MAPLE/bin.whatever directory and noticed that mserver was not executable. Something must have gone wrong during the upgrade; maybe the failure the first time around (when I had an mserver running in the background) affected the permissions. I changed permissions of mserver to make it executable; now Maple is working again (and the standard gui says I have a 10.01 version).
I'm behind a firewall built into a cable modem. I modified the firewall to enable port 8000 for UDP/TCP access. Upon clicking the Tools > Check for Updates a window popped up saying that an update is available. I clicked the first box, maple shutdown and nothing happened. Eventually I figured out that I had to be running Maple as root to get the next part to work. Then, when Maple shutdown, another window stayed opened. It required some interaction, but appeared to successfully download and install the upgrade. Well, it did the second time around. The first time I had an mserver running in the background (I was using cmaple) and complained during the install (near the end). After killing the mserver and repeating the steps, the upgrade box completed, apparently successfully. That success, alas, was short-lived. When I fired up the standard gui and attempted to execute a command, a box popped up stating that it was attempting to connect to the server. It was unable to. I then tried to start cmaple (i.e. run maple in a shell). Nothing. I get the message "could not start server". So currently I have a completely unusable Maple 10 installation. Any ideas? The error message mentioned possible problems with firewalls, however, I'm running a linux box. The firewall I referred to is internal to the cable modem and has nothing to do with my linux box, so doubt that that is the issue.
The C function wday doesn't work with gcc; at least not for me. The problem is that tm_hour, tm_min, tm_sec members of the time_str structure are not initialized. Initializing them to 0 solved that problem. Here's my (obvious) modification.
#include <maplec.h>
#include <time.h>

EXT_DECL time_t M_DECL mk(int mon,
			  int mday,
			  int year,
			  int hour,
			  int min,
			  int sec) {
  struct tm time_str;

  time_str.tm_year       = year - 1900;
  time_str.tm_mon        = mon - 1;
  time_str.tm_mday       = mday;
  time_str.tm_hour       = hour;
  time_str.tm_min        = min;
  time_str.tm_sec        = sec;
  time_str.tm_isdst      = -1; // is this right?
  
  return( mktime(&time_str) );
}


EXT_DECL int M_DECL wday(int mon, 
			 int mday, 
			 int year) {

  struct tm time_str;

  time_str.tm_year       = year - 1900;
  time_str.tm_mon        = mon - 1;
  time_str.tm_mday       = mday;
  time_str.tm_hour       = 0;
  time_str.tm_min        = 0;
  time_str.tm_sec        = 0;
  time_str.tm_isdst      = -1; // info not available
  
  mktime(&time_str);
  
  return( time_str.tm_wday );
}
Note the use of maplec.h which is distributed with Maple, see $MAPLE/extern. It assigns, among other things, the EXT_DECL and M_DECL macros to expand to nothing in linux and to __declspec(dllexport) and __stdcall with a Microsoft compiler
interface(version); Standard Worksheet Interface, Maple 10, Linux, May 13 2005 Build ID 190196
I have the linux version of Maple 10. Executing Tools -> Check for Updates just returns a message saying that no updates are available. I've heard that, at least for Windows, the updated version 10.01.
I compiled and ran mktime with your example and get
mktime(8,27,2005,13,47,30);
                              1125175650
The number you showed, 1125168450, corresponds to 11:47:30. Two questions: (1) did you transcribe the number incorrectly; (2) does the epoch number correspond to local time or UCT? If the latter, is a translation supposed to be done somewhere?
I don't understand the operation of the environmental variable on the system clock. On my Debian Linux box, to get this to work properly I need to do
export TZ='America/Los_Angeles'
The particular string came from running tzselect. Then the call to FormatTime returns "America/Los_Angeles". Using
export TZ='PDT'
sets the results of date to the wrong time (increases it by 7 hours).
I don't understand the operation of the environmental variable on the system clock. On my Debian Linux box, to get this to work properly I need to do
export TZ='America/Los_Angeles'
The particular string came from running tzselect. Then the call to FormatTime returns "America/Los_Angeles". Using
export TZ='PDT'
sets the results of date to the wrong time (increases it by 7 hours).
On my system the TZ environmental variable is not set. However, if I do assign and export it, FormatTime displays it:
$ export TZ=PDT
$ maple -q
> StringTools:-FormatTime("%Z");
                                 PDT
On my system the TZ environmental variable is not set. However, if I do assign and export it, FormatTime displays it:
$ export TZ=PDT
$ maple -q
> StringTools:-FormatTime("%Z");
                                 PDT
You should be displaying the output in a MathMLViewer element, not a text field. MathML:-Export, which is needed to convert a maple expression to a MathML expression does not, alas, properly handle tables, and the output of tensor[create] is a table with two indices: index_char and compts. Fortunately, you don't want to display the value of index_chars, but rather the matrix stored in compts. Here is the code that does that
restart;
with(Maplets[Elements]):
A := matrix([[a,0,0],[0,a,0],[0,0,a]]);
with(tensor):

maplet := Maplet( Window(
    'title'="test"
    ,[NULL
      ,["g_compts "
       ,TextField['TF1']('value' = eval(A), 60)
       ]
      ,MathMLViewer['MMLV1'](value = "")
      ,[NULL
        ,Button("create tensor", Evaluate('MMLV1' = 'MathML[Export](eval(tensor[create]([-1,-1],eval(TF1))[compts]))'))
        ,Button("OK", Shutdown())
       ]
     ])):

Maplets[Display]( maplet );
You should be displaying the output in a MathMLViewer element, not a text field. MathML:-Export, which is needed to convert a maple expression to a MathML expression does not, alas, properly handle tables, and the output of tensor[create] is a table with two indices: index_char and compts. Fortunately, you don't want to display the value of index_chars, but rather the matrix stored in compts. Here is the code that does that
restart;
with(Maplets[Elements]):
A := matrix([[a,0,0],[0,a,0],[0,0,a]]);
with(tensor):

maplet := Maplet( Window(
    'title'="test"
    ,[NULL
      ,["g_compts "
       ,TextField['TF1']('value' = eval(A), 60)
       ]
      ,MathMLViewer['MMLV1'](value = "")
      ,[NULL
        ,Button("create tensor", Evaluate('MMLV1' = 'MathML[Export](eval(tensor[create]([-1,-1],eval(TF1))[compts]))'))
        ,Button("OK", Shutdown())
       ]
     ])):

Maplets[Display]( maplet );
First 189 190 191 192 193 194 195 Page 191 of 195