Re: [Chicken-users] html-sxml (html-parser egg) does not decode entities in html attributes, ideas why?

2013-09-04 Thread Philip Kent
Hi Alex,

Thanks for your email.

I'm somewhat confused by what you say. Through investigation, it seems 
html-sxml will decode entities, so long as they aren't within a HTML element 
attribute. Could you clarify on whether that default applies globally or just 
to attributes?

Thanks,
Philip


From: Alex Shinn alexsh...@gmail.com
Sent: 04 September 2013 03:51
To: Philip Kent
Cc: chicken-users@nongnu.org
Subject: Re: [Chicken-users] html-sxml (html-parser egg) does not decode 
entities in html attributes, ideas why?

On Tue, Sep 3, 2013 at 11:19 PM, Philip Kent 
phi...@knodium.commailto:phi...@knodium.com wrote:
Hi all,

I noticed an issue today with the html-parser egg, where it does not seem to 
decode entities within an attribute of an element, I have included an example 
below.

#;14 (html-sxml div data-foo=\quot;\)
(*TOP* (div (@ (data-foo quot;

Expected: (*TOP* (div (@ (data-foo \

I was wondering if anyone could provide some thoughts as to why this might be 
happening? I have taken a look at the html-parser egg but have not seen much 
(but then this goes far beyond my knowledge of scheme!)

html-parser processes entities, but the default for html-sxml
is just to leave the encoded as-is.  I'm not sure if that's the best
default, but will at least provide a convenient option to get
the decoded strings.

--
Alex

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] html-sxml (html-parser egg) does not decode entities in html attributes, ideas why?

2013-09-04 Thread Philip Kent
Hi Alex,

Excellent! Thanks for looking into it and for the tip re custom parsers - I was 
trying to understand that code!

Philip


From: Alex Shinn alexsh...@gmail.com
Sent: 04 September 2013 14:00
To: Philip Kent
Cc: chicken-users@nongnu.org
Subject: Re: [Chicken-users] html-sxml (html-parser egg) does not decode 
entities in html attributes, ideas why?

On Wed, Sep 4, 2013 at 8:23 PM, Philip Kent 
phi...@knodium.commailto:phi...@knodium.com wrote:
Hi Alex,

Thanks for your email.

I'm somewhat confused by what you say. Through investigation, it seems 
html-sxml will decode entities, so long as they aren't within a HTML element 
attribute. Could you clarify on whether that default applies globally or just 
to attributes?

Yes, sorry, I misread my own code :)

The default is to _decode_ entities:

#;1 (html-sxml quot;)
(*TOP* \)

And as you say, it currently doesn't just process attributes:

#;2 (html-sxml div data-foo=\quot;\)
(*TOP* (div (@ (data-foo quot;

I'll fix this.

What I was referring to before is that you can customize
what is done with entities with

 (make-html-parser 'entity: (lambda (name) ...))

and can customize non-default entity names:

 (make-html-parser 'entities: '((quot . \) ...))

but again, these are currently ignored in attributes.

--
Alex

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] possible dependency issue with message-digest egg

2013-09-04 Thread Brian St. Pierre

I'm using message-digest 3.0.5 and csc 4.7.0 on ubuntu 12.04 x86_64

This minimal example works fine in the interpreter but fails when compiled:

(use sha1 message-digest)
(display (message-digest-file (sha1-primitive) mysha1.scm))
(newline)

The error is:

% ./mysha1

Error: call of non-procedure: #unbound value

Call history:

##sys#require   
##sys#require   
##sys#require   
mysha1.scm:2: sha1#sha1-primitive   
mysha1.scm:2: message-digest-item#message-digest-file --

In the process of experimenting, I noticed that adding 'posix' as a 
dependency would fix the error. This program works as expected:


(use sha1 message-digest posix)
(display (message-digest-file (sha1-primitive) mysha1.scm))
(newline)

I don't know enough about how dependencies are supposed to work to know 
if this is the right way to solve it, but this patch makes the first 
program above work as expected:


--- message-digest-item.scm (revision 29704)
+++ message-digest-item.scm (working copy)
@@ -20,7 +20,8 @@

   (require-library
 message-digest-type
-message-digest-update-item)
+message-digest-update-item
+posix)

 ;;; Single Source API

--
Brian St. Pierre


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] [Q] Are there any egg for timer based scheduler like cron?

2013-09-04 Thread Sungjin Chun
Hi,

I want to create a program which do some tasks with following condition;

1. During 08:00 to 16:00 (hour) of each day,
2. the task will run every 2 seconds (or minutes or so).

The time for completing task is very tiny, for example 0.01ms to 1 sec. In
Lisp(SBCL),
I have used timer package but I cannot find equivalent one for chicken
scheme.

Thanks in advance.
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [Q] Are there any egg for timer based scheduler like cron?

2013-09-04 Thread Ivan Raikov
Hi Sungjin,

   Have you tried the scron egg?

-Ivan


On Thu, Sep 5, 2013 at 12:58 PM, Sungjin Chun chu...@gmail.com wrote:

 Hi,

 I want to create a program which do some tasks with following condition;

 1. During 08:00 to 16:00 (hour) of each day,
 2. the task will run every 2 seconds (or minutes or so).

 The time for completing task is very tiny, for example 0.01ms to 1 sec. In
 Lisp(SBCL),
 I have used timer package but I cannot find equivalent one for chicken
 scheme.

 Thanks in advance.

 ___
 Chicken-users mailing list
 Chicken-users@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users