Thu Nov 21 23:07:56 2024
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2016-12-01

LEARN

2024-11-21 | 2024-10-21 | 2024-09-21 | 2024-08-21 | 2024-07-21 | 2024-06-21 | 2024-05-21 | 2024-04-21 | 2024-03-21 | 2024-02-21 | 2024-01-21 | 2023-12-21 | 2023-11-21 | 2023-10-21 | 2023-09-21 | 2023-08-21 | 2023-07-21 | 2023-06-21 | 2023-05-21 | 2023-04-21 | 2023-03-21 | 2023-02-21 | 2023-01-21 | 2022-12-21 | 2022-11-21 | 2022-10-21 | 2022-09-21 | 2022-08-21 | 2022-07-21 | 2022-06-21 | 2022-05-21 | 2022-04-21 | 2022-03-21 | 2022-02-21 | 2022-01-21 | 2021-12-21 | 2021-11-21 | 2021-10-21 | 2021-09-21 | 2021-08-21 | 2021-07-21 | 2021-06-21 | 2021-05-21 | 2021-04-21 | 2021-03-21 | 2021-02-21 | 2021-01-21 | 2020-12-21 | 2020-11-21 | 2020-10-21 | 2020-09-21 | 2020-08-21 | 2020-07-21 | 2020-06-21 | 2020-05-21 | 2020-04-21 | 2020-03-21 | 2020-02-21 | 2020-01-21 | 2019-12-21 | 2019-11-21 | 2019-10-21 | 2019-09-21 | 2019-08-21 | 2019-07-21 | 2019-06-21 | 2019-05-21 | 2019-04-21 | 2019-03-21 | 2019-02-21 | 2019-01-21 | 2018-12-21 | 2018-11-21 | 2018-10-21 | 2018-09-21 | 2018-08-21 | 2018-07-21 | 2018-06-21 | 2018-05-21 | 2018-04-21 | 2018-03-21 | 2018-02-21 | 2018-01-21 | 2017-12-21 | 2017-11-21 | 2017-10-21 | 2017-09-21 | 2017-08-21 | 2017-07-21 | 2017-06-21 | 2017-05-21 | 2017-04-21 | 2017-03-21 | 2017-02-21 | 2017-01-21 | 2016-12-21 | 2016-11-21 | 2016-10-21 | 2016-09-21 | 2016-08-21 | 2016-07-21 | 2016-06-21 | 2016-05-21 | 2016-04-21 | 2016-03-21 | 2016-02-21 | 2016-01-21 | 2015-12-21 | 2015-11-21 | 2015-10-21 | 2015-09-21 | 2015-08-21 | 2015-07-21 | 2015-06-21 | 2015-05-21 | 2015-04-21 | 2015-03-21 | 2015-02-21 | 2015-01-21 | 2014-12-21 | 2014-11-21 | 2014-10-21

Key: Value:

Key: Value:

MESSAGE
DATE 2016-12-08
FROM ruben safir
SUBJECT Subject: [Learn] Fwd: png data format
From learn-bounces-at-nylxs.com Thu Dec 8 21:50:58 2016
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82])
by mrbrklyn.com (Postfix) with ESMTP id 9E88E161312;
Thu, 8 Dec 2016 21:50:57 -0500 (EST)
X-Original-To: learn-at-nylxs.com
Delivered-To: learn-at-nylxs.com
Received: from [10.0.0.62] (flatbush.mrbrklyn.com [10.0.0.62])
by mrbrklyn.com (Postfix) with ESMTP id 08AE0160E77
for ; Thu, 8 Dec 2016 21:50:51 -0500 (EST)
References:

<584716ab$0$21452$e4fe514c-at-news.xs4all.nl>


<81th4ctdjpud70gbud62m567f3f1djvfi1-at-4ax.com>
<87eg1ivq45.fsf-at-gmail.com>

<87pol2w5qv.fsf-at-gmail.com>

To: learn-at-nylxs.com
From: ruben safir
X-Forwarded-Message-Id:


<584716ab$0$21452$e4fe514c-at-news.xs4all.nl>


<81th4ctdjpud70gbud62m567f3f1djvfi1-at-4ax.com> <87eg1ivq45.fsf-at-gmail.com>


<87pol2w5qv.fsf-at-gmail.com>

Message-ID: <1b7477de-91e7-73a6-3809-d8c56687b34c-at-mrbrklyn.com>
Date: Thu, 8 Dec 2016 21:50:51 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
MIME-Version: 1.0
In-Reply-To:
Content-Type: multipart/mixed; boundary="------------C0BA4D4F3CF0D9F9AA2CFCA3"
Subject: [Learn] Fwd: png data format
X-BeenThere: learn-at-nylxs.com
X-Mailman-Version: 2.1.17
Precedence: list
List-Id:
List-Unsubscribe: ,

List-Archive:
List-Post:
List-Help:
List-Subscribe: ,

Errors-To: learn-bounces-at-nylxs.com
Sender: "Learn"

This is a multi-part message in MIME format.
--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

endian

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="png data format.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.lang.c++
Subject: png data format
Date: Tue, 6 Dec 2016 09:05:41 -0500
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1481033141 29095 96.57.23.82 (6 Dec 2016 14:05:41 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Tue, 6 Dec 2016 14:05:41 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
Xref: panix comp.lang.c++:1125854

Hello

I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump

0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141

I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk


done reading header



Sizeof Chunk 4
Raw Chunk Number 0: 218103808
***LENGTH****
Length value => 218103808
Sizeof Byte 1
Character 0::
^-at-
Byte 0::
0
Character 1::
^-at-
Byte 1::
0
Character 2::
^-at-
Byte 2::
0
Character 3::

Byte 3::
13


As yet, when I break it down by single bytes, it returns 0 0 0 13, which is correct.
ddd seems to say the same thing, and I don't know why. When evaluated as 4 bytes,
you get this large number, but when you evaluate them seperately, each byte, it
comes out right.

The code snippet I'm using looks like this

in the .h file
#ifndef PNGPRJ
#define PNGPRJ
#include
namespace png_proj{
typedef uint32_t CHUNK;



In the .cpp file
void Image::read_chunk()
{
char * cur = get_index();
CHUNK * tmp = reinterpret_cast(cur);
std::cout << std::endl << "Sizeof Chunk " << sizeof(*tmp) << std::endl;
for(int j = 0; j<4; j++){
std::cout << "Raw Chunk Number " << j << ": " << *tmp << std::endl;


switch ( j ) {
case 0:
std::cout << "***LENGTH****" << std::endl;
set_length(static_cast(*tmp));
std::cout << "Length value => " << static_cast(*tmp) << std::endl;
break;

case 1:
std::cout << "***TYPE****" << std::endl;
set_type(static_cast(*tmp));
break;

case 2:
{
std::cout << "***DATA****" << std::endl;
unsigned long int l = static_cast(get_length());
std::cout << "buffer size should be " << get_length() << std::endl;
int8_t * buffer = new int8_t[l];
std::cout << "buffer element size is " << *buffer << std::endl;
std::cout << "buffer size is " << l << std::endl;
for(unsigned int k = 0; k < get_length(); k++){
buffer[k] = static_cast(tmp[k]);
std::cout << "data " << *buffer << std::endl;
}
set_data(buffer);
}
break;

case 3:
std::cout << "***CRC****" << std::endl;
set_crc(static_cast(*tmp));
break;

default:
std::cout << "***NOMANDSLAND****" << std::endl;
break;
} /* ----- end switch ----- */

char * tmp2 = reinterpret_cast(tmp); //reading each byte
std::cout << "Sizeof Byte " << sizeof(*tmp2) << std::endl;
//std::cout << "Mark ==>>" << __LINE__ << std::endl;
for(int i=0; i<4; i++){
std::cout << "Character " << i << "::" << std::endl << "\t" << *tmp2 << std::endl;
std::cout << "Byte " << i << "::" << std::endl << "\t" << static_cast(*tmp2) << std::endl;
tmp2++;
}
std::cout< std::cout< tmp++;
cur = ( reinterpret_cast(tmp) );
}
set_index(cur);
}



I dug through libpng since this seems to not being doing what I expected. They seem to set it up as 4 byte array

void /* PRIVATE */
png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
{
png_uint_32 chunk_name;
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
int keep; /* unknown handling method */
#endif

/* First we make sure we have enough data for the 4-byte chunk name
* and the 4-byte chunk length before proceeding with decoding the
* chunk data. To fully decode each of these chunks, we also make
* sure we have enough data in the buffer for the 4-byte CRC at the
* end of every chunk (except IDAT, which is handled separately).
*/
if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
{
png_byte chunk_length[4];
png_byte chunk_tag[4];

PNG_PUSH_SAVE_BUFFER_IF_LT(8)
png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr);
png_crc_read(png_ptr, chunk_tag, 4);
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
}


I'm obviously not understanding something I'm evaluation here. So I'm wondering if anyone can shed light on this.
http://www.nylxs.com/docs/grad_school/parallel/src/png/png_proj.h
http://www.nylxs.com/docs/grad_school/parallel/src/png/png_proj.cpp
http://www.nylxs.com/docs/grad_school/parallel/src/png/main_png.cpp
http://www.nylxs.com/docs/grad_school/parallel/src/png/makefile

ruben

let.me.in


Ruben

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!168.235.88.217.MISMATCH!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!news.glorb.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post01.iad.highwinds-media.com!fx24.iad.POSTED!not-for-mail
X-Newsreader: xrn 9.03-beta-14-64bit
Sender: scott-at-dragon.sl.home (Scott Lurndal)
From: scott-at-slp53.sl.home (Scott Lurndal)
Reply-To: slp53-at-pacbell.net
Subject: Re: png data format
Newsgroups: comp.lang.c++
References:
Message-ID:
X-Complaints-To: abuse-at-usenetserver.com
NNTP-Posting-Date: Tue, 06 Dec 2016 15:10:34 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 06 Dec 2016 15:10:34 GMT
X-Received-Bytes: 1415
X-Received-Body-CRC: 2969986710
Xref: panix comp.lang.c++:1125858

ruben safir writes:
>Hello
>
>I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump
>
>0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
>0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
>0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141
>
>I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk
>

https://en.wikipedia.org/wiki/Endianness


--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Tue, 6 Dec 2016 13:42:12 -0500
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
References:
NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1481049732 7317 96.57.23.82 (6 Dec 2016 18:42:12 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Tue, 6 Dec 2016 18:42:12 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
In-Reply-To:
Xref: panix comp.lang.c++:1125865

On 12/06/2016 10:10 AM, Scott Lurndal wrote:
> ruben safir writes:
>> Hello
>>
>> I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump
>>
>> 0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
>> 0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
>> 0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141
>>
>> I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk
>>
>
> https://en.wikipedia.org/wiki/Endianness
>


that doesn't help

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!168.235.88.217.MISMATCH!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!news.glorb.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad.highwinds-media.com!fx36.iad.POSTED!not-for-mail
X-Newsreader: xrn 9.03-beta-14-64bit
Sender: scott-at-dragon.sl.home (Scott Lurndal)
From: scott-at-slp53.sl.home (Scott Lurndal)
Reply-To: slp53-at-pacbell.net
Subject: Re: png data format
Newsgroups: comp.lang.c++
References:
Message-ID:
X-Complaints-To: abuse-at-usenetserver.com
NNTP-Posting-Date: Tue, 06 Dec 2016 19:05:09 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 06 Dec 2016 19:05:09 GMT
X-Received-Bytes: 1778
X-Received-Body-CRC: 3109805820
Xref: panix comp.lang.c++:1125868

ruben safir writes:
>On 12/06/2016 10:10 AM, Scott Lurndal wrote:
>> ruben safir writes:
>>> Hello
>>>
>>> I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump
>>>
>>> 0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
>>> 0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
>>> 0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141
>>>
>>> I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk
>>>
>>
>> https://en.wikipedia.org/wiki/Endianness
>>
>
>
>that doesn't help

And nobody here is obligated to help you - you should learn to
help yourself, and the link referenced above should be your starting
point.

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Tue, 6 Dec 2016 14:33:37 -0500
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
References:

NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1481052817 24060 96.57.23.82 (6 Dec 2016 19:33:37 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Tue, 6 Dec 2016 19:33:37 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
In-Reply-To:
Xref: panix comp.lang.c++:1125869

On 12/06/2016 02:05 PM, Scott Lurndal wrote:
> ruben safir writes:
>> On 12/06/2016 10:10 AM, Scott Lurndal wrote:
>>> ruben safir writes:
>>>> Hello
>>>>
>>>> I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump
>>>>
>>>> 0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
>>>> 0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
>>>> 0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141
>>>>
>>>> I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk
>>>>
>>>
>>> https://en.wikipedia.org/wiki/Endianness
>>>
>>
>>
>> that doesn't help
>
> And nobody here is obligated to help you - you should learn to
> help yourself, and the link referenced above should be your starting
> point.
>

no it is not really. Like most wikipedia articles it is written poorly
and leaves of coherent details. Your under no obligation to post, if
you don't want to contribute. Being an ass isn't helpful though and
treating me like I'm stupid makes me resentful

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Subject: Re: png data format
Newsgroups: comp.lang.c++
References:


From: Luuk
Date: Tue, 6 Dec 2016 20:51:07 +0100
MIME-Version: 1.0
In-Reply-To:
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <584716ab$0$21452$e4fe514c-at-news.xs4all.nl>
NNTP-Posting-Host: 2001:980:9089:1:8995:3cb:bb61:edb8
X-Trace: 1481053867 news.xs4all.nl 21452 [2001:980:9089:1:8995:3cb:bb61:edb8]:8988
X-Complaints-To: abuse-at-xs4all.nl
Xref: panix comp.lang.c++:1125870

On 06-12-16 20:33, ruben safir wrote:
> On 12/06/2016 02:05 PM, Scott Lurndal wrote:
>> ruben safir writes:
>>> On 12/06/2016 10:10 AM, Scott Lurndal wrote:
>>>> ruben safir writes:
>>>>> Hello
>>>>>
>>>>> I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump
>>>>>
>>>>> 0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
>>>>> 0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
>>>>> 0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141
>>>>>
>>>>> I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk
>>>>>
>>>>
>>>> https://en.wikipedia.org/wiki/Endianness
>>>>
>>>
>>>
>>> that doesn't help
>>
>> And nobody here is obligated to help you - you should learn to
>> help yourself, and the link referenced above should be your starting
>> point.
>>
>
> no it is not really. Like most wikipedia articles it is written poorly
> and leaves of coherent details. Your under no obligation to post, if
> you don't want to contribute. Being an ass isn't helpful though and
> treating me like I'm stupid makes me resentful
>

Basically the wikipeadia page explains what is stated in the docs here:
http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html#DR.Integers-and-byte-order



--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Tue, 6 Dec 2016 21:41:26 +0100
Organization: A noiseless patient Spider
Message-ID:
References:


Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 6 Dec 2016 20:40:06 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="2764c034fbe3b7eaac2ca94b836abdc9";
logging-data="7508"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX1/Lirx6Plh4L5ya04CBcF9kdBgayiDkrbU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.4.0
In-Reply-To:
Cancel-Lock: sha1:2nKGc1OxmYMWhbSb/1z8OzmLAMA=
Xref: panix comp.lang.c++:1125871

On 06/12/16 20:33, ruben safir wrote:
> On 12/06/2016 02:05 PM, Scott Lurndal wrote:
>> ruben safir writes:
>>> On 12/06/2016 10:10 AM, Scott Lurndal wrote:
>>>> ruben safir writes:
>>>>> Hello
>>>>>
>>>>> I'm having trouble with this imput of data from a PNG image. The specification says that "chunks" have a 4 byte field that is the length of the attached data segment. I tried to read the length in for a chunk that has a length of 13, which was confirmed in a hexdump
>>>>>
>>>>> 0000000 211 120 116 107 015 012 032 012 -->>000 000 000 015<<-- 111 110 104 122
>>>>> 0000010 000 000 041 215 000 000 007 165 010 006 000 000 001 206 055 074
>>>>> 0000020 336 000 000 000 004 147 101 115 101 000 000 261 217 013 374 141
>>>>>
>>>>> I am storing the data in a uint32_t variable using the following code, but the value keeps showing up with a huge number 218103808 which happens to be the number that is evaluated by iostream for the value of the whole chunk
>>>>>
>>>>
>>>> https://en.wikipedia.org/wiki/Endianness
>>>>
>>>
>>>
>>> that doesn't help
>>
>> And nobody here is obligated to help you - you should learn to
>> help yourself, and the link referenced above should be your starting
>> point.
>>
>
> no it is not really. Like most wikipedia articles it is written poorly
> and leaves of coherent details. Your under no obligation to post, if
> you don't want to contribute. Being an ass isn't helpful though and
> treating me like I'm stupid makes me resentful
>

The Wikipedia article there is reasonably written, and full of useful
information. But you may not have made the connection as to why it is
relevant to your problem.

Numbers bigger than single bytes in computing can be stored in two basic
formats - big endian with the most significant byte first, and little
endian with the least significant byte first. Some processors use one
format, other processors use the other. Some file formats and protocols
use one format, others use the other. If the processor and the file
format do not match, then you need to convert when reading or writing
the format.

x86 uses little endian format, so 13 is stored as 0b 00 00 00 as a
32-bit integer. PNG, like many network-related formats, uses big
endian. So it stores 32-bit 13 as 00 00 00 0b. (Incidentally, use hex
for this sort of thing - octal had no place in computing outside of
"chmod" since the 1970's.)

Assuming you are trying to learn and understand this, rather than
copy-and-paste working code, then this should be enough to get you going.


--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Tue, 6 Dec 2016 17:12:21 -0500
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
References:


NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1481062341 8634 96.57.23.82 (6 Dec 2016 22:12:21 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Tue, 6 Dec 2016 22:12:21 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
In-Reply-To:
Xref: panix comp.lang.c++:1125872

On 12/06/2016 03:41 PM, David Brown wrote:
> The Wikipedia article there is reasonably written

no it isn't. But I'll show you a means of properly answering a question
like this

http://www.nylxs.com/messages.html?id=543540&archive_learn=2016-12-01


All it takes is a basic assumption that your not talking to an idiot.

Specifically that wikipedea article, and really they all suck, don't
explain how the intel hardware is set up and who to evaluate the and
learn the problem solving mechanism, so that one can learn to evaluate
these kinds of problems in the future.




--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Wed, 7 Dec 2016 23:59:24 +0100
Organization: A noiseless patient Spider
Message-ID:
References:



Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 7 Dec 2016 22:58:04 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="f8eeae0c5425ce526a34dfced8d9866b";
logging-data="15261"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX1+dB2icer7YhD/fk4WmE+exqJ4p1VKdrfI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.4.0
In-Reply-To:
Cancel-Lock: sha1:xY5EfpfC51TR+2nRakTvAoHsRAU=
Xref: panix comp.lang.c++:1125901

On 06/12/16 23:12, ruben safir wrote:
> On 12/06/2016 03:41 PM, David Brown wrote:
>> The Wikipedia article there is reasonably written
>
> no it isn't. But I'll show you a means of properly answering a question
> like this
>
> http://www.nylxs.com/messages.html?id=543540&archive_learn=2016-12-01
>
>
> All it takes is a basic assumption that your not talking to an idiot.

I don't assume you are an idiot (though your posting style does not do
wonders for the impression you give). I assume you want to learn and
understand what you are doing - otherwise you would simply use a
pre-written png library.

>
> Specifically that wikipedea article, and really they all suck, don't
> explain how the intel hardware is set up and who to evaluate the and
> learn the problem solving mechanism, so that one can learn to evaluate
> these kinds of problems in the future.
>

The Wikipedia article is about Endianness, not Intel hardware, or png
file formats. It has a clear enough explanation about what endianness
means, a bit of history and examples, some reasons for choosing one
endianness type over another, and example code of a way to swap
endianness. What more do you want? A special section entitled "why
your png decoder is not working on an Intel cpu"?



--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Wed, 7 Dec 2016 23:23:58 -0500
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
References:



NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1481171038 23671 96.57.23.82 (8 Dec 2016 04:23:58 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Thu, 8 Dec 2016 04:23:58 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
In-Reply-To:
Xref: panix comp.lang.c++:1125905

On 12/07/2016 05:59 PM, David Brown wrote:
> would simply use a pre-written png library.


thats 100% true. But along with that means I would do a huge research
first through the dozen C++ and PNG texts I have and a duckduckgo
search, BEFORE posting.



--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!not-for-mail
From: ruben safir
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Wed, 7 Dec 2016 23:24:35 -0500
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID:
References:



NNTP-Posting-Host: www.mrbrklyn.com
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Trace: reader1.panix.com 1481171075 23671 96.57.23.82 (8 Dec 2016 04:24:35 GMT)
X-Complaints-To: abuse-at-panix.com
NNTP-Posting-Date: Thu, 8 Dec 2016 04:24:35 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.5.0
In-Reply-To:
Xref: panix comp.lang.c++:1125906

On 12/07/2016 05:59 PM, David Brown wrote:
> clear enough explanation about what endianness means,


no, it doesn't. Maybe you can reedit it.


--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!168.235.88.217.MISMATCH!feeder.erje.net!2.us.feeder.erje.net!weretis.net!feeder6.news.weretis.net!news.glorb.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad.highwinds-media.com!fx09.iad.POSTED!not-for-mail
From: Robert Wessel
Newsgroups: comp.lang.c++
Subject: Re: png data format
Message-ID: <81th4ctdjpud70gbud62m567f3f1djvfi1-at-4ax.com>
References:
User-Agent: ForteAgent/7.20.32.1218
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse-at-easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Thu, 08 Dec 2016 00:01:37 -0600
X-Received-Bytes: 2042
X-Received-Body-CRC: 2419967536
Xref: panix comp.lang.c++:1125907

On Wed, 7 Dec 2016 23:24:35 -0500, ruben safir
wrote:

>On 12/07/2016 05:59 PM, David Brown wrote:
>> clear enough explanation about what endianness means,
>
>
>no, it doesn't. Maybe you can reedit it.


As a regular WP editor (although I don't believe I've ever edited that
particular article), I may be biased, but it looks like a pretty good
article to me. Clear, concise, complete and well referenced - you
really can't ask for much more (the article's "B" class rating
suggests that I'm not the only one with that opinion). The basic
concept is explained in the first introductory paragraph, and then
nicely illustrated in two illustrations in the immediately following
"Illustration" section.

OTOH, I do know what endianness is, which may be leading me to making
incorrect assumptions about the context in which someone without that
knowledge would be reading the article, leading to some significant
omitted information. If you have some constructive criticism
regarding how the article failed you, I can certainly take a look at
improving it.

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!feeds.phibee-telecom.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 08 Dec 2016 01:26:02 -0600
From: Gareth Owen
Newsgroups: comp.lang.c++
Subject: Re: png data format
References:




Date: Thu, 08 Dec 2016 07:26:02 +0000
Message-ID: <87eg1ivq45.fsf-at-gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:mpsUHd8QvM7B/jEJgTmTh8WQ6kY=
MIME-Version: 1.0
Content-Type: text/plain
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-sHqYGps8Oeu9bsrc3eh3weF+lwBc0ZwjmA+FNy4XDvAO4gLGTw+qzdMEkW4W1cUROK0tm0UTiWAqODx!g5aVqsdljaQQq1qLK/fipIjPYxJsMVFbzEy7FWgktYy4u+DAdvMPxjcBRuc6CmxI5CZv
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1494
Xref: panix comp.lang.c++:1125909

ruben safir writes:

> On 12/07/2016 05:59 PM, David Brown wrote:
>> clear enough explanation about what endianness means,
>
>
> no, it doesn't. Maybe you can reedit it.

Maybe the problem is not with the article? Try this one.
https://simple.wikipedia.org/wiki/Endianness

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 08 Dec 2016 02:08:40 -0600
Date: Thu, 08 Dec 2016 10:08:37 +0200
From: Paavo Helde
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.8) Gecko/20151117 FossaMail/25.1.9
MIME-Version: 1.0
Newsgroups: comp.lang.c++
Subject: Re: png data format
References: <87eg1ivq45.fsf-at-gmail.com>
In-Reply-To: <87eg1ivq45.fsf-at-gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID:
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-sEU9l50nELH+ogg61ZAFcvgpYWerQJPSgxhjTMIPZi9pdBlSPCSwhubqEBGJd1BNgoCmIsdn6TKQgMZ!JgG4b3xvvfELY7I2YZFVHK4tNOeg1/RL70zKWU1ol4tJnc69IzCsM46qzZ7IhmlmNxsggbDZxxo=
X-Complaints-To: abuse-at-giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2371
Xref: panix comp.lang.c++:1125910

On 8.12.2016 9:26, Gareth Owen wrote:
> ruben safir writes:
>
>> On 12/07/2016 05:59 PM, David Brown wrote:
>>> clear enough explanation about what endianness means,
>>
>>
>> no, it doesn't. Maybe you can reedit it.
>
> Maybe the problem is not with the article? Try this one.
> https://simple.wikipedia.org/wiki/Endianness

"For each hard question there is a simple, easily understandable wrong
answer" - except that this article is IMO wrong, but still not easily
understandable. What is "hexadecimal data"? Is AB12 really encoded in 4
bits?

Why they want to couple endianness with some binary data representation?
In a "simple pedia" like that I would stick to our common decimal
representation and just say that the number ten is written by two
digits: 0 and 1, which can be ordered either as 01 or 10. I also would
talk something about Gulliver and about the egg-eater wars and who has won.






--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "Alf P. Steinbach"
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Thu, 8 Dec 2016 09:32:13 +0100
Organization: A noiseless patient Spider
Message-ID:
References:



<87eg1ivq45.fsf-at-gmail.com>

Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 8 Dec 2016 08:34:02 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="deaf984f7353488003ea7aa538670284";
logging-data="2841"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX1/Eb+/nj/Kc4cyKTBtEP/io"
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
Thunderbird/45.5.1
In-Reply-To:
Cancel-Lock: sha1:PIUN0HwpBQ4OdWsfZk6tEvy6h28=
Xref: panix comp.lang.c++:1125911

On 08.12.2016 09:08, Paavo Helde wrote:
> On 8.12.2016 9:26, Gareth Owen wrote:
>> ruben safir writes:
>>
>>> On 12/07/2016 05:59 PM, David Brown wrote:
>>>> clear enough explanation about what endianness means,
>>>
>>>
>>> no, it doesn't. Maybe you can reedit it.
>>
>> Maybe the problem is not with the article? Try this one.
>> https://simple.wikipedia.org/wiki/Endianness
>
> "For each hard question there is a simple, easily understandable wrong
> answer" - except that this article is IMO wrong, but still not easily
> understandable. What is "hexadecimal data"? Is AB12 really encoded in 4
> bits?
>
> Why they want to couple endianness with some binary data representation?
> In a "simple pedia" like that I would stick to our common decimal
> representation and just say that the number ten is written by two
> digits: 0 and 1, which can be ordered either as 01 or 10. I also would
> talk something about Gulliver and about the egg-eater wars and who has won.

Not everybody knows that Jonathan Swift wrote the original
recursion-poem, that Augustus De Morgan based his more well-known
variant on. So, first of all, Jonathan Swift ? Augustus De Morgan.

Then there's the connection George Boole ? (friendly
article/book-publishing competitor with) Augustus DeMorgan ? (private
math tutor to) Lady Augusta Ada ? (coder and sort of secretary for)
Charles Babbage ? first general programmable computer.

I remember getting almost angry when some American professor wrote an
article about the history of computers in Scientific American, and
managed to omit all that crucial English history. He started with
something about Napoleon, skipped the German/English part entirely, and
ended with the US developments after WWII. I think he even managed to
omit that John von Neumann was Hungarian, like, he was an American.

Not sure how much of this to include in an article about endianness, though.

But it would be nice with a discussion of the endianness of Babbage's
analytical engine.


Cheers!,

- Alf


--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!news.linkpendium.com!news.linkpendium.com!news.snarked.org!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: legalize+jeeves-at-mail.xmission.com (Richard)
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Thu, 8 Dec 2016 18:02:12 +0000 (UTC)
Organization: multi-cellular, biological
Sender: legalize+jeeves-at-mail.xmission.com
Message-ID:
References: <87eg1ivq45.fsf-at-gmail.com>
Reply-To: (Richard) legalize+jeeves-at-mail.xmission.com
Injection-Date: Thu, 8 Dec 2016 18:02:12 +0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:2607:fa18:0:beef::4";
logging-data="14093"; mail-complaints-to="abuse-at-xmission.com"
X-Reply-Etiquette: No copy by email, please
Mail-Copies-To: never
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: legalize-at-shell.xmission.com (Richard)
Xref: panix comp.lang.c++:1125921

[Please do not mail me a copy of your followup]

Paavo Helde spake the secret code
thusly:

>"For each hard question there is a simple, easily understandable wrong
>answer" - except that this article is IMO wrong, but still not easily
>understandable. What is "hexadecimal data"? Is AB12 really encoded in 4
>bits?

What is hexadecimal data? Seriously? Are you unable to google or
use WP's search box?

Never mind that "hexadecimal" is linked right in the article.

Nowhere in that article could I find the data 0xAB12.

>Why they want to couple endianness with some binary data representation?

Because the discussion of endianness is meaningless without
discussing how things are stored as binary values in memory or on a
communication stream.

If you don't care how things are stored or transmitted in some binary
form, then you don't care about endianness.
--
"The Direct3D Graphics Pipeline" free book
The Terminals Wiki
The Computer Graphics Museum
Legalize Adulthood! (my blog)

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 08 Dec 2016 13:30:33 -0600
Date: Thu, 08 Dec 2016 21:30:32 +0200
From: Paavo Helde
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.8) Gecko/20151117 FossaMail/25.1.9
MIME-Version: 1.0
Newsgroups: comp.lang.c++
Subject: Re: png data format
References: <87eg1ivq45.fsf-at-gmail.com>
In-Reply-To:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID:
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-BvVIzx0JaiOh3QveeQmDn/qU7tBuBkFZxys8W2fB/b0BZkh9DLOxBkEhFp9xTYrwOC29ZrcybMnsPXp!GHcertJ0rzzjrjeNJu8IeFXt/cIPo4fuBw0LuubumpMv3cx7FSW+rgfYbtRBHJD8goklrQ/25eE=
X-Complaints-To: abuse-at-giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2326
Xref: panix comp.lang.c++:1125924

On 8.12.2016 20:02, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> Paavo Helde spake the secret code
> thusly:
>
>> "For each hard question there is a simple, easily understandable wrong
>> answer" - except that this article is IMO wrong, but still not easily
>> understandable. What is "hexadecimal data"? Is AB12 really encoded in 4
>> bits?
>
> What is hexadecimal data? Seriously? Are you unable to google or
> use WP's search box?

Tell me, what is "hexadecimal data"? I can understand what is
"hexadecimal representation of data", but "hexadecimal data"? If a
weather station reports temperature 25?C, is this "hexadecimal data" or not?

>
> Nowhere in that article could I find the data 0xAB12.

Are you sure you looked at the same article?
https://simple.wikipedia.org/wiki/Endianness

It appears user Dearingj has changed 'bits' to 'pieces' today, so maybe
all my nitpicking is not in vain ;-)

Cheers
Paavo


--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 08 Dec 2016 14:00:41 -0600
From: Gareth Owen
Newsgroups: comp.lang.c++
Subject: Re: png data format
References:
<87eg1ivq45.fsf-at-gmail.com>



Date: Thu, 08 Dec 2016 20:00:40 +0000
Message-ID: <87pol2w5qv.fsf-at-gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:gky3KGPH6NLGRmxWE/H1DbTLrhk=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-wkSL6bNtC7znRNPZdPxcNrTwFJJA8UI/UsgYik1sAfksDJA8TWLZXIuKbXpURbClps7/dKL5xUfPaiH!Ou/fNMqCqHzmEse6q80PYbCFmwsCINOUCGmBhSEMZCbJ5b2fWcmXLw43sHI92XhdPhke
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2278
Xref: panix comp.lang.c++:1125925

Paavo Helde writes:

> On 8.12.2016 20:02, Richard wrote:
>> [Please do not mail me a copy of your followup]
>>
>> Paavo Helde spake the secret code
>> thusly:
>>
>>> "For each hard question there is a simple, easily understandable wrong
>>> answer" - except that this article is IMO wrong, but still not easily
>>> understandable. What is "hexadecimal data"? Is AB12 really encoded in 4
>>> bits?
>>
>> What is hexadecimal data? Seriously? Are you unable to google or
>> use WP's search box?
>
> Tell me, what is "hexadecimal data"? I can understand what is
> "hexadecimal representation of data", but "hexadecimal data"? If a
> weather station reports temperature 25°C, is this "hexadecimal data"
> or not?

You are technically correct, the best sort of correct.

However, you *don't* really not understand what "hexadecimal data"
means, you're just being an annoying pedant.

Pedantry and simplicity are often at odds. Can you guess which way
Simple Wikipedia tends to lean?

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Christian Gollwitzer
Newsgroups: comp.lang.c++
Subject: Re: png data format
Date: Thu, 8 Dec 2016 21:36:57 +0100
Organization: A noiseless patient Spider
Message-ID:
References:
<87eg1ivq45.fsf-at-gmail.com>

<87pol2w5qv.fsf-at-gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 8 Dec 2016 20:35:37 -0000 (UTC)
Injection-Info: mx02.eternal-september.org; posting-host="4feb5edd6cdf1bcbc0658ca459aab471";
logging-data="23355"; mail-complaints-to="abuse-at-eternal-september.org"; posting-account="U2FsdGVkX1868V694+wDp7Elco76crS8m8CL7Nomtpk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.2
In-Reply-To: <87pol2w5qv.fsf-at-gmail.com>
Cancel-Lock: sha1:y7l+X0xWx5r2g5lbSnOJZxWEh4Y=
Xref: panix comp.lang.c++:1125926

Am 08.12.2016 um 21:00 schrieb Gareth Owen:
> Pedantry and simplicity are often at odds. Can you guess which way
> Simple Wikipedia tends to lean?

Maybe, but that particular article is both not simple and incorrect.
A) Not simple: The second sentence has nested parataxes (indicated by
brackets)

"In computer coding, certain numbers, [usually two bytes long (1 byte
= 8 bits) [ that are called "words",] ] can be written or input in two ways"

B) Incorrect: It says that the number 0x12AB in big endian is 12|AB,
because "the bigger number comes at the end", explaining the hexadecimal
digits 0..9A..F. So it is big endian, because AB > 12 ? I can't seem to
understand the sentence in the correct way, it is definitely incorrect


Christian

--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: message/rfc822;
name="Re: png data format.eml"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
filename="Re: png data format.eml"

Path: reader1.panix.com!panix!bloom-beacon.mit.edu!bloom-beacon.mit.edu!168.235.88.217.MISMATCH!2.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!feeds.phibee-telecom.net!border2.nntp.ams1.giganews.com!border1.nntp.ams1.giganews.com!nntp.giganews.com!buffer1.nntp.ams1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 08 Dec 2016 14:40:31 -0600
Date: Thu, 08 Dec 2016 22:40:30 +0200
From: Paavo Helde
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.8) Gecko/20151117 FossaMail/25.1.9
MIME-Version: 1.0
Newsgroups: comp.lang.c++
Subject: Re: png data format
References: <87eg1ivq45.fsf-at-gmail.com> <87pol2w5qv.fsf-at-gmail.com>
In-Reply-To: <87pol2w5qv.fsf-at-gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID:
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-nvQupLTxI+vgObbTQD8uNLLq3PnCzSaN9SA4S4nQ5QIZtuszEZoXhcwstvctx26NLP4WzqsQPm/93EN!qQsbq60igXzs5Ik4neG86q7e9zCXg7OJcL0ap7QNAnWeyqTQxI3Vx7cPFJO0oBmzVigt/dC0o3I=
X-Complaints-To: abuse-at-giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3062
Xref: panix comp.lang.c++:1125927

On 8.12.2016 22:00, Gareth Owen wrote:
> Paavo Helde writes:
>
>> On 8.12.2016 20:02, Richard wrote:
>>> [Please do not mail me a copy of your followup]
>>>
>>> Paavo Helde spake the secret code
>>> thusly:
>>>
>>>> "For each hard question there is a simple, easily understandable wrong
>>>> answer" - except that this article is IMO wrong, but still not easily
>>>> understandable. What is "hexadecimal data"? Is AB12 really encoded in 4
>>>> bits?
>>>
>>> What is hexadecimal data? Seriously? Are you unable to google or
>>> use WP's search box?
>>
>> Tell me, what is "hexadecimal data"? I can understand what is
>> "hexadecimal representation of data", but "hexadecimal data"? If a
>> weather station reports temperature 25°C, is this "hexadecimal data"
>> or not?
>
> You are technically correct, the best sort of correct.
>
> However, you *don't* really not understand what "hexadecimal data"
> means, you're just being an annoying pedant.
>
> Pedantry and simplicity are often at odds. Can you guess which way
> Simple Wikipedia tends to lean?

That's what I said, "simple and wrong". The notion of 'endianness' and
the notion of 'data' have nothing whatsoever to do with 'hexadecimal',
so why the Wikipedia article starts with "Endianness refers to how
hexadecimal data is ordered ..."?

I can understand that people like simple and wrong explanations. I just
don't approve it. But in this case, I feel that 'hexadecimal' is
actually complicating the things, instead of making them simpler. This
article should not contain 'hexadecimal' at all.

Cheers
Paavo



--------------C0BA4D4F3CF0D9F9AA2CFCA3
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Learn mailing list
Learn-at-nylxs.com
http://lists.mrbrklyn.com/mailman/listinfo/learn

--------------C0BA4D4F3CF0D9F9AA2CFCA3--

  1. 2016-12-01 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] Fwd: Patrolling the Dark Net,
  2. 2016-12-02 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Tutorial on threaded binary tree part 1: simple
  3. 2016-12-03 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Witner Labs
  4. 2016-12-04 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Nice lecture on Quantum Mechanics
  5. 2016-12-05 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] information access, copyright wars and DRM
  6. 2016-12-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] png data format
  7. 2016-12-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] png data format
  8. 2016-12-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] png data format
  9. 2016-12-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] png data format
  10. 2016-12-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] png data format
  11. 2016-12-06 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] png data format
  12. 2016-12-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] png data format
  13. 2016-12-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] png data format
  14. 2016-12-06 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] png data format
  15. 2016-12-06 Christopher League <league-at-contrapunctus.net> Re: [Learn] png data format
  16. 2016-12-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] [Hangout-NYLXS] png data format
  17. 2016-12-06 John Bowler <john.cunningham.bowler-at-gmail.com> Re: [Learn] [png-mng-implement] 4 byte length storage
  18. 2016-12-06 John Bowler <john.cunningham.bowler-at-gmail.com> Re: [Learn] [png-mng-implement] 4 byte length storage
  19. 2016-12-06 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] [png-mng-implement] 4 byte length storage
  20. 2016-12-06 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Ocaml
  21. 2016-12-06 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: [luny-talk] Humble Bundle O'Reilly UNIX books
  22. 2016-12-06 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] JT's words
  23. 2016-12-06 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] png data format
  24. 2016-12-07 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: png data format
  25. 2016-12-08 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: png data format
  26. 2016-12-08 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: png data format
  27. 2016-12-08 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: png data format
  28. 2016-12-10 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] references to pointers
  29. 2016-12-10 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ returning lvalue references and pointers and refs
  30. 2016-12-10 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] const puzzle and literal type arguments
  31. 2016-12-11 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: png data format
  32. 2016-12-12 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Fwd: Re: png data format
  33. 2016-12-12 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] gene phylogienics of homonids
  34. 2016-12-13 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Bit Depth
  35. 2016-12-13 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ Threads Workshop
  36. 2016-12-13 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Summer Jobs
  37. 2016-12-14 From: "Mancini, Sabin (DFS)" <Sabin.Mancini-at-dfs.ny.gov> Subject: [Learn] For Ruben ( + those in NYC Metro ) : Holiday Social Event
  38. 2016-12-14 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: [dinosaur] Ceratopsid (Centrosaurinae:
  39. 2016-12-15 Ruben Safir <ruben.safir-at-my.liu.edu> Re: [Learn] Happy Holidays
  40. 2016-12-15 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] zlib demo with vector::resize
  41. 2016-12-15 John Bowler <john.cunningham.bowler-at-gmail.com> Re: [Learn] [png-mng-implement] 4 byte length storage
  42. 2016-12-15 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: [dinosaur] Elephant bird nuclear genome fragments
  43. 2016-12-15 Christopher League <league-at-contrapunctus.net> Subject: [Learn] zlib demo with vector::resize
  44. 2016-12-16 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] zlib demo with vector::resize
  45. 2016-12-16 Christopher League <league-at-contrapunctus.net> Re: [Learn] zlib demo with vector::resize
  46. 2016-12-16 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] PNG Parallel Programming problem
  47. 2016-12-17 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] [Hangout-NYLXS] I'm sure it's a coincidence, part n+1
  48. 2016-12-17 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] irc thread on the use of object methods in threads
  49. 2016-12-17 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] PNG threaded program
  50. 2016-12-18 ruben safir <ruben-at-mrbrklyn.com> Re: [Learn] Threads and Object Methods
  51. 2016-12-18 ruben safir <ruben-at-mrbrklyn.com> Re: [Learn] Threads and Object Methods
  52. 2016-12-18 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Look C++ is a functional programming language
  53. 2016-12-19 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] C++ Threading
  54. 2016-12-19 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] C++ Threading
  55. 2016-12-19 ISOC-NY announcements <announce-at-lists.isoc-ny.org> Subject: [Learn] [isoc-ny] JOB: Telecommunications Policy Specialist -at- NTIA
  56. 2016-12-20 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] F'ing Mouse Pad
  57. 2016-12-20 mrbrklyn <mrbrklyn-at-panix.com> Subject: [Learn] Phylogenetic study worth noting
  58. 2016-12-21 Samir Iabbassen <Samir.Iabbassen-at-liu.edu> Re: [Learn] Noobdy is home
  59. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] Noobdy is home
  60. 2016-12-21 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Noobdy is home
  61. 2016-12-21 Samir Iabbassen <Samir.Iabbassen-at-liu.edu> Re: [Learn] thread concurancy
  62. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] thread concurancy
  63. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: lamda's in classes
  64. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: lamda's in classes
  65. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: thread concurancy
  66. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  67. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  68. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  69. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  70. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  71. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  72. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  73. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  74. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Re: Threads and Object Methods
  75. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) thread concurancy
  76. 2016-12-21 Ruben Safir <mrbrklyn-at-panix.com> Subject: [Learn] (fwd) Threads and Object Methods
  77. 2016-12-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] I need help
  78. 2016-12-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Noobdy is home
  79. 2016-12-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] thread concurancy
  80. 2016-12-21 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] [Hangout-NYLXS] Marnchester by the Sea
  81. 2016-12-22 Ruben Safir <mrbrklyn-at-panix.com> Re: [Learn] [Hangout-NYLXS] And be aware you were an unexcused
  82. 2016-12-22 ruben safir <ruben-at-mrbrklyn.com> Subject: [Learn] Fwd: Re: thread concurancy
  83. 2016-12-23 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] HOPL (History of Programming Languages)
  84. 2016-12-23 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Noobdy is home
  85. 2016-12-23 Ruben Safir <ruben-at-mrbrklyn.com> Re: [Learn] Tiny Compiler in many languages at Rosettacode.org
  86. 2016-12-25 Ruben Safir <ruben-at-mrbrklyn.com> Subject: [Learn] Google and C++
  87. 2016-12-25 Ruben Safir <ruben.safir-at-my.liu.edu> Subject: [Learn] phylogentics
  88. 2016-12-27 Samir Iabbassen <Samir.Iabbassen-at-liu.edu> Re: [Learn] thread concurancy

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!