Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-14 Thread Chris Angelico
On Sat, Oct 14, 2017 at 10:16 PM, Ben Bacarisse wrote: > "Peter J. Holzer" writes: >> Which probably boils down to the question: Why did providers offer PHP >> and not Python? One reason might be that at the time no suitable web >> framework for Python

Re: Lies in education [was Re: The "loop and a half"]

2017-10-14 Thread Chris Angelico
On Sat, Oct 14, 2017 at 10:12 PM, Steve D'Aprano wrote: > But be reasonable, I had just asked almost exactly the same question not one > line earlier: > > "If it's read-only, how can the compiler write to it?" > > and (as far as I can see) *nobody* thought to

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-14 Thread Ben Bacarisse
"Peter J. Holzer" writes: > On 2017-10-13 21:42, Ben Bacarisse wrote: >> That's one way to put it. Another is that to use Python I need to buy a >> new service that is already configured. > > That's exactly the same for PHP. You can't use that either

Re: Lies in education [was Re: The "loop and a half"]

2017-10-14 Thread Steve D'Aprano
On Sat, 14 Oct 2017 08:26 pm, Peter J. Holzer wrote: > On 2017-10-14 01:05, Steve D'Aprano wrote: >> In context, we are talking about a computer program (the compiler) writing >> data to memory. > > No, I don't think so. You keep talking about that, even though

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-14 Thread alister via Python-list
On Sat, 14 Oct 2017 11:41:08 +0200, Peter J. Holzer wrote: > On 2017-10-13 21:42, Ben Bacarisse wrote: >> That's one way to put it. Another is that to use Python I need to buy >> a new service that is already configured. > > That's exactly the same for PHP. You can't use

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-14 Thread Peter J. Holzer
On 2017-10-13 21:42, Ben Bacarisse wrote: > That's one way to put it. Another is that to use Python I need to buy a > new service that is already configured. That's exactly the same for PHP. You can't use that either unless somebody configured to server to use it. The

Re: Lies in education [was Re: The "loop and a half"]

2017-10-14 Thread Peter J. Holzer
On 2017-10-14 01:05, Steve D'Aprano wrote: > On Sat, 14 Oct 2017 07:15 am, Peter J. Holzer wrote: >> On 2017-10-13 15:11, alister wrote: >>> On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: Steve D'Aprano wrote: > I wasn't

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 2:46 PM, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 09:47 pm, Marko Rauhamaa wrote: > >> "Peter J. Holzer" : >> >>> On 2017-10-13 05:28, Gregory Ewing wrote: Not only does "byte" not always

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 09:47 pm, Marko Rauhamaa wrote: > "Peter J. Holzer" : > >> On 2017-10-13 05:28, Gregory Ewing wrote: >>> Not only does "byte" not always mean "8 bits", but >>> "char" isn't always short for "character"... >> >> True. > >

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Grant Edwards
On 2017-10-14, Gregory Ewing wrote: > >> I doubt that either process is in widespread usage any longer as >> most manufacturers no incorporate a way to update the firmware of a >> device > > Magnetic core technology died out long before that, due to > inability to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 07:04 am, Peter J. Holzer wrote: > On 2017-10-13 15:28, Steve D'Aprano wrote: >> On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: It's just a technique, like greying out certain menu options - clicking them will do nothing, but you

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 01:51 am, Chris Angelico wrote: > On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano > wrote: >> It seems to me that you're not talking about ROM at all, but ordinary RAM. >> Then what do you mean by "read only"? A block of memory with a flag that >>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 07:15 am, Peter J. Holzer wrote: > On 2017-10-13 15:11, alister wrote: >> On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >>> Steve D'Aprano wrote: I wasn't questioning where the data came from, but how the compiler can write to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
alister wrote: in the past for large quantitys the data in a ROM chip was part of the chip etching mask I know, I'm considering the masking process to be a kind of write operation. The Apollo lunar lander used a magnetic core store that was hard coded at the time it was "Woven" I doubt

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: For example, pressing delete when there is no text to delete should just silently do nothing. That's really just a matter of deciding what should count as an error and what shouldn't. You've decided that "pressing Delete when there's nothing to delete does nothing" is a

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Oct 14, 2017 at 8:42 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse >>> wrote: Chris Angelico

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 9:02 AM, Grant Edwards wrote: > On 2017-10-13, Chris Angelico wrote: > > [regarding PHP vs Python capable web-hosting services] > >> Thing is, that's exactly the same for both languages these days. You >> can get cheap (even

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Grant Edwards
On 2017-10-13, Chris Angelico wrote: [regarding PHP vs Python capable web-hosting services] > Thing is, that's exactly the same for both languages these days. You > can get cheap (even zero-dollar) hosting that's preconfigured to be > able to support either. There USED to be a

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 8:42 AM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: >>> Chris Angelico writes: I abbreviated that down to nothing, but

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Ben Bacarisse
Chris Angelico writes: > On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >>> I abbreviated that down to nothing, but since you ask, here's a really >>> REALLY simple run-down of how to use Heroku: >> >>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 15:39, Steve D'Aprano wrote: On Fri, 13 Oct 2017 11:54 pm, Gregory Ewing wrote: Neil Cerutti wrote: I can tell at a glance if a parameter is expected to be modifiable just by looking at the function signature. The question is why doesn't anyone feel the need to be able to do

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 15:11, alister wrote: > On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >> Steve D'Aprano wrote: >>> I wasn't questioning where the data came from, but how the compiler can >>> write to READ ONLY MEMORY which might not even be in the same

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 6:32 AM, Peter J. Holzer wrote: > On 2017-10-13 14:51, Chris Angelico wrote: >> On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano >> wrote: >>> It seems to me that you're not talking about ROM at all, but

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 15:28, Steve D'Aprano wrote: > On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: >>> It's just a technique, like greying out certain menu options - clicking >>> them will do nothing, but you won't get an error message and you don't want >>> to allow

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 14:51, Chris Angelico wrote: > On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano > wrote: >> It seems to me that you're not talking about ROM at all, but ordinary RAM. >> Then what do you mean by "read only"? A block of memory with a flag

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Neil Cerutti
On 2017-10-13, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 11:54 pm, Gregory Ewing wrote: > >> Neil Cerutti wrote: >>> I can tell at a glance if a parameter is expected to be >>> modifiable just by looking at the function signature. >> >> The question is why doesn't

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread ROGER GRAYDON CHRISTMAN
On Sat, Oct 14, 2017, Gregory Ewing wrote: > Message: 5 >Date: Sat, 14 Oct 2017 01:54:49 +1300 >From: Gregory Ewing >To: python-list@python.org >Subject: Re: Lies in education [was Re: The "loop and a half"] >Message-ID:

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
alister : > On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >> I thought it would be fairly obvious that by "put it in read-only >> memory" I meant "arrange for it to be in a location that is read-only >> at run time". Obviously it can't be read-only at

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 16:33, Steve D'Aprano wrote: On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: For a novice, seeing 'Segmentation fault (core dumped)' is better? Better than silently doing nothing? YES. Absolutely it is. Chris, you forget that for Bart, his user-base is only himself. If he

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: >> For a novice, seeing 'Segmentation fault (core dumped)' is better? > > Better than silently doing nothing? YES. Absolutely it is. Chris, you forget that for Bart, his user-base is only himself. If he programs his home-made system to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: >> It's just a technique, like greying out certain menu options - clicking >> them will do nothing, but you won't get an error message and you don't want >> to allow them anyway, risking more serious consequences. > > Even there, you often CAN

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 15:59, Julien Salort wrote: Le 12/10/2017 à 17:57, bartc a écrit : With a const struct, you are stopped from directly modifying elements, but if an element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread alister via Python-list
On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: > Steve D'Aprano wrote: >> I wasn't questioning where the data came from, but how the compiler can >> write to READ ONLY MEMORY which might not even be in the same continent >> as the compiler that generated the code. > > I thought it

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Julien Salort
Le 12/10/2017 à 17:57, bartc a écrit : With a const struct, you are stopped from directly modifying elements, but if an element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've going to have problems doing normal

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano wrote: > It seems to me that you're not talking about ROM at all, but ordinary RAM. > Then what do you mean by "read only"? A block of memory with a flag that > says "unprivileged processes are prohibited from writing

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 11:54 pm, Gregory Ewing wrote: > Neil Cerutti wrote: >> I can tell at a glance if a parameter is expected to be >> modifiable just by looking at the function signature. > > The question is why doesn't anyone feel the need to be > able to do that for Python functions? Whether

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 11:48 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> I wasn't questioning where the data came from, but how the compiler can >> write to READ ONLY MEMORY which might not even be in the same continent as >> the compiler that generated the code. > > I thought it would be

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
bartc : > But what about the poor user reading the code? Or can that now only be > done with the aid or a browser that analyses 100,000 lines and applies > that same algorithm? > > We mustn't forget the person writing the code, who may have a certain > type in mind for X, but

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 12:51 AM, bartc wrote: > On 13/10/2017 14:16, Chris Angelico wrote: >> >> On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: >>> >>> Even if data is actually in write-protected memory, attempts to write to >>> it >>> will cause a crash. On my

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 14:22, Marko Rauhamaa wrote: BTW, the original reason for C requiring declarations in the first place wasn't readability. Rather, it was to make compilation possible in the first place. It is interesting that C++ and Java have taken steps to remove such information where the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
Paul Moore : > To put it another way, in C const is a property of the variable being > declared, not the value assigned to it. In Python, variables aren't > declared, and constness is an inherent property of the value (or its > type). One interesting question which this does

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Paul Moore
On 13 October 2017 at 13:54, Gregory Ewing wrote: > Neil Cerutti wrote: >> >> I can tell at a glance if a parameter is expected to be >> modifiable just by looking at the function signature. > > > The question is why doesn't anyone feel the need to be > able to do

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 14:16, Chris Angelico wrote: On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: Even if data is actually in write-protected memory, attempts to write to it will cause a crash. On my home-made system, they just did nothing. Much more graceful. The novice thinks his

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
Gregory Ewing : > Neil Cerutti wrote: >> I can tell at a glance if a parameter is expected to be modifiable >> just by looking at the function signature. > > The question is why doesn't anyone feel the need to be able to do that > for Python functions? Whether a

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: > Even if data is actually in write-protected memory, attempts to write to it > will cause a crash. On my home-made system, they just did nothing. Much more > graceful. The novice thinks his job is to stop the program from crashing.

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 12:49, Peter J. Holzer wrote: On 2017-10-13 10:37, Steve D'Aprano wrote: or written by a dedicated hardware device: https://en.wikipedia.org/wiki/Programmable_read-only_memory And in this case there will be a tool which will read the object file

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Neil Cerutti wrote: I can tell at a glance if a parameter is expected to be modifiable just by looking at the function signature. The question is why doesn't anyone feel the need to be able to do that for Python functions? Whether a function modifies things passed to it is just as important to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: I wasn't questioning where the data came from, but how the compiler can write to READ ONLY MEMORY which might not even be in the same continent as the compiler that generated the code. I thought it would be fairly obvious that by "put it in read-only memory" I meant

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 10:37, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 05:16 pm, Gregory Ewing wrote: >> Steve D'Aprano wrote: >>> On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: >>> If the compiler can tell where p is initially pointing, it could put the pointer

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
Marko Rauhamaa : > bartc : >> 'const' tries to do too many things, most of them poorly, although it >> does a very good job at adding clutter. > > +1 However, I do my best to honor "const" since it's there. I'm even more Catholic than the Pope and declare:

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
"Peter J. Holzer" : > On 2017-10-13 05:28, Gregory Ewing wrote: >> Not only does "byte" not always mean "8 bits", but >> "char" isn't always short for "character"... > > True. Well, it does, in my universe. That was cast in stone 10**-32 seconds

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
bartc : > 'const' tries to do too many things, most of them poorly, although it > does a very good job at adding clutter. +1 Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 05:16 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: >> >>>If the compiler can tell where p is initially pointing, it could >>>put the pointer in read-only memory. >> >> If it's read-only, how can the compiler write to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 07:16, Gregory Ewing wrote: Steve D'Aprano wrote: On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: If the compiler can tell where p is initially pointing, it could put the pointer in read-only memory. If it's read-only, how can the compiler write to it? (I come from the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 05:28, Gregory Ewing wrote: > Grant Edwards wrote: >> On 2017-10-13, Stefan Ram wrote: >>> 1 byte >>> >>> addressable unit of data storage large enough to hold >>> any member of the basic character set of the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Chris Angelico wrote: Certainly not. A byte would be 21 bits! Only if 21 bits were *also* an addressable unit of storage in addition to octets. That would be an interesting architecture indeed. If you really wanted that, it might be easier just to make the memory bit-addressable. In which

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: If the compiler can tell where p is initially pointing, it could put the pointer in read-only memory. If it's read-only, how can the compiler write to it? (I come from the days when ROM was actual ROM, burned in at the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 4:28 PM, Gregory Ewing wrote: > Grant Edwards wrote: >> >> On 2017-10-13, Stefan Ram wrote: >> >>> 1 byte >>> >>> addressable unit of data storage large enough to hold >>> any member of the basic

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Gregory Ewing
Grant Edwards wrote: On 2017-10-13, Stefan Ram wrote: 1 byte addressable unit of data storage large enough to hold any member of the basic character set of the execution environment« ISO C standard Hmmm. So an architecture with memory

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 4:16 PM, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: > >> If the compiler can tell where p is initially pointing, it could >> put the pointer in read-only memory. > > If it's read-only, how can the compiler write

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Steve D'Aprano
On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: > If the compiler can tell where p is initially pointing, it could > put the pointer in read-only memory. If it's read-only, how can the compiler write to it? (I come from the days when ROM was actual ROM, burned in at the factory.) --

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Gregory Ewing
Grant Edwards wrote: It sure was an education the first I wrote C code for a machine where 1 == sizeof char == sizeof int == sizeof long == sizeof float == sizeof double All were 32 bits. Unicode-ready -- way ahead of its time! -- Greg --

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Gregory Ewing
Stefan Ram wrote: void i_know_i_was_passed_a_pointer_to_an_array_and_how_many_elements_are_in_it ( char( *a )[ 4 ] ) { for( int i = 0; i < 4; ++i ) putchar( ( *a )[ i ]); } Only because you've statically made the array size part of the type. Your original example didn't do that; presumably

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Gregory Ewing
bartc wrote: (2) Declare data to be put into read-only memory as you say. That's fine with a 'const int * p', but what about a 'int * const p'? If the compiler can tell where p is initially pointing, it could put the pointer in read-only memory. Probably unlikely to happen in real code,

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-13, Stefan Ram wrote: > Grant Edwards writes: There is no such >>thing as a "byte" in C. > > »3.6 > > 1 byte > > addressable unit of data storage large enough to hold > any member of the basic character set

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-12, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 02:06 am, Grant Edwards wrote: > >> It sure was an education the first I wrote C code for >> a machine where >> >> 1 == sizeof char == sizeof int == sizeof long == sizeof float == sizeof >> double >> >> All

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: > Chris Angelico writes: >> I abbreviated that down to nothing, but since you ask, here's a really >> REALLY simple run-down of how to use Heroku: > > I think I see what you mean now. You meant no

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Steve D'Aprano
On Fri, 13 Oct 2017 02:06 am, Grant Edwards wrote: > It sure was an education the first I wrote C code for > a machine where > > 1 == sizeof char == sizeof int == sizeof long == sizeof float == sizeof > double > > All were 32 bits. Does that imply that on that machine 1 byte = 32 bits? I

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-12 Thread Ben Bacarisse
Chris Angelico writes: > On Fri, Oct 13, 2017 at 1:09 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote: On 2017-10-12 07:31, Chris Angelico wrote: >

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Ben Bacarisse
Jon Ribbens writes: > On 2017-10-12, Ben Bacarisse wrote: >> I see. If I'm reading this right, the app requests are passed through >> to another server -- uWSGI. > > Yes. It doesn't have to be uWSGI; it could be gunicorn, or you could > probably

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread MRAB
On 2017-10-12 03:47, ROGER GRAYDON CHRISTMAN wrote: Actually, FORTRAN and COBOL and Algol (for its control structures) Trying to support both of the first two was entertaining -- when you declared a variable, it wasn't enough to say it was an Integer: you had to also declare whether it was

Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 1:09 AM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote: >>> On 2017-10-12 07:31, Chris Angelico wrote: On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Jon Ribbens
On 2017-10-12, Ben Bacarisse wrote: > I see. If I'm reading this right, the app requests are passed through > to another server -- uWSGI. Yes. It doesn't have to be uWSGI; it could be gunicorn, or you could probably use Apache's mod_fcgid. As a last resort you could use

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Ben Bacarisse
Thomas Jollans writes: > On 2017-10-12 15:16, Ben Bacarisse wrote: >> Gregory Ewing writes: >> >>> Ben Bacarisse wrote: That's a different type. I think you mean that a human writing C (rather than bartc's code generator) would probably

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-12, Rhodri James wrote: > On 12/10/17 16:06, Grant Edwards wrote: >> On 2017-10-12, Steve D'Aprano wrote: >>> On Thu, 12 Oct 2017 04:41 pm, Grant Edwards wrote: >>> > Even two different C compilers could return different values.

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Ben Bacarisse
Jon Ribbens writes: > On 2017-10-12, Ben Bacarisse wrote: >> Chris Angelico writes: >>> Normally, with a Python-based framework, you don't need _any_ web >>> server configuration. You simply define your URL routing within the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread bartc
On 12/10/2017 16:18, Marko Rauhamaa wrote: Grant Edwards : Using const with strings in C with amateurish libraries is a headache because _some_people_ will write their declarations so as to require pointers to mutable strings even when they have no intention of

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Rhodri James
On 12/10/17 16:06, Grant Edwards wrote: On 2017-10-12, Steve D'Aprano wrote: On Thu, 12 Oct 2017 04:41 pm, Grant Edwards wrote: Even two different C compilers could return different values. Nope. If sizeof char is not 1, then it's not C. Today I Learned.

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-12, Marko Rauhamaa wrote: > Grant Edwards : > >> Using const with strings in C with amateurish libraries is a headache >> because _some_people_ will write their declarations so as to require >> pointers to mutable strings even when they have

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Marko Rauhamaa
Grant Edwards : > Using const with strings in C with amateurish libraries is a headache > because _some_people_ will write their declarations so as to require > pointers to mutable strings even when they have no intention of > mutating them. Those people should be

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Thomas Jollans
On 2017-10-12 15:16, Ben Bacarisse wrote: > Gregory Ewing writes: > >> Ben Bacarisse wrote: >>> That's a different type. I think you mean that a human writing C >>> (rather than bartc's code generator) would probably design the code to >>> use tokenrec ** then I

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-12, Steve D'Aprano wrote: > On Thu, 12 Oct 2017 04:41 pm, Grant Edwards wrote: > > >>> Even two >>> different C compilers could return different values. >> >> Nope. If sizeof char is not 1, then it's not C. > > Today I Learned. It sure was an education

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-12, Marko Rauhamaa wrote: > Chris Angelico : > >> On Thu, Oct 12, 2017 at 6:22 PM, Marko Rauhamaa wrote: >>> Additionally, you can launder any constant string into a nonconstant >>> string with strstr(3): >>> >>> const char *cs

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Grant Edwards
On 2017-10-12, Neil Cerutti wrote: > On 2017-10-12, Marko Rauhamaa wrote: >> Bill : >> >>> Marko Rauhamaa wrote: One example is the surprising fact that string literals in C are "char *" and not "const char *". Yep, that's

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Jon Ribbens
On 2017-10-12, Ben Bacarisse wrote: > Chris Angelico writes: >> Normally, with a Python-based framework, you don't need _any_ web >> server configuration. You simply define your URL routing within the >> Python code. The only thing the web server needs to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Steve D'Aprano
On Thu, 12 Oct 2017 11:01 pm, Stefan Ram quoted: > Basically I got sick of every single > aspect of C++ being designed around higher performance > instead of my productivity. Unlike C, where every single aspect of the language is designed around higher performance instead of the developer's

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Ben Bacarisse
Chris Angelico writes: > On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote: >> On 2017-10-12 07:31, Chris Angelico wrote: >>> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse >>> wrote: Provided some early part of the URL is

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Thomas Jollans
On 2017-10-12 14:01, Stefan Ram wrote: > Many of the quotations are from the previous decade. Thanks Stefan, that was fun. > I must say that C++ has improved in this decade (the 2010s), > and there also is a rennaisance of C and C++ (compared to > "coffee languages") usage because

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Neil Cerutti
On 2017-10-12, Marko Rauhamaa wrote: > Bill : > >> Marko Rauhamaa wrote: >>> One example is the surprising fact that string literals in C >>> are "char *" and not "const char *". >> >> If not, you couldn't pass a string literal to a function >> having

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Neil Cerutti
On 2017-10-11, Gregory Ewing wrote: > Neil Cerutti wrote: >> I dig const qualifiers, even though I'm comletely fine with >> their absence from Python. > > Out of curiosity, do you have any insights into why you like > them in C++, if you don't miss them in Python? I

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Ben Bacarisse
Gregory Ewing writes: > Ben Bacarisse wrote: >> That's a different type. I think you mean that a human writing C >> (rather than bartc's code generator) would probably design the code to >> use tokenrec ** then I agree, but the latter is not just a different way >>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Marko Rauhamaa
Chris Angelico : > On Thu, Oct 12, 2017 at 8:20 PM, Marko Rauhamaa wrote: >> BTW, C++ tries to be a bit stricter about "const". It declares two >> separate prototypes: >> >>const char *strstr(const char *, const char *); >>char *strstr(char *, const

Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-12 Thread breamoreboy
On Thursday, October 12, 2017 at 12:33:09 PM UTC+1, Chris Angelico wrote: > On Thu, Oct 12, 2017 at 8:12 PM, Thomas Jollans wrote: > > On 2017-10-12 02:51, Chris Angelico wrote: > >> If it wants new life, it's probably going to need a Linux version, > >> because that's where a lot of developers

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Steve D'Aprano
On Thu, 12 Oct 2017 04:41 pm, Grant Edwards wrote: >> Even two >> different C compilers could return different values. > > Nope. If sizeof char is not 1, then it's not C. Today I Learned. Thank you to everyone who corrected me, even the person who said I was not educated. -- Steve

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread bartc
On 12/10/2017 11:39, Stefan Ram wrote: bartc writes: (1) Define named constants; except (in C) they can't be used like constant expressions, you can take their addresses, and accidentally or maliciously change their values. When I think of »const«, I do not think of ROM.

Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 8:12 PM, Thomas Jollans wrote: > On 2017-10-12 02:51, Chris Angelico wrote: >> If it wants new life, it's probably going to need a Linux version, >> because that's where a lot of developers hang out. The reality is that >> open source developers are much more

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 8:20 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Thu, Oct 12, 2017 at 6:22 PM, Marko Rauhamaa wrote: >>> Additionally, you can launder any constant string into a nonconstant >>> string with strstr(3): >>> >>>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote: > On 2017-10-12 07:31, Chris Angelico wrote: >> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse wrote: >>> Provided some early part of the URL is handled by PHP, the rest of the >>> URL path is provided to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Ben Bacarisse
Chris Angelico writes: > On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> On Thu, Oct 12, 2017 at 11:55 AM, Ben Bacarisse >>> wrote: Chris Angelico

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Thomas Jollans
On 2017-10-12 07:31, Chris Angelico wrote: > On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse wrote: >> Provided some early part of the URL is handled by PHP, the rest of the >> URL path is provided to PHP in $_SERVER["PATH_INFO"]. > > Is it possible to do that without

  1   2   >