mmcdara

3733 Reputation

17 Badges

6 years, 70 days

MaplePrimes Activity


These are questions asked by mmcdara

Hi, 

I'm french and I'm working on an Imac.

The path for the desktop is  /Users/myname/Desktop.
If cur := "/Users/myname", one can easily verify this:

IsDirectory(cat(cur, "/Desktop"))
                              true

In some application I'm developping, I use a  FileDialog Maplet to select a directory where to write a file.
For an unknown reason this maplet doesn't display the desktop with the name Desktop, but with it's french counterpart Bureau.

# Observe thet the desktop (8th line above) is named "Desktop"
# Now run 

 maplet := Maplet(
      FileDialog['FD1'](
        'title' = "Output Directory", 
        'directory' = cur,
        'fileselectionmode' = directoriesonly, 
        'onapprove' = Shutdown(['FD1']), 
        'oncancel' = Shutdown()
      )
    ):

res := Maplets[Display](maplet):
StringTools:-StringSplit(res[], cur);

                        ["", "/Bureau"]


As a result, saving a file in cur/Bureau generates an error.
Here is a more detailed worksheet:
English_French_confusion.mw


Of course I have adjusted my code in an ad hoc way by french translating  what the maplet returns, but it is just a band-aid on a larger wound. For instance "Downloads" appears as "Téléchargements", and so on, and many names potentially need to be translated.

I do not understand why FileTools seems to "work in english" while  FileDialog seems to "work in french".
I suspect this is due to the fact that my Imac, although natively "English speaking", uses a French overlay. 
For instance the  Unix command pwd run in a terminal window indicates Users or Desktop, while  < command + i > executed on a given file displays Utilisateurs and Bureau.
Could it be that FileTools relies upon English, while FileDialog  relies upon the regionalized language?


What do you advice me:

  • to intervene at the Apple level by changing the "user" language my Imac uses, 
  • to intervene at the FileDialog  level (if possible),
  • or to keep translating undesired outcomes from FileDialog?
     

Thanks in advance

Hi

It want to generate all the words from a NL-letter alphabet and whose lengths are at most LW.

I could not find any function in the combinat package do to that (at least without combining some of them, I'm using Maple 2015 right now); maybe the Iterator package has some features do to that?

For the moment I use this procedure (which generates a few words of length LW+1 I have to suppress)

restart:
G := proc(d)
 local n, wo:
  global W:
  while max(length~(W)) < d do
    wo := copy(W):
    for n from 1 to nops(L) do
      W := {W[], cat~(wo, L[n])[]};
    end do:
    thisproc(d)
  end do:
end proc:


# Words of length not larger than LW which are made of at most NL letters

NL := 3:
L  := StringTools:-Char~([$65..65+NL-1]);
W  := L:
LW := 3:

G(3):
w3 := W;
                        ["A", "B", "C"]

{"A", "AA", "AAA", "AAB", "AAC", "AB", "ABA", "ABB", "ABC", "AC", 

  "ACA", "ACB", "ACC", "B", "BA", "BAA", "BAB", "BAC", "BB", 

  "BBA", "BBB", "BBC", "BC", "BCA", "BCB", "BCC", "C", "CA", 

  "CAA", "CAB", "CAC", "CB", "CBA", "CBB", "CBC", "CC", "CCA", 

  "CCB", "CCC"}


W  := L:
CodeTools:-Usage( G(12) ):
numelems(W);

memory used=0.62GiB, alloc change=422.58MiB, cpu time=13.70s, real time=8.37s, gc time=8.08s
                             797160

Words_Generator.mw

Do you have any idea to improve it from memory used and cpu time points of view)?

Thanks in advance

Let A a (linear) partial differential operator and f=f(x, y, t) a function of space (x, y) and time (t).
Let DXY=[a, b] x [c, d], DT=[0..e] and  dXY the boundary of DXY.
Is it possible, with Maple 2015, to solve numerically the pde Af=0 in the open domain  DXY * DT
with Dirichlet conditions on dXY and initial condition f(DXY, 0)?
It seems that the option 'numeric' of pdsolve doesn't work with more than 1 "non time" independent variable:
Error, (in pdsolve/numeric/process_PDEs) can only numerically solve PDE with two independent variables, got {t, x, y}

Nevertheles I seem to remember seeing this on Mapleprime (?)
If Maple 2015 can't do it, can Maple 2020?

Thanks in advance

  • Remark: Af=0 is the heat equation with rho=Cp=lambda=1.
    I guess I could code the alternate directions method to transform  Af=0 into a sequence Axf=0,  Ayf=0 Axf=0 ... of 1D diffusion equations but I'm a little bit lazzy and I'm waiting for your feedback before doing this.

 

Two questions posted by AHSAN have just been deleted.
They were somewhat redundant with a previous one, which probably justifies their deletion.
Nevertheless, some had given AHSAN answers or replies: in this case, could the answers not be kept in some place? Perhaps in the question that the "eraser" thought was the original question?

Hi, 

Why does the use of  global  at the top level of a worksheet is no longer accepted in the most recent versions of Maple (it still was in Maple 2015), but only within procedures?

TIA

First 7 8 9 10 11 12 13 Last Page 9 of 33