Getting Snakey
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
TypeCasting . . .
i.e. converting $tring variables into numeric ones and the reverse . . . what a load of "inconvenience.'
Not needed in LiveCode.
- -
Far too much 'snake'!
i.e. converting $tring variables into numeric ones and the reverse . . . what a load of "inconvenience.'
Not needed in LiveCode.
- -
Far too much 'snake'!
Last edited by richmond62 on Sat Feb 15, 2020 7:00 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
Oh, well, at least we know now.I also like Pascal (and Delphi) which came after it
-
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Getting Snakey
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
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
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
indeed, as I've never been interested in thast sort of number.You knew the one but not the other????
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
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
Re: Getting Snakey
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 -
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.
-
- VIP Livecode Opensource Backer
- Posts: 365
- Joined: Mon Jun 10, 2013 1:32 pm
Re: Getting Snakey
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
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
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
Working out where one's monster is going to be on screen is horribly difficult compared with LiveCode.
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
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.
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.
Last edited by richmond62 on Sun Mar 01, 2020 12:08 pm, edited 1 time in total.
Re: Getting Snakey
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.
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Getting Snakey
No, not worried, just realise how much easier LiveCode is for lazy types like myselfworried
as don't have to work out the width and height of objects before positioning them.
Re: Getting Snakey
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
Yah, that seems an impossible task to overcome hee hee>>> 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'