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

2017-10-12 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 case

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

2017-10-12 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 character set of the execution >>> environment« >>> >>>

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 addressed in octets and Unicode

Re: unorderable types: list() > int()

2017-10-12 Thread Steve D'Aprano
On Fri, 13 Oct 2017 03:23 pm, Andrew Z wrote: > Hello, > pos = {"CLown":10,"BArbie":20} > I want to return integer (10) for the keyword that starts with "CL" > > > cl_ = [v for k, v in pos.items() if k.startswith('CL')] > cl_pos = cl_[0] > if cl_pos > 0: > >blah.. > > > There are 2 issues

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 to it? > > > (I come from the

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.) -- Ste

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 -- https://mail.python.org/mailman/listinfo/python-list

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 it

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, though.

unorderable types: list() > int()

2017-10-12 Thread Andrew Z
Hello, pos = {"CLown":10,"BArbie":20} I want to return integer (10) for the keyword that starts with "CL" cl_ = [v for k, v in pos.items() if k.startswith('CL')] cl_pos = cl_[0] if cl_pos > 0: blah.. There are 2 issues with the above: a. ugly - cl_pos = cl_ [0] . I was thinking something

Running flask on AWS SAM

2017-10-12 Thread Frustrated learner
Hello, I have a flask based application which i am able to run locally. $ python swagger_server/app.py * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) I am trying to port this over to aws. I have all the dependencies and code organized in the same folder. Here is the transaction and

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 of the execution > environment« > > ISO C st

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread sohcahtoa82
On Thursday, October 12, 2017 at 1:08:55 AM UTC-7, T Obulesu wrote: > Hello all, I want to send some frames defined by me{Example, > [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other > raspberry pi). But I want to send those frames over wifi or use wlan0 using > python A

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 were 32 bits. > > > Does that

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 configuration is needed > because you use (o

Re: Cooperative class tree filtering

2017-10-12 Thread Alberto Berti
Sorry, i've made a mistake in the second C body, it's written like: > "me" == Alberto Berti writes: me> I've tried some variants of the 'super()' trick, that sometimes seems to me> change behavior if it's written like that or like super(type(self), me> self) in no clear (to me,

Solution Manual Test Bank for Financial and Managerial Accounting for MBAs 5th Edition by Easton

2017-10-12 Thread totah1234
Greetings Students, We do have Solution Manuals and Test Bank for FINANCIAL AND MANAGERIAL ACCOUNTING FOR MBAs 5TH EDITION BY EASTON at reasonable price. You can get above mentioned resources by sending email to pro.fast(@)hotmail(dot)com Send your order queries at PRO.FAST(@)HOTMAIL(DOT)COM

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 don'

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: > On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse > wrote: >> Pro

Cooperative class tree filtering

2017-10-12 Thread Alberto Berti
Hello, suppose you have you have three classes A, B, C where C is a subclass of B and B of A. They provide a method with signature `filter(element)`. It is called by an external function that collects the elements and then to an instance of the classes A, B and C is given a chance to filter these

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 use Apache's mod_fcgid. As a last resort you coul

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 repres

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 wrote: > Provided some early part of the URL i

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 CGI, which wouldn't invol

Re: Python-list Digest, Vol 169, Issue 23

2017-10-12 Thread ROGER GRAYDON CHRISTMAN
The opinions I give in this post are not as strong as the opinions I expressed before about the loop claiming to count all the way to 2**64. But I'll give them anyway. I don't mind having return's inside an if statement, when the function ends with that if statement. It becomes very clear then

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 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, 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. Nope. If sizeof char is not 1, then it's n

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 >>> Python code. The only thing the web server needs to know is where

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 mutating them. Those people shoul

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. It sure was an education the f

Re: Python-list Digest, Vol 169, Issue 23

2017-10-12 Thread ROGER GRAYDON CHRISTMAN
On Thu, Oct 12, 2017 08:05 AM, Steve D'Aprano wrote:> On Wed, 11 Oct 2017 10:57 pm, Stefan Ram wrote: > >> FWIW, in is book "Touch of Class" (2009) Bertrand >Meyer writes: >> >> |Such instructions are just the old goto in sheep's clothing. >> |Treat them the same way as the original: >> | >> |/To

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 no intention of >> mutating them. Those peopl

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 hunted down and slapped with a >

Re: Logging from files doesn't work

2017-10-12 Thread Andrew Z
Cameron, Peter, Thank you. Your comments were spot on. Changing root logger got the logs spitting into the file. And i now can org these logs into one directory, instead of the current mess. Thank you! On Oct 11, 2017 23:41, "Cameron Simpson" wrote: > On 11Oct2017 22:27, Andrew Z wrote: > >>

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread Grant Edwards
On 2017-10-12, Chris Angelico wrote: > On Thu, Oct 12, 2017 at 7:08 PM, T Obulesu wrote: >> Hello all, I want to send some frames defined by me{Example, >> [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other >> raspberry pi). But I want to send those frames over wifi or u

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 agree, but the latter is not just

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 the first I wrote C code for a

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 = "hello"; >>> char *s = strstr(cs, ""); >>> s

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 the basis for a lot of the problems with 'const' in C. Unfortun

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 know is where to >> find the web app, and

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 produ

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 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 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 single-

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 prototype void f(char *s); > > That *ought* to

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 can tell at a glance if a para

Re: how to replace multiple char from string and substitute new char

2017-10-12 Thread ROGER GRAYDON CHRISTMAN
On Thu, Oct 12, 2017, Iranna Mathapati wrote: > >Hi Team, > > >How to replace multipal char from string and substitute with new char with >one line code > >Ex: > >str = "9.0(3)X7(2) " ===> 9.0.3.X7.2 > >need to replace occurrence of '(',')' with dot(.) chars > >output: > > 9.0.3.X7.\

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 >> to write the former. > > Yes,

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 char *); >> >> http://www.cplusplus.com

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 han

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread T Obulesu
On Thursday, 12 October 2017 13:38:55 UTC+5:30, T Obulesu wrote: > Hello all, I want to send some frames defined by me{Example, > [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other > raspberry pi). But I want to send those frames over wifi or use wlan0 using > python Any

Re: how to replace maltipal char from string and substitute new char

2017-10-12 Thread breamoreboy
On Thursday, October 12, 2017 at 10:46:03 AM UTC+1, Iranna Mathapati wrote: > Hi Team, > > > How to replace multipal char from string and substitute with new char with > one line code > > Ex: > > str = "9.0(3)X7(2) " ===> 9.0.3.X7.2 > > need to replace occurrence of '(',')' with dot(

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 “Cheer

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. »const« makes

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 likely to deve

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): >>> >>> const char *cs = "hello"; >>> char *s = strstr(

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 PHP in $_SERVER["PATH_INFO"]. >> >>

Why the CLI hang using pyjwt ?

2017-10-12 Thread will
Not sure why the CLI command "pyjwt decode --no-verify ..." will hang at sys.stdin.read() even though I provided all the input. Any ideas on how to work around the problem? $ pyjwt -v pyjwt 1.5.3 $ pyjwt decode --no-verify eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5N

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 writes: > it binds your URLs to > the concrete file system. That may not seem like too much

FW: Printing to a file and a terminal at the same time

2017-10-12 Thread Lie Ryan
It wouldn't be too difficult to write a file object wrapper that emulates tee, for instance (untested): class tee(object): def __init__(self, file_objs, autoflush=True): self._files = file_objs self._autoflush = autoflush def write(self, buf): for f in self._files

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 having ".php" visible in the

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

2017-10-12 Thread bartc
On 12/10/2017 06:39, Grant Edwards wrote: 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?

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

2017-10-12 Thread bartc
On 12/10/2017 09:23, Christian Gollwitzer wrote: Am 12.10.17 um 01:15 schrieb Stefan Ram:    Define a function »g« with a parameter »x« of type »int«, so    that this function »g« returns a pointer to another function.    This other function has a parameter of type »char« and returns    a double

how to replace maltipal char from string and substitute new char

2017-10-12 Thread Iranna Mathapati
Hi Team, How to replace multipal char from string and substitute with new char with one line code Ex: str = "9.0(3)X7(2) " ===> 9.0.3.X7.2 need to replace occurrence of '(',')' with dot(.) chars output: 9.0.3.X7.2 Thanks, -- https://mail.python.org/mailman/listinfo/python-list

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 6:22 PM, Marko Rauhamaa wrote: >> Additionally, you can launder any constant string into a nonconstant >> string with strstr(3): >> >> const char *cs = "hello"; >> char *s = strstr(cs, ""); >> s[0] = 'y'; > > Well hey, if you want that, you c

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

2017-10-12 Thread Thomas Jollans
On 2017-10-12 01:33, Chris Angelico wrote: > Have you seen a city that grew one house at a time, and had > streets added to service those houses? Not good. Actually, that's more or less how most cities grew historically. Nowadays these organically grown city centres tend to be much more people-fri

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

2017-10-12 Thread Marko Rauhamaa
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 > prototype void f(char *s); That *ought* to be prevented. That's the whole point. Marko --

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

2017-10-12 Thread Thomas Jollans
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 likely to develop on Linux than > on Windows; you can maintain a Windows po

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

2017-10-12 Thread Thomas Jollans
On 2017-10-12 01:32, Christopher Reimer wrote: > On Oct 11, 2017, at 9:07 AM, Bill wrote: >> >> Grant Edwards wrote: >>> On 2017-10-11, Bill wrote: >>> >>> [...] I'm not here to "cast stones", I like Python. I just think that you shouldn't cast stones at C/C++. >>> Not while PHP exists.

Re: Logging from files doesn't work

2017-10-12 Thread Peter Otten
Andrew Z wrote: > Hello, > > apparently my reading comprehension is nose diving these days. After > reading python cookbook and a few other tutorials i still can't get a > simple logging from a few files to work. > I suspected my file organization - all files are in the same directory, > causing

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

2017-10-12 Thread Christian Gollwitzer
Am 12.10.17 um 01:15 schrieb Stefan Ram: Define a function »g« with a parameter »x« of type »int«, so that this function »g« returns a pointer to another function. This other function has a parameter of type »char« and returns a double value. Ok /Without/ a typedef. And WHY

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 7:08 PM, T Obulesu wrote: > Hello all, I want to send some frames defined by me{Example, > [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other > raspberry pi). But I want to send those frames over wifi or use wlan0 using > python Any suggestions? >

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread Tim Golden
On 12/10/2017 09:08, T Obulesu wrote: Hello all, I want to send some frames defined by me{Example, [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other raspberry pi). But I want to send those frames over wifi or use wlan0 using python Any suggestions? Are you talking abou

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

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 6:22 PM, Marko Rauhamaa wrote: > Grant Edwards : > >> I like [const qualifiers] in C because it allows the linker to place >> them in ROM with the code. It also _sometimes_ provides useful >> diagnostics when you pass a pointer to something which shouldn't be >> modified to

Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread T Obulesu
Hello all, I want to send some frames defined by me{Example, [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other raspberry pi). But I want to send those frames over wifi or use wlan0 using python Any suggestions? -- https://mail.python.org/mailman/listinfo/python-list

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

2017-10-12 Thread Bill
Marko Rauhamaa wrote: Grant Edwards : I like [const qualifiers] in C because it allows the linker to place them in ROM with the code. It also _sometimes_ provides useful diagnostics when you pass a pointer to something which shouldn't be modified to something that is going to try to modify it.

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

2017-10-12 Thread Marko Rauhamaa
Grant Edwards : > I like [const qualifiers] in C because it allows the linker to place > them in ROM with the code. It also _sometimes_ provides useful > diagnostics when you pass a pointer to something which shouldn't be > modified to something that is going to try to modify it. Unfortunately, "