Christopher2222

6035 Reputation

24 Badges

17 years, 143 days

MaplePrimes Activity


These are replies submitted by Christopher2222

We can get the answer using isolve as well using seq as I found out here http://www.mapleprimes.com/questions/130964-Isolve-Wont-Give-All-Solutions-Here

ineq1:=6*x+2*y>=49:
ineq2:=7*x+3*y<=59:

seq(isolve({ineq1 , ineq2 , y<=k , y>=k }), k=0..5) 

                                             {x = 8, y = 1}

Much appreciate your explanation.  I better understand now.   Thanks!

Much appreciate your explanation.  I better understand now.   Thanks!

Please be more helpful.  Can you explain?  There is nothing in the manual that says how to install a package under an existing package.  And of course I don't want to mess up anything built in. 

with(ScientificConstants[Astronomy]):

GetConstant(M[Jupiter])
              mass_of_Jupiter , symbol=MJupiter , value= 1.90 1027 , units=kg
etc...

If I build the package outside then I can't use the call GetConstant, I don't think.  But this is why I ask the question.
                

Please be more helpful.  Can you explain?  There is nothing in the manual that says how to install a package under an existing package.  And of course I don't want to mess up anything built in. 

with(ScientificConstants[Astronomy]):

GetConstant(M[Jupiter])
              mass_of_Jupiter , symbol=MJupiter , value= 1.90 1027 , units=kg
etc...

If I build the package outside then I can't use the call GetConstant, I don't think.  But this is why I ask the question.
                

It appears Maple's internal loop calculation restricts isolve from producing values outside a 'rectangular box range'

Visualizing the issue

with(plots):
a:=6*x+2*y>=48:
b:=6*x+2*y<=72:

Solving for integer values in the region 

 ourrange := a, b, x >= 0, x <=12 , y >=0 , y <= 5:

isolve({ourrange})[3..]
                                   {x = 8, y = 0}, {x = 8, y = 1}, {x = 8, y = 2}, {x = 8, y = 3}, {x = 8, y = 4}, {x = 8, y = 5}, {x = 9, y = 0}, {x = 9, y = 1}, {x = 9, y = 2}, {x = 9, y = 3}, {x = 9, y = 4}, {x = 9, y = 5}, {x = 10, y = 0}, {x = 10, y = 1}, {x = 10, y = 2}, {x = 10, y = 3}, {x = 10, y = 4}, {x = 10, y = 5}

You'll also see in the answer (which I left out) at the beginning either warning solutions may have been lost (thrown up by M15) or some variation of y=_NN#~ (M12 )  M12 doesn't say solutions lost, but lets put the points given into a plot. 

xx := map(rhs, [isolve({ourrange})[3.., 1]]):
yy := map(rhs, [isolve({ourrange})[3.., 2]]):
zz := zip(`[]`, xx, yy):
zzz:=pointplot(zz):

aa := implicitplot(a, x = 0 .. 12, y = 0 .. 5, filledregions = true, transparency = .5):
bb := implicitplot(b, x = 0 .. 12, y = 0 .. 5, filledregions = true, transparency = .5):

display(aa,bb,zzz)

You can see which points have been missed, [11,0] , [11,1] , [11,2] , [12,0] , [12,1] , [7,3] , [7,4] , [7,5]  and  [6,5]

for a little better view, we'll change one inequality equation

a:=6*x+8*y>=48: #changing the 2 to 8
aa:=implicitplot(a,x=0..12,y=0..5,filledregions=true,transparency=.5):  # re-executing the aa plot
ourrange := a, b, x >= 0, x <= 12, y >=2 to y<=5:  # change the y range
#re-executing our points
xx := map(rhs, [isolve({ourrange})[3.., 1]]):
yy := map(rhs, [isolve({ourrange})[3.., 2]]):
zz := zip(`[]`, xx, yy):
zzz:=pointplot(zz):

display(aa,bb,zzz)

and we can see the rectangular selection behaviour a little easier.  Maybe Maple is supposed to do that but I don't think so, the isolve routine could be fixed. 

If I reduce the upper y search value I can see a little more

isolve({a, b, x >= 0, x<=10,y >= 0, y <= 3})
                    {y = _NN21}, {y = 3-_NN22}, {x = 8, y = 0}, {x = 8, y = 1}, {x = 8, y = 2}, {x = 8, y = 3}, {x = 9, y = 0}, {x = 9, y = 1}, {x = 9, y = 2}, {x = 9, y = 3}

But when I get to y<=4 I loose my x=9 solutions.

PasswordField is not available in Maple12.  How can I make something similar there?

I do not want circle symbols for each keypress.  I want to know how to replace with a random letter.  Is it possible in M12?  If not how would you modify the PasswordField code in newer versions to do just that?  I could possibly add the same procedure to the M12 library.  Would that work? 

I thought a simple maplet process was easy but I am finding it difficult to arrive at a solution.  The answer seems to be more complex than I thought.  Any thoughts?

PasswordField is not available in Maple12.  How can I make something similar there?

I do not want circle symbols for each keypress.  I want to know how to replace with a random letter.  Is it possible in M12?  If not how would you modify the PasswordField code in newer versions to do just that?  I could possibly add the same procedure to the M12 library.  Would that work? 

I thought a simple maplet process was easy but I am finding it difficult to arrive at a solution.  The answer seems to be more complex than I thought.  Any thoughts?

So either no one knows how, or it can't be done. 

How about this question instead... In a maplet create 2 text fields where the 2nd text field copies input from the first as you type (realtime copy so to speak).  I know how to do the copy when the focus changes but how about realtime?  Is it possible? 

I tried to see the differences between showstat(Maplets[Elements][TextField]) and showstat(Maplets[Elements][PasswordField]) but I could find none.  As far as I could tell both codes were exactly the same. 

I had access to a newer version of Maple and discovered Maplets[Elements][PasswordField] it is similar to what I am after and I thought it would hold a key to what I am after.

I used showstat but the code is long and I was unable to locate which part of the code could help me.  Anyone?

Okay so here's a bit of code, the idea was so that any onlookers couldn't read the input.

with(Maplets[Elements]):
maplet:=Maplet([["Enter string to be hashed:", BoxCell(TextBox['S1'](1 .. 32, foreground = white))], Button("OK", Shutdown(['S1']))]):
result:=Maplets[Display](maplet):
StringTools[Hash](result[1]);

The simplest way was to change the fontcolor to white so you can't see it, password hiding really, but the intention is to display different letters and not just *'s.

 

 

From a maplet in the standard GUI.

Say for example each character I push a different letter is displayed. 

@acer Yes, the m format file I am trying to look at is not mine.  Although using m files makes code faster, I suppose an unintended side effect of using m files is that the code remains slightly cryptic.

Although seeing that the m files are just a collection of assignment statements or procs the order is not that important.  I think using anames() before and after loading the m file and getting the differences should lead someone to find the important contents within the m file.  Originally I thought simply opening an m file would simply display the procs within the file.

(Unfortunately I was not reviewing the HYPERG question.)

First 105 106 107 108 109 110 111 Last Page 107 of 162