[plt-scheme] newbie: web server tutorial questions

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Feb 21 15:15:48 EST 2009

e,

On Sat, Feb 21, 2009 at 12:43 PM, e <eviertel at gmail.com> wrote:
> Jay,
>
> I've modified the code some . . . really still hacking . . . messing with
> the html forms, etc.
>
> What I'm wondering is if you have any suggestions where to go from here.
>
> For example, the blog body is now a textarea, and any carriage returns are
> saved to the sqlite db.  But, even though the body is in a (p) section, when
> they are rendered back to the blog later, the browser ignores them.  Should
> I look into a way to do find and replace in scheme to put in <br> tags?

If you just replace the newlines with "<br>" then it will be escaped
and printed as "&lt;br&gt;", so you need to parse it into an x-expr or
generate a cdata with:

(make-cdata #f #f "<br>Unescaped")

> Also, when making a post, single quotes are not allowed because sqlite gets
> confused.  Again, find-and-replace could be used to modify the input, but
> this seems like a naive way to proceed.

You want to use statements, so you can put ? for the input and the
sqlite library will quote the single quotes for you.

> I'm thinking I should with another suggestion you've made before doing any
> more, and continue through the Snooze example.

I would suggest it again.

Jay

> I could also go even more basic and try to make my way farther into the
> PLT-Scheme manual.
>
> ... mind you, I'm a novice to any sort of web development, at all -- besides
> being new to scheme.  It (the former, at least) seems a lot lot lot harder
> than algorithms development to me since there's so much "magic" going on.
>
> Thanks.
>
> On Fri, Feb 13, 2009 at 6:22 PM, Jay McCarthy <jay.mccarthy at gmail.com>
> wrote:
>>
>> Done!
>>
>> e, Glad to hear you think it is amazing. Let us know if you find
>> anything that could be easier or more amazing.
>>
>> On Thu, Feb 12, 2009 at 7:42 PM, Shriram Krishnamurthi <sk at cs.brown.edu>
>> wrote:
>> > Jay, given the tendency to copy-and-paste code, why not change "path"
>> > to "your-path-goes-here" or something like that?  And doing the same
>> > in general in other parts of the docs?
>> >
>>
>>
>>
>> --
>> Jay McCarthy <jay at cs.byu.edu>
>> Assistant Professor / Brigham Young University
>> http://teammccarthy.org/jay
>>
>> "The glory of God is Intelligence" - D&C 93
>
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.