f



enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

My question can be found here:


http://stackoverflow.com/questions/31058100/enumerate-column-headers-in-csv-that-belong-to-the-same-tag-key-in-python


Here is an additional sample sample of the XML that I am working with: 

<Response ID="123546 - 7831" RequestType="Moverview">        
        <MonthDayCount>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
            <Int32>0</Int32>
        </MonthDayCount>
            <FeeCount>
                    <Int32>0</Int32>
                    <Int32>0</Int32>
                    <Int32>0</Int32>
                    <Int32>0</Int32>
                    <Int32>0</Int32>
                    <Int32>0</Int32>
            </FeeCount>
            <PaymentBucketAmount>
                        <Double>0</Double>
                        <Double>0</Double>
                        <Double>0</Double>
                        <Double>0</Double>
                        <Double>0</Double>
                        <Double>0</Double>
                        <Double>0</Double>
                        <Double>0</Double>
                    </PaymentBucketAmount>
                    <PaymentBucketDueDate>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                        <DateTime>1/1/0001 12:00:00 AM</DateTime>
                    </PaymentBucketDueDate>
        <Warnings />
        <SList />
        <LList />
        <PA>False</PA>
        <PL>False</PL>
        <PC>False</PC>
        <PCs>False</PCs>
        <PJ>False</PJ>
        <OITC>0</OITC>
        <MG />
        <R />
        <CCGoods />
</Response>
0
kbtyo
6/25/2015 6:39:53 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

11 Replies
929 Views

Similar Articles

[PageSpeed] 18

On Thu, 25 Jun 2015 11:39:53 -0700, kbtyo wrote:

> My question can be found here:
> 
> http://stackoverflow.com/questions/31058100/enumerate-column-headers-in-
csv-that-belong-to-the-same-tag-key-in-python

I suggest you look on stack overflow for the answer.

You appear to have failed to comprehend (again) the fact that the xml 
data is an unordered list, and are trying to assign an order to it.

If the xml data was ordered, either each tag would be different, or each 
tag would have an attribute specifying a sequence number.

If the original data is ordered, then you need to go back to the code 
that creates the xml and make it add the ordering information to the xml 
(ideally as an attribute of the tags concerned) to specify the order.

You can not reliably and with any certainty of being accurate try and 
assign some sequence to the list of similarly named elements simply from 
their position in the list.

You don't know if the code that creates the xml is walking the array like 
this:

i = sizeof(arr);
while (i--) addXmlElement(arr[i]);

or like this:

for (i = 0; i < arr.len; i++) addXmlElement(arr[i]);

or even like this:

while (sizeof(arr)) addXmlElement(popArrElement(arr[sizeof(arr)/2]));

Granted the latter is unlikely and perverse, but still not wholly 
impossible. More perverse and less likely mechanisms are also available.

But my point remains - that if the ordering data is not passed into the 
xml, then you can not magically add it when you later use the xml.

-- 
Denis McMahon, denismfmcmahon@gmail.com
0
Denis
6/26/2015 7:44:45 AM
Denis McMahon schrieb am 26.06.2015 um 09:44:
> xml data is an unordered list, and are trying to assign an order to it.
> 
> If the xml data was ordered, either each tag would be different, or each 
> tag would have an attribute specifying a sequence number.

XML is not unordered. The document order is well defined and entirely
obvious from the data. Whether this order is relevant and has a meaning or
not is, however, not part of XML itself but is left to the semantics of the
specific document format at hand. Meaning, XML document formats can choose
to ignore that order and define it as irrelevant. That doesn't mean it's
not there for a given document, but it may mean that a re-transmission of
the same document would be allowed to use a different order without
changing the information.

This property applies to pretty much all structured data formats and not
just XML, by the way, also to CSV and other tabular formats.

Stefan


0
Stefan
6/28/2015 7:46:36 AM
On Sun, 28 Jun 2015 09:46:36 +0200, Stefan Behnel wrote:

> Denis McMahon schrieb am 26.06.2015 um 09:44:
>> xml data is an unordered list, and are trying to assign an order to it.
>> 
>> If the xml data was ordered, either each tag would be different, or
>> each tag would have an attribute specifying a sequence number.
> 
> XML is not unordered. The document order is well defined and entirely
> obvious from the data. Whether this order is relevant and has a meaning
> or not is, however, not part of XML itself but is left to the semantics
> of the specific document format at hand. Meaning, XML document formats
> can choose to ignore that order and define it as irrelevant. That
> doesn't mean it's not there for a given document, but it may mean that a
> re-transmission of the same document would be allowed to use a different
> order without changing the information.
> 
> This property applies to pretty much all structured data formats and not
> just XML, by the way, also to CSV and other tabular formats.

The point I am trying to make to OP is that the following two XML 
fragments define the same data:

<things>
  <thing>string 1</thing>
  <thing>string 2</thing>
  <thing>string 3</thing>
</things>

and:

<things>
  <thing>string 3</thing>
  <thing>string 2</thing>
  <thing>string 1</thing>
</things>

Each <thing> is just a member of the collection things, the xml does not 
contain sufficient information to state that <things> is an ordered 
collection containing a specific sequence of <thing>.

Mechanisms such as node.firstChild and node.getChild(x) are all very well 
for manipulating the xml, but any specific ordering of the original data 
should be carried out by using an appropriate attribute of the ordered 
data elements at the point where the xml representation is created.

-- 
Denis McMahon, denismfmcmahon@gmail.com
0
Denis
6/28/2015 9:00:41 PM
On Sunday, June 28, 2015 at 5:02:19 PM UTC-4, Denis McMahon wrote:
> On Sun, 28 Jun 2015 09:46:36 +0200, Stefan Behnel wrote:
> 
> > Denis McMahon schrieb am 26.06.2015 um 09:44:
> >> xml data is an unordered list, and are trying to assign an order to it.
> >> 
> >> If the xml data was ordered, either each tag would be different, or
> >> each tag would have an attribute specifying a sequence number.
> > 
> > XML is not unordered. The document order is well defined and entirely
> > obvious from the data. Whether this order is relevant and has a meaning
> > or not is, however, not part of XML itself but is left to the semantics
> > of the specific document format at hand. Meaning, XML document formats
> > can choose to ignore that order and define it as irrelevant. That
> > doesn't mean it's not there for a given document, but it may mean that a
> > re-transmission of the same document would be allowed to use a different
> > order without changing the information.
> > 
> > This property applies to pretty much all structured data formats and not
> > just XML, by the way, also to CSV and other tabular formats.
> 
> The point I am trying to make to OP is that the following two XML 
> fragments define the same data:
> 
> <things>
>   <thing>string 1</thing>
>   <thing>string 2</thing>
>   <thing>string 3</thing>
> </things>
> 
> and:
> 
> <things>
>   <thing>string 3</thing>
>   <thing>string 2</thing>
>   <thing>string 1</thing>
> </things>
> 
> Each <thing> is just a member of the collection things, the xml does not 
> contain sufficient information to state that <things> is an ordered 
> collection containing a specific sequence of <thing>.

You are right that XML does not specify that <things> is an ordered collection.
But XML does preserve the order of the children.  There are many XML schema
that rely on XML's order-preserving nature.

> 
> Mechanisms such as node.firstChild and node.getChild(x) are all very well 
> for manipulating the xml, but any specific ordering of the original data 
> should be carried out by using an appropriate attribute of the ordered 
> data elements at the point where the xml representation is created.
> 
> -- 
> Denis McMahon, denismfmcmahon@gmail.com

0
Ned
6/29/2015 12:07:00 AM
On 2015-06-28 22:00, Denis McMahon wrote:
> On Sun, 28 Jun 2015 09:46:36 +0200, Stefan Behnel wrote:
>
>> Denis McMahon schrieb am 26.06.2015 um 09:44:
>>> xml data is an unordered list, and are trying to assign an order to it.
>>>
>>> If the xml data was ordered, either each tag would be different, or
>>> each tag would have an attribute specifying a sequence number.
>>
>> XML is not unordered. The document order is well defined and entirely
>> obvious from the data. Whether this order is relevant and has a meaning
>> or not is, however, not part of XML itself but is left to the semantics
>> of the specific document format at hand. Meaning, XML document formats
>> can choose to ignore that order and define it as irrelevant. That
>> doesn't mean it's not there for a given document, but it may mean that a
>> re-transmission of the same document would be allowed to use a different
>> order without changing the information.
>>
>> This property applies to pretty much all structured data formats and not
>> just XML, by the way, also to CSV and other tabular formats.
>
> The point I am trying to make to OP is that the following two XML
> fragments define the same data:
>
> <things>
>    <thing>string 1</thing>
>    <thing>string 2</thing>
>    <thing>string 3</thing>
> </things>
>
> and:
>
> <things>
>    <thing>string 3</thing>
>    <thing>string 2</thing>
>    <thing>string 1</thing>
> </things>
>
> Each <thing> is just a member of the collection things, the xml does not
> contain sufficient information to state that <things> is an ordered
> collection containing a specific sequence of <thing>.

Without reference to a schema that explicitly defines the children of <things> 
to be unordered, this is not true. The XML Information Set defines the children 
of all elements to be an ordered set (in contrast to attributes, which are 
unordered). A particular XML schema may choose to consider the order of children 
of a particular element to be irrelevant, but XML itself keeps them ordered.

http://www.w3.org/TR/xml-infoset/#infoitem.element

If it didn't, then XHTML would have a hell of a time with ordered constructs 
like this:

   <ol>
     <li>First item</li>
     <li>Second item</li>
     <li>Third item</li>
   </ol>

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

0
Robert
6/29/2015 1:04:45 PM
On Sunday, 28 June 2015 03:46:56 UTC-4, Stefan Behnel  wrote:
> Denis McMahon schrieb am 26.06.2015 um 09:44:
> > xml data is an unordered list, and are trying to assign an order to it.
> >=20
> > If the xml data was ordered, either each tag would be different, or eac=
h=20
> > tag would have an attribute specifying a sequence number.
>=20
> XML is not unordered. The document order is well defined and entirely
> obvious from the data. Whether this order is relevant and has a meaning o=
r
> not is, however, not part of XML itself but is left to the semantics of t=
he
> specific document format at hand. Meaning, XML document formats can choos=
e
> to ignore that order and define it as irrelevant. That doesn't mean it's
> not there for a given document, but it may mean that a re-transmission of
> the same document would be allowed to use a different order without
> changing the information.
>=20
> This property applies to pretty much all structured data formats and not
> just XML, by the way, also to CSV and other tabular formats.
>=20
> Stefan

@Stefan, Ned, and Robert: You have all hit the nail on the head. I do not h=
ave an authentic and veritable XSD (or XML data structures for that matter)=
.. So far it is all deprecated and/or anonymized data from the client. There=
fore, I can only hypothesize what the end output will be for the database a=
rchitecture that I am working with.=20

From what I understand, therefore, based on your constructive insight, is t=
hat the 14 occurrences of the same tag (regardless of placement relative to=
 neighbouring children and the root are all being defined as the same key. =
However, their individual values are also being treated as the same (from t=
he algorithm that I wrote in my Stack Overflow post (please see above)). Th=
e constraint is that I am anticipating terabytes of data every day from the=
 client in the coming months. The algorithm should be able to parse, and wr=
ite out to CSV in the most efficient manner. That is my design constraint. =
I welcome your feedback on this.=20

Here is the post, again, for your convenience:=20

http://stackoverflow.com/questions/31058100/enumerate-column-headers-in-csv=
-that-belong-to-the-same-tag-key-in-python=20


0
Sahlusar
6/29/2015 2:52:07 PM
On Sun, 28 Jun 2015 17:07:00 -0700, Ned Batchelder wrote:

> On Sunday, June 28, 2015 at 5:02:19 PM UTC-4, Denis McMahon wrote:

>> <things>
>>   <thing>string 3</thing>
>>   <thing>string 2</thing>
>>   <thing>string 1</thing>
>> </things>

>> Each <thing> is just a member of the collection things, the xml does
>> not contain sufficient information to state that <things> is an ordered
>> collection containing a specific sequence of <thing>.
> 
> You are right that XML does not specify that <things> is an ordered
> collection.
> But XML does preserve the order of the children.  There are many XML
> schema that rely on XML's order-preserving nature.

But what we *don't* know is whether the order of the umpteen identical 
tags in the XML has any significance in terms of the original data, 
although the OP seems intent on assigning some significance to that order 
without any basis for doing so.

Consider the following tuple:

t = (tuplemember_1, tuplemember_2, .... tuplemember_n)

Can we safely assume that if the tuple is ever converted to xml, either 
now or at some future date using whatever the code implementation is 
then, that the order of the items will be preserved:

<tuple>
  <item>tuplemember_1</item>
  <item>tuplemember_2</item>
.....
  <item>tuplemember_n/item>
</tuple>

And if we're reading that xml structure at some point in the future, is 
it safe to assume that the tuple members are in the same order in the xml 
as they were in the original tuple?

For sanity <item> should have an attribute specifying the sequence of the 
item in it's tuple.
-- 
Denis McMahon, denismfmcmahon@gmail.com
0
Denis
6/30/2015 12:54:22 AM
On Mon, 29 Jun 2015 07:52:07 -0700 (PDT), Sahlusar
<sahluwalia@wynyardgroup.com> declaimed the following:


>
>From what I understand, therefore, based on your constructive insight, is that the 14 occurrences of the same tag (regardless of placement relative to neighbouring children and the root are all being defined as the same key. However, their individual values are also being treated as the same (from the algorithm that I wrote in my Stack Overflow post (please see above)). The constraint is that I am anticipating terabytes of data every day from the client in the coming months. The algorithm should be able to parse, and write out to CSV in the most efficient manner. That is my design constraint. I welcome your feedback on this. 
>

	I sure hope that "terabytes of data" is hyperbole...

	My system takes something like three hours just to generate a 500GB
backup (one partition each week -- I have a 4TB backup drive with only
740GB free; the other drives are only half full or I'd need an 8TB backup).
And that's using a compiled backup program -- I'd hate to consider what
Python would require to backup the partition.

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

0
Dennis
6/30/2015 1:26:37 AM
On 2015-06-30 01:54, Denis McMahon wrote:
> On Sun, 28 Jun 2015 17:07:00 -0700, Ned Batchelder wrote:
>
>> On Sunday, June 28, 2015 at 5:02:19 PM UTC-4, Denis McMahon wrote:
>
>>> <things>
>>>    <thing>string 3</thing>
>>>    <thing>string 2</thing>
>>>    <thing>string 1</thing>
>>> </things>
>
>>> Each <thing> is just a member of the collection things, the xml does
>>> not contain sufficient information to state that <things> is an ordered
>>> collection containing a specific sequence of <thing>.
>>
>> You are right that XML does not specify that <things> is an ordered
>> collection.
>> But XML does preserve the order of the children.  There are many XML
>> schema that rely on XML's order-preserving nature.
>
> But what we *don't* know is whether the order of the umpteen identical
> tags in the XML has any significance in terms of the original data,
> although the OP seems intent on assigning some significance to that order
> without any basis for doing so.
>
> Consider the following tuple:
>
> t = (tuplemember_1, tuplemember_2, .... tuplemember_n)
>
> Can we safely assume that if the tuple is ever converted to xml, either
> now or at some future date using whatever the code implementation is
> then, that the order of the items will be preserved:
>
> <tuple>
>    <item>tuplemember_1</item>
>    <item>tuplemember_2</item>
> ....
>    <item>tuplemember_n/item>
> </tuple>

Barring bugs, yes!

> And if we're reading that xml structure at some point in the future, is
> it safe to assume that the tuple members are in the same order in the xml
> as they were in the original tuple?

Yes! Any conforming XML implementation will preserve the order.

> For sanity <item> should have an attribute specifying the sequence of the
> item in it's tuple.

While it may make you more comfortable, it's hardly a requirement for sanity.

I think you had a point in your first paragraph here, but you are obscuring it 
with FUD. The problem is not whether unadorned XML elements can be used to 
represent an ordered collection. They can and are, frequently, without any 
problem because XML elements are intrinsically ordered.

The real problem that you almost get around to articulating is that XML elements 
can *also* be used to represent unordered collections simply by ignoring the 
(preserved) order of the elements. And if you are completely blind as to the 
schema as the OP apparently is, and you are simply given a load of XML and told 
to do "something" with it, you don't know if any given collection is meant to be 
ordered or unordered. Of course, the only sensible thing to do is just preserve 
the order given to you as that is what the semantics of XML requires of you in 
the absence of a schema that says otherwise. You can always disregard the order 
later.

That said, if the data is regular enough to actually be restructured into a 
table (i.e. if <MonthDayCount> always has the same number of children, etc.), 
then it probably does represent an ordered collection. If it's variable, then 
putting it into a table structure probably doesn't make any sense regardless of 
ordering issues.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

0
Robert
6/30/2015 9:16:03 AM
On Tue, Jun 30, 2015 at 11:26 AM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
>         My system takes something like three hours just to generate a 500GB
> backup (one partition each week -- I have a 4TB backup drive with only
> 740GB free; the other drives are only half full or I'd need an 8TB backup).
> And that's using a compiled backup program -- I'd hate to consider what
> Python would require to backup the partition.

Probably about the same, actually. In my experience, there's often
very little speed difference between a straight 'dd' from one
partition to another (say, making a disk image prior to data recovery)
and doing more complicated work (say, archiving and compressing).
Until you actually manage to saturate your CPU with the workload
(video editing or something), the time is most likely to be dominated
by the disk platters.

ChrisA
0
Chris
6/30/2015 12:40:27 PM
Robert Kern <robert.kern@gmail.com>:

>> <tuple>
>>    <item>tuplemember_1</item>
>>    <item>tuplemember_2</item>
>> ....
>>    <item>tuplemember_n/item>
>> </tuple>
>
> [...]
>
> Yes! Any conforming XML implementation will preserve the order.

And not only the order: the newlines and other whitespace around the
<item>s are also preserved as children of <tuple>.

> And if you are completely blind as to the schema as the OP apparently
> is, and you are simply given a load of XML and told to do "something"
> with it, you don't know if any given collection is meant to be ordered
> or unordered. Of course, the only sensible thing to do is just
> preserve the order given to you as that is what the semantics of XML
> requires of you in the absence of a schema that says otherwise.

XML is an unfortunate creation. You cannot fully parse it without
knowing the schema (or document type). For example, these constructs
might or might not be equivalent:

    <stuff>&aring;</stuff>

    <stuff>å</stuff>

That is because &...; entities are defined in the document type.

Similarly, these two constructs might or might not be equivalent:

   <stuff greet="hello"/>

   <stuff greet=" hello "/>

By default, they would be, but the document type can declare whitespce
significant around an attribute value.

Finally, these two constructs might or might not be equivalent:

   <count> 7 </count>
   <count>7</count>

By default, they wouldn't be, but the document type can declare
whitespace *insignificant* around element contents.

Sigh, S-expressions would have been a much better universal data format.


Marko
0
Marko
6/30/2015 4:32:06 PM
Reply:

Similar Artilces:

distutils: How "uninclude" one Python file and/or one .h (C header) file???
I specify packages in my setup.py but what if I want all py files in a directory but one??? How remove just that one?? (Without listing all files I want explicitly??) I need header files to build a C extension but I DON't want headers installed. *How do I include header files in the tar.gz (tarball) file but NOT have them be installed when "python setup.py install" done?? Chris I saw a number of questions about distutils. I know how to answer to this one: You can use the file MANIFEST.in (see section 7.2 of the distutils manual) and put the command "exclude" in...

"Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraint"
We've moved a database from one SQL server to another using a backup and restore, we had some problems because the location was slightly different when we moved the database, then we had to create all the users again. We're now receiving an error when opening the client utility - which is "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraint" Any suggestions? database was working beforehand so i can't see why it would be an error in the code Regards Paul PS SQL2000 with SP3 <paul_tomlin@hotmail.c...

&quot;Key Down&quot; event use in one page of tab control prevents using &quot;Value Change&quot; events on another page, even though separate case structure blocks handle the two
The attached VI has a tabbed control with two pages. On one page, titled "Using Value Change Events",&nbsp;there is a control and an indicator, and the underlying code processes a Value Change event on that control by adding one to the number and displaying it on the indicator. On the other page, titled "Using Key Down Events", there is an indicator, and the underlying code processes a Key Down event by displaying the scancode on the indicator. Both these underlying code blocks are in different cases of a case structure chosen by the tab control. Some extra items are ne...

Why does "One Zero" mean "Ten" and not "One Zero"?
Who asked if we said "10" equals "One Zero" like it says what could we conceive as a benefit from this? The answer to the question is me: "Eleaticus" (actually) Musatov. Though we may have answered the question we have not answered [the] question contained [within] the question. Let us do this now: I can think of two benefits. 1. The disparaging difference between logic numbers and language narrows. (And) 2. A new system is adopted: one better suited to sensible expression. Let us examine the problem of the "Ill Placed Zero": 1. When we say 0 it...

"value" to find a "key"
Is there such a "Map" in java I can easily trace the key by its value, assuming the values are also unique ? John, John wrote: > > Is there such a "Map" in java I can easily trace the key by its value, > assuming the values are also unique ? Not that I know of. You could always use two Maps, one for name-to-phone and the other for phone-to-name. If you happen to know *for certain* that names and numbers are never alike, you could use a single Map and enter each item twice, once as name-and-phone and once as phone-and-name. -- Eric.Sosman@sun.com ...

redout of "name", "type" and "value" tags into a string
Hello! I hope you can help me: I have a structure. I can redout and print the structure tags using the TAG_NAMES function. But I also want to readout the "Type" and "Value" tags into a string array. How can I do that? Greetings from Bavaria, Michael On May 21, 5:03 am, BavarianMike86 <jo.mich...@gmx.de> wrote: > Hello! > I hope you can help me: > > I have a structure. I can redout and print the structure tags using > the TAG_NAMES function. > But I also want to readout the "Type" and "Value" tags into a string > array. >...

What is the difference between "VALUE SPACES" and "VALUE ALL SPACES" ?
Hi, I have declared some WS variables and a filler in a COBOL program. I have initialised the filler as "VALUE SPACES". The problem is when i am writing those WS Variables & the filler into a output file, i am getting NULL in the filler.But when i am initialising the filler with "VALUE ALL SPACES", Spaces are coming in the output file. All i want to know, whether there is any difference between "VALUE SPACES" and "VALUE ALL SPACES". If there are no differences then what might be the possible cause for NULL values that are coming in the filler. Regar...

Why pointer to "one past" is allowed but pointer to "one before" is not ?
Why is a pointer allowed to point to one position past the end of an array but not to one position before the beginning of an array ? Is there any reason why the former is more useful than the later ? Spiros Bousbouras spibou@gmail.com wrote: > Why is a pointer allowed to point to one position past > the end of an array but not to one position before the > beginning of an array ? Is there any reason why the > former is more useful than the later ? Consider code such as char *str = somestring; while(*str++) { ... } str might end up one place past somestring - nice to allow tha...

Adding numeric value to a text "Value list"
Adding numeric value to a text "Value list", I am trying to put together a simple to use print quote form, the user will be able to choose a text drop down value, eg: "Booklet single colour" that has a money value, but how do I get the "real" numeric value into the drop down list for the total calculation later? Am I thinking about this wrongly? In article <op.tysj1ia3fs945n@jeremy-g4.local>, Gif <gif@gifcom.ndo.co.uk> wrote: > Adding numeric value to a text "Value list", I am trying to put together a > simple to use print ...

No "F" in "From" header!
(I cross-posted to this NG, comp.mail.misc, comp.os.linux.redhat, and comp.os.linux.misc because I do not know the source of this problem. Sorry!) Frequently, our Red Hat 8/Sendmail 8.11.6/Procmail/Sophos MailMonitor installation has been delivering mail to users with no "F" beginning the "From" header. For example: rom AIU_Los_Angeles@info.iwon.com Wed Sep 24 15:34:03 2003 instead of From AIU_Los_Angeles@info.iwon.com Wed Sep 24 15:34:03 2003 If the problem has occurred in the first (top) message in the mailbox, then the collection is unsuccessful (see error messa...

when should one use "and" and "or"
Hi All, just got hit w the ff > case > when x==1 or x==2 > print "yeoh!" > end SyntaxError: compile error (irb):17: syntax error, unexpected kOR, expecting kTHEN or ':' or '\n' or ';' when x==1 or x==2 ^ "or" and "and" both exhibit the behaviour in ruby1.8/1.9. workaround 1 put parens around the condition (not again) 2 replace or/and with ||/&& i believe there are other similar quirks when using "and/or".. has ruby relegated the use of "and/or"....? best regar...

Setting "text" value to "option" element in IE
I'm creating a select entirely through JavaScript and very strangely IE doesn't show the text in the option elements. Here part of the code: this.form_country=document.createElement("select"); var option; for(var i=0; i<arr.length; i++){ option=document.createElement("option"); option.value=arr[i].code; option.text=arr[i]._value; alert(option.value+" - "+option.text); this.form_country.appendChild(option); } It works perfeclty on FireFox, funny thing is that the alert works properly but there is no way to see any text inside :S Any idea? Of cou...

Should the webserver add "Content-Type: text/xml header" to the requested XML file?
I've been informed that a webserver sending a XML file is supposed to add "Content-Type: text/xml header". I'm not questioning that infromation but i'm unsure what was ment by it. The XML i get on my screen when i type in the url to it looks as follows. <?xml version="1.0" encoding="UTF-8"?> <tag-uno>uno</tag-uno> <tag-duo>duo</tag-duo> I can't see any line containing "text/xml" but perhaps it's not supposed to show in the requested file. Please advise. -- Regards Konrad Viltersten ---------------...

"raise (type, value, traceback)" and "raise type, value, traceback"
Hi, anyone know why these two statements aren't equivalent? raise (type, value, traceback) raise type, value, traceback ...

Web resources about - enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header) - comp.lang.python

Resources last updated: 1/25/2016 12:49:17 PM