Joe Riel

9630 Reputation

23 Badges

19 years, 271 days

MaplePrimes Activity


These are replies submitted by Joe Riel

The mw file is badly formatted.  If you export it as an mpl file (Maple Input Format), the third arguments (eta) in the last two function calls do not exist.  Am guessing there is a weird character in the input.

No file was attached to the question.

I see you've corrected that.

@C_R Just to check, I restored the use of the default page in my Maple 2023, then restarted my linux machine and launched standard Maple.  Didn't notice any obvious slowness when dealing with the default opening page. 

@jalal To remove the two inner circles, add option grid=[0,13].

@C_R I'm not familar with int, but some of the internal procedures, called here, have option cache. While I don't expect that to matter when an error occurs, it's possible that a value could be saved and then later reused without having to attempt the computation that raises an error.  Would have to look closer.

A  problem is the omitted multiplication signs. You should use

   v1 := sin(c)*sin(a)*(a-b);
   v2 := sin(c1)*sin(a1)*(-a+b)
 

x := 0:
to 10 do
    print(x);
    x += 0.1;  # equivalent to x := x+0.1;
end do:

@nicolesharp100 Interesting idea (tagging).

@Vector For me, the calls FindLonLat returned nothing.  On debugging them, the record returned by a call to JSON:-ParseFile contains:

error_message = "You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account",

Please upload the msim file.  Use the green-uparrow at this site when responding.

I don't understand.  What do you mean by "proper form"?

@emendes It isn't needed here because coefmodel is also an argument of CleanExpr, that is, coefmodel is passed to CleanExpr in the call to Grid:-Seq.  It would be possible to remove it as an argument, then you would have to use Grid:-Set to make it known to the various kernels. 

@Carl Love I could not recall the Statistics:-Tally function and searching for it was hopeless---best I could think of was the more or less equivalent StringTools:-CharacterFrequencies, but the usage is all wrong.  Was hesistant to extend to other than symbols because am not sure about the interpretation of, say, [a, -a].

@acer The use of print came directly from the original:

(**) showstat(WARNING);

WARNING := proc(msg)
   1   if not _Env_hide_warnings = true then
   2       print(INTERFACE_WARN(1,msg,_passed[2 .. -1]))
       end if
end proc

The environment variable is relatively new (added a couple years ago); useful to know about.
Here's an updated version of the module that fixes a few bugs (thanks) and adds a clear option to Caught to clear a warning once it has been noted.
 

Warnings := module()
option package;

local catchall, formats, warnings;

export
    Catch := proc(fmts? :: seq(string), { all :: truefalse := false })
        if all then
            catchall := true;
        else
            formats := [fmts?];
        end if;
    end proc;

export
    ModuleLoad := proc()
    global WARNING;
        unprotect('WARNING'):
        WARNING := proc(fmt)
            if catchall or Match(fmt) then
                warnings[fmt] := StringTools:-FormatMessage(fmt, _rest);
            else
                streamcall('INTERFACE_WARN'(1,fmt,_rest));
            end if;
        end proc;
        protect('WARNING'):
        Clear();
    end proc;


export
    Display := proc()
    local msg;
        for msg in [entries(warnings,'nolist')] do
            printf("%s\n", msg);
        end do;
    end proc;

export
    Caught := proc(fmt :: string, { clear :: truefalse := false } )
        for f in [indices(warnings,'nolist')] do
            if SearchText(fmt,f)=1 then
                if clear then
                    warnings[f] := evaln(warnings[f]);
                end if;
                return true;
            end if;
        end do;
        return false;
    end proc;

local
    Match := proc(fmt)
        ormap(f -> SearchText(f, fmt)=1, formats);
    end proc;

export
    Clear := proc()
        catchall := false;
        warnings := table();
        formats := [];
        NULL;
    end proc:

export
    ModuleUnload := proc()
        kernelopts('unread' = ':-WARNING');
    end proc;

    ModuleLoad();

end module:

 

@PaulNewton A colon suppresses output only if it terminates a top-level statement; colons that terminate (technically separate) substatements of a structured statement have no effect on whether output is generated.

1 2 3 4 5 6 7 Last Page 3 of 195