Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-05 Thread Jonne Zutt
Thanks for explaining.
Yet another bug that was fixed already :)
There are many that have a text like this is probably fixed already.
Is it a good idea to mark these fixed if the newest bug report is a year
old or something? (or perhaps add a state)

There were many more than 32 wild reports connected to this I guess, but
sf is so slow at the moment I cannot correct the regular expressions,
I'll do it some time later.

On Mon, 2006-09-04 at 18:26 -0400, Youness Alaoui wrote:
 Indeed, that's what I thought, it is FIXED...  I fixed it a while ago, if you 
 looked at sxml.tcl svn log... the regexp changes the   
 into { and } in order to make it into a list, what remains is the starting 
 and ending { } which is why we do a foreach on {$xml} 
 if you do it, your xml :
 test blabla /test


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-05 Thread Youness Alaoui
Ok thx, and I think you gave me a good idea.. 'last bug report date' in the 
statistics... that could be usefull.

On Tue, Sep 05, 2006 at 11:28:41AM +0200, Jonne Zutt wrote:
 Thanks for explaining.
 Yet another bug that was fixed already :)
 There are many that have a text like this is probably fixed already.
 Is it a good idea to mark these fixed if the newest bug report is a year
 old or something? (or perhaps add a state)
 
 There were many more than 32 wild reports connected to this I guess, but
 sf is so slow at the moment I cannot correct the regular expressions,
 I'll do it some time later.
 
 On Mon, 2006-09-04 at 18:26 -0400, Youness Alaoui wrote:
  Indeed, that's what I thought, it is FIXED...  I fixed it a while ago, if 
  you looked at sxml.tcl svn log... the regexp changes the   
  into { and } in order to make it into a list, what remains is the starting 
  and ending { } which is why we do a foreach on {$xml} 
  if you do it, your xml :
  test blabla /test
 
 
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Amsn-devel mailing list
 Amsn-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amsn-devel

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-04 Thread Arieh Schneier
Try replacing:

foreach item {$xml} {

with

foreach item [list $xml] {


Lio.


- Original Message From: Jonne Zutt - 
 Hi all,
 
 Created a new bug this morning #61.
 It has 32 wild reports connected, so does not occur that much.
 I thought it was easy to fix, but it turned out quite tricky.
 There's supposed to be no quoting hell in Tcl (so I've read), but wait
 until you use xml hehe.
 
 Below is the code fragment with the problem in it. One of the wild
 reports looks like this:
 
 list element in braces followed by } instead of space
 while executing
 foreach item {$xml} {
 switch -regexp -- $item {
 ^# {append res {[lrange $item 0 end]}  ; #text item}
 ^/ {
 regexp {/(.+)} $item - tagn...
 (procedure xml2list line 8)
 
 Something like this causes the error I guess:
 
 % set xml } ; foreach item {$xml} { puts Res: $item }
 list element in braces followed by } instead of space
 
 Perhaps it should be foreach item $xml { ... }
 but there's probably a reason for {$xml} isn't it ?
 
 If you look at the code fragment below, I guess the string map replaces
 too much  and that's why the { } do not always match.
 
 And, by the way, bug report statistics just implemented by Youness seem
 messed up (at least for this bug). I'll have a look at that later.
 
 JeeBee.
 
 
 Piece of sxml.tcl:
 
 proc xml2list xml {
 ...
 set xml [string map { \} \{#text \{  \}\} \{}  $xml]
 
 ... 
 foreach item {$xml} {
 switch -regexp -- $item {
 ^# {append res {[lrange $item 0 end]}  ; #text item}
 


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-04 Thread Jonne Zutt
You are probably right. But I wouldn't know how to reproduce
the bug, so it's difficult to try out.
According to 'svn blame' Youness wrote these lines, so perhaps
he could commit your suggestion.

I guess Youness had a reason for writing {$xml} and I'm curious
to what that might be.

JeeBee.


On Mon, 2006-09-04 at 20:35 +1000, Arieh Schneier wrote:
 Try replacing:
 
 foreach item {$xml} {
 
 with
 
 foreach item [list $xml] {
 
 
 Lio.
 
 
 - Original Message From: Jonne Zutt - 
  Hi all,
  
  Created a new bug this morning #61.
  It has 32 wild reports connected, so does not occur that much.
  I thought it was easy to fix, but it turned out quite tricky.
  There's supposed to be no quoting hell in Tcl (so I've read), but wait
  until you use xml hehe.
  
  Below is the code fragment with the problem in it. One of the wild
  reports looks like this:
  
  list element in braces followed by } instead of space
  while executing
  foreach item {$xml} {
  switch -regexp -- $item {
  ^# {append res {[lrange $item 0 end]}  ; #text item}
  ^/ {
  regexp {/(.+)} $item - tagn...
  (procedure xml2list line 8)
  
  Something like this causes the error I guess:
  
  % set xml } ; foreach item {$xml} { puts Res: $item }
  list element in braces followed by } instead of space
  
  Perhaps it should be foreach item $xml { ... }
  but there's probably a reason for {$xml} isn't it ?
  
  If you look at the code fragment below, I guess the string map replaces
  too much  and that's why the { } do not always match.
  
  And, by the way, bug report statistics just implemented by Youness seem
  messed up (at least for this bug). I'll have a look at that later.
  
  JeeBee.
  
  
  Piece of sxml.tcl:
  
  proc xml2list xml {
  ...
  set xml [string map { \} \{#text \{  \}\} \{}  $xml]
  
  ... 
  foreach item {$xml} {
  switch -regexp -- $item {
  ^# {append res {[lrange $item 0 end]}  ; #text item}
  
 
 
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Amsn-devel mailing list
 Amsn-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amsn-devel


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-04 Thread Jonne Zutt
Oh ... found out it isn't necessary to reproduce because the failing xml
code can be found in the status log of the bug reports.
(where it says GOT XML: )

On Mon, 2006-09-04 at 13:43 +0200, Jonne Zutt wrote:
 You are probably right. But I wouldn't know how to reproduce
 the bug, so it's difficult to try out.



-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-04 Thread Youness Alaoui
Hey, sorry, I have to go now, I'll answer you when I get back... but don't 
modify any of that code... you'll find it on wiki.tcl.tk
also, your bug report has 0 reports linked to it... is it normal ? and can you 
give me an example of a failing XML ?
Thanks
KKRT

On Mon, Sep 04, 2006 at 03:33:20PM +0200, Jonne Zutt wrote:
 Oh ... found out it isn't necessary to reproduce because the failing xml
 code can be found in the status log of the bug reports.
 (where it says GOT XML: )
 
 On Mon, 2006-09-04 at 13:43 +0200, Jonne Zutt wrote:
  You are probably right. But I wouldn't know how to reproduce
  the bug, so it's difficult to try out.
 
 
 
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Amsn-devel mailing list
 Amsn-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amsn-devel

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-04 Thread Youness Alaoui
will definitely not work.. this isn't a simple list.. it's 100 times more 
complicated...

KKRT

On Mon, Sep 04, 2006 at 08:35:53PM +1000, Arieh Schneier wrote:
 Try replacing:
 
 foreach item {$xml} {
 
 with
 
 foreach item [list $xml] {
 
 
 Lio.
 
 
 - Original Message From: Jonne Zutt - 
  Hi all,
  
  Created a new bug this morning #61.
  It has 32 wild reports connected, so does not occur that much.
  I thought it was easy to fix, but it turned out quite tricky.
  There's supposed to be no quoting hell in Tcl (so I've read), but wait
  until you use xml hehe.
  
  Below is the code fragment with the problem in it. One of the wild
  reports looks like this:
  
  list element in braces followed by } instead of space
  while executing
  foreach item {$xml} {
  switch -regexp -- $item {
  ^# {append res {[lrange $item 0 end]}  ; #text item}
  ^/ {
  regexp {/(.+)} $item - tagn...
  (procedure xml2list line 8)
  
  Something like this causes the error I guess:
  
  % set xml } ; foreach item {$xml} { puts Res: $item }
  list element in braces followed by } instead of space
  
  Perhaps it should be foreach item $xml { ... }
  but there's probably a reason for {$xml} isn't it ?
  
  If you look at the code fragment below, I guess the string map replaces
  too much  and that's why the { } do not always match.
  
  And, by the way, bug report statistics just implemented by Youness seem
  messed up (at least for this bug). I'll have a look at that later.
  
  JeeBee.
  
  
  Piece of sxml.tcl:
  
  proc xml2list xml {
  ...
  set xml [string map { \} \{#text \{  \}\} \{}  $xml]
  
  ... 
  foreach item {$xml} {
  switch -regexp -- $item {
  ^# {append res {[lrange $item 0 end]}  ; #text item}
  
 
 
 -
 Using Tomcat but need to do more? Need to support web services, security?
 Get stuff done quickly with pre-integrated technology to make your job easier
 Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
 http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
 ___
 Amsn-devel mailing list
 Amsn-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amsn-devel

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel


Re: [Amsn-devel] bug #61 - foreach item {$xml}

2006-09-04 Thread Youness Alaoui
Indeed, that's what I thought, it is FIXED...  I fixed it a while ago, if you 
looked at sxml.tcl svn log... the regexp changes the   
into { and } in order to make it into a list, what remains is the starting and 
ending { } which is why we do a foreach on {$xml} 
if you do it, your xml :
test blabla /test
becomes :
test} {} {{#text blabla} 
so {$xml} becomes
{test} {} {{#text blabla}}
but [list $xml] becomes :
test\} \{\} \{\{#text blabla\}

the reason the bug existed and you still have it in your test app below, is 
because you used ONE regexp, while there are TWO regexps.. you 
need to first trim the string from all \r\t\n, etc... without it, the regexp 
creates a malformed list.. which caused the bug..
the original code (taken from wiki.tcl.tk) trimmed all \t\n but they forgot \r 
.. and the xml we receive had a \r in it, which caused the 
bug... I fixed that a while ago..
this is why we shouldn't touch that code, it's really tricky...

KKRT



On Mon, Sep 04, 2006 at 11:02:25PM +0200, Jonne Zutt wrote:
 Hi Youness,
 
 Here's the xml I obtained from a bug report.
 Did not want to mail it to devel because there are IP addresses in there.
 
 If you cannot fix it quickly, then perhaps let me have another look at it.
 I found more bugs in sxml.tcl already, no support for single quotes if i 
 remember correctly, and even more I believe. That's why I used a better 
 xml parser for that google calendar plugin. We could go that way as well 
 for amsn2, or use a nice python lib for it, guess we need that anyways. 
 Cannot wait before some decisions are made there ;)
 
 I'll check the bug now, because it had 32 wild reports, but I must have 
 changed
 something. I've seen it before that suddenly all linked bugs disappear, 
 don't know why, perhaps connection problems with sf? I noticed your code 
 with the statistics also failed, but didn't have time to figure it out 
 (connection problems too I guess).
 
 JeeBee.
 
 ---/tmp/foo.tcl---
 
 set input 
[SNIP]
 
 set xml [string map { \} \{#text \{  \}\} \{}  $input]
 
 puts Input = $input
 puts XML = $xml
 
 foreach item [list $xml] {
  puts Item: $item
 }
 
 # foreach item {$xml} {
 #   puts Item: $item
 # }
 
 
 Youness Alaoui wrote:
 Hey, sorry, I have to go now, I'll answer you when I get back... but don't 
 modify any of that code... you'll find it on wiki.tcl.tk
 also, your bug report has 0 reports linked to it... is it normal ? and can 
 you give me an example of a failing XML ?
 Thanks
 KKRT
 
 On Mon, Sep 04, 2006 at 03:33:20PM +0200, Jonne Zutt wrote:
   
 Oh ... found out it isn't necessary to reproduce because the failing xml
 code can be found in the status log of the bug reports.
 (where it says GOT XML: )
 
 On Mon, 2006-09-04 at 13:43 +0200, Jonne Zutt wrote:
 
 You are probably right. But I wouldn't know how to reproduce
 the bug, so it's difficult to try out.
   
 

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel