Joe Riel

8049 Reputation

22 Badges

15 years, 10 days

MaplePrimes Activity


These are replies submitted by Joe Riel

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 );
Will, your post should have been in plain text; as it is, the unterminated <b> and <i> do not show and effect the rest of the page. I'd like to see <c> as an abbreviation for <code>. I use code a lot, but the extra typing is a bit painful.
The procedure assume assigns a local variable named (say) a~ to the global variable a. However, the assignment statement does not evaluate its left-side symbol (for good reason), so following the assignment statement, the global a is assigned 0 (etc). However, the Matrix A has the local variable a~, so there is no effect on it. To assign values to the assumed variables you could replace the line a:=0; b:=1/2; c:=0 with assume(a=0,b=1/2,c=0). That works because, unlike the assignment statement, the procedure assume evaluates the variables.
Here I'll enter the previously mentioned code, this time using Filtered HTML mode with tags:
plot(pts, style=point);
As Stephen mentioned, the missing text does not show up in the page source. I added a second </pre> tag. Without it this text was in the preformatted font (with no line breaks).
Well, I'd prefer for bold, rather than the more cumbersome . Oh, wait, I see that it is listed; never mind. Note that is listed twice in the "allowed HTML tags" bullet under "Filtered HTML".
First 176 177 178 179 180 181 182 Page 178 of 182