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
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
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«
>>>
>>>
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
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
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
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
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
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
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.
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
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
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
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
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
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
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,
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
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'
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>
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:
>
>>
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
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
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
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
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
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
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
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
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-
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
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
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.\
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,
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
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
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
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(
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
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
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
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(
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"].
>>
>>
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
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
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
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
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?
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
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
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
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
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
--
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
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.
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
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
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?
>
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
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
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
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.
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, "
77 matches
Mail list logo