Getting Snakey

Want to talk about something that isn't covered by another category?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sat Feb 15, 2020 6:35 pm

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'!
Last edited by richmond62 on Sat Feb 15, 2020 7:00 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sat Feb 15, 2020 6:38 pm

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 2891 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7405
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Getting Snakey

Post by dunbarx » Sat Feb 15, 2020 10:00 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sat Feb 15, 2020 10:34 pm

You knew the one but not the other????
indeed, as I've never been interested in thast sort of number. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sun Feb 16, 2020 9:05 am

Beeb.png
-
Aha . . . straight from BBC BASIC. 8)

bogs
Posts: 5101
Joined: Sat Feb 25, 2017 10:45 pm

Re: Getting Snakey

Post by bogs » Sun Feb 16, 2020 1:55 pm

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:
Image

bogs
Posts: 5101
Joined: Sat Feb 25, 2017 10:45 pm

Re: Getting Snakey

Post by bogs » Sun Feb 16, 2020 3:42 pm

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.
Image

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 349
Joined: Mon Jun 10, 2013 1:32 pm

Re: Getting Snakey

Post by Lagi Pittas » Mon Feb 17, 2020 2:03 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sun Feb 23, 2020 4:45 pm

snap1.png
-
Working out where one's monster is going to be on screen is horribly difficult compared with LiveCode.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sun Mar 01, 2020 11:28 am

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.
Last edited by richmond62 on Sun Mar 01, 2020 12:08 pm, edited 1 time in total.

bogs
Posts: 5101
Joined: Sat Feb 25, 2017 10:45 pm

Re: Getting Snakey

Post by bogs » Sun Mar 01, 2020 12:05 pm

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.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Snakey

Post by richmond62 » Sun Mar 01, 2020 12:40 pm

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.

bogs
Posts: 5101
Joined: Sat Feb 25, 2017 10:45 pm

Re: Getting Snakey

Post by bogs » Sun Mar 01, 2020 12:57 pm

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
Image

Post Reply

Return to “Off-Topic”