Page 2 of 2

Re: Getting Snakey

Posted: Sat Feb 15, 2020 6:35 pm
by richmond62
TypeCasting . . .

i.e. converting $tring variables into numeric ones and the reverse . . . what a load of "inconvenience.' 8)

Not needed in LiveCode.
-
cc3.png
-
Far too much 'snake'!

Re: Getting Snakey

Posted: Sat Feb 15, 2020 6:38 pm
by richmond62
I also like Pascal (and Delphi) which came after it
Oh, well, at least we know now. 8)
-
index.jpeg
index.jpeg (15.7 KiB) Viewed 14249 times

Re: Getting Snakey

Posted: Sat Feb 15, 2020 10:00 pm
by dunbarx
Richmond.

You posted an example above using "mod". "Div" is its cousin. They usually are used together. You knew the one but not the other????

Craig

Re: Getting Snakey

Posted: Sat Feb 15, 2020 10:34 pm
by richmond62
You knew the one but not the other????
indeed, as I've never been interested in thast sort of number. 8)

Re: Getting Snakey

Posted: Sun Feb 16, 2020 9:05 am
by richmond62
Beeb.png
-
Aha . . . straight from BBC BASIC. 8)

Re: Getting Snakey

Posted: Sun Feb 16, 2020 1:55 pm
by bogs
richmond62 wrote: Sun Feb 16, 2020 9:05 am Aha . . . straight from BBC BASIC.
I forgot if I ever said thank you btw for pointing that assembly version of BBC Basic out to me, it actually works better on 'nix than many solutions made for 'nix. I still haven't gotten around to speed testing, but I am finding it fascinating so THANKS :mrgreen:

Re: Getting Snakey

Posted: Sun Feb 16, 2020 3:42 pm
by bogs
I came across this, and remembering this thread, thought you might get some use from it. It comes directly from the NSA, and at first glance looks pretty comprehensive.

It came up as a story on Slashdot this morning -
"Now budding Python developers can read up on the National Security Agency's own Python training materials," reports ZDNet:
Software engineer Chris Swenson filed a Freedom of Information Act request with the NSA for access to its Python training materials and received a lightly redacted 400-page printout of the agency's COMP 3321 Python training course. Swenson has since scanned the documents, ran OCR on the text to make it searchable, and hosted it on Digital Oceans Spaces. The material has also been uploaded to the Internet Archive...

"If you don't know any programming languages yet, Python is a good place to start. If you already know a different language, it's easy to pick Python on the side. Python isn't entirely free of frustration and confusion, but hopefully you can avoid those parts until long after you get some good use out of Python," writes the NSA...

Swenson told ZDNet that it was "mostly just curiosity" that motivated him to ask the NSA about its Python training material. He also said the NSA had excluded some course material, but that he'll keep trying to get more from the agency... Python developer Kushal Das has pulled out some interesting details from the material. He found that the NSA has an internal Python package index, that its GitLab instance is gitlab.coi.nsa.ic.gov, and that it has a Jupyter gallery that runs over HTTPS. NSA also offers git installation instructions for CentOS, Red Hat Enterprise Linux, Ubuntu, and Windows, but not Debian.

Re: Getting Snakey

Posted: Mon Feb 17, 2020 2:03 pm
by Lagi Pittas
Hi Richmond,

The canonical use case (for me at least) for the upper function is when you ask for an entry and you have allowed upper and lowercase.

So the user enters "Fred" for his name.

If you want to test for a fred (you don't allow freds to use your program), you can test for "Fred" or "FRed" or FREd or fRED ....
because his cat might have sat on his shift key intermittently while he was typing.

If on the other hand you test for the UPPER of the input it doesn't matter if he has two cats and and an even longer name - as long as the cat(s) only sits on caps-lock or shift keys.

You just test for "FRED" or you can use lowercase() on the input and test for "fred"

Lagi

Re: Getting Snakey

Posted: Sun Feb 23, 2020 4:45 pm
by richmond62
snap1.png
-
Working out where one's monster is going to be on screen is horribly difficult compared with LiveCode.

Re: Getting Snakey

Posted: Sun Mar 01, 2020 11:28 am
by richmond62
And what do we find?

That an object's position is referred to by its top-left corner . . .

Personally, referring to an object by its centre point (as in LiveCode) seems better
as one does not have to worry when recycling code about an object's dimensions.

Re: Getting Snakey

Posted: Sun Mar 01, 2020 12:05 pm
by bogs
Why would you be worried about it in either case? I don't think there are too many languages where you don't have (objectWidth, objectHeight) anymore.

Re: Getting Snakey

Posted: Sun Mar 01, 2020 12:40 pm
by richmond62
worried
No, not worried, just realise how much easier LiveCode is for lazy types like myself
as don't have to work out the width and height of objects before positioning them.

Re: Getting Snakey

Posted: Sun Mar 01, 2020 12:57 pm
by bogs
Why would you have to work that out? Are you saying that the language doesn't include (obj.width, obj.height) ? Oh, that took 3 seconds of searching :P
>>> import rect
>>> r1 = (10, 20), (90, 80)

>>> r2 = (0, 0), (10, 20)

>>> r3 = rect.intersect([r1, r2])

>>> if r3 is rect.empty: print 'Empty intersection'
Yah, that seems an impossible task to overcome hee hee :D