> >As usual, 30 seconds after posting this, I figured it out -- I just
needed
> >to use the same manifest in the applet that was making the .pcurl file
for
> >me (doh!).
> >
> That's what the pcurler tool at curl.host.sk/pcurler/start.curl does. It
> generates an applet for each package with the manifest of the applet and
> the pcurl procedure call.
>
> Friedger
Friedger, you're way out there ahead of me : )
-Chris B.
>
>
>
>As usual, 30 seconds after posting this, I figured it out -- I just needed
>to use the same manifest in the applet that was making the .pcurl file for
>me (doh!).
>
That's what the pcurler tool at curl.host.sk/pcurler/start.curl does. It
generates an applet for each package with the manifest of the applet and
the pcurl procedure call.
Friedger
I meant one the main curlbreaker page. There is the frame (with the
slick curl counter) that asks me again to download the plugin, would be
nice to have a ol' html logo instead. (Does it make more sense now?)
Friedger
Me again : ),
As usual, 30 seconds after posting this, I figured it out -- I just needed
to use the same manifest in the applet that was making the .pcurl file for
me (doh!).
Another lego block in my understanding of what Curl is up to..
-Chris B.
> Hi list,
>
> I'm working on getting a handle on Curl's Manifests, as I'm tired of
> battling with path problems as I develop applications (can be a pain to
> re-organize things...), and I've run into a stumbling block.
>
> I have an applet that defines a manifest that points to two packages --
> BASIC-BUTTON and CMS-LOGIN.
>
> Running the applet works fine -- the manifest is being used to locate all
of
> the needed files/packages.
>
> I've created a .pcurl version of the BASIC-BUTTON, and would like to do
the
> same for the CMS-LOGIN, but the login package uses the BASIC-BUTTON, and
as
> the Manifest is defined in the applet itself, the CMS-LOGIN file doesn't
> know where to look for the BASIC-BUTTON at, and gives me a file not found
> error when I try to pcurl it.
>
> Is there some way to let the CMS-LOGIN package know that it should use the
> same manifest as the applet?
>
> -Chris B.
Thanks Mat,
My understanding of what is going on with this has improved greatly over the
last two days (still some glaring gaps though : )
Appreciate the help from you Curl guys and Juha .
-Chris
> > Does anyone have an example of how to use:
> >
> > HttpFile.http-read-open
> >
> > I'm looking at the various ways to query a web server, and this one
doesn't
> > have an example in the online docs.
> >
> > Thanks,
> > -Chris B.
>
> Here's some more info from one of my fellow engineers, I hope it helps:
>
> It is basically the same as File.read-open, except that you
> have some extra HTTP related parameters.
>
> So you do:
> {define-proc public {open-http-url u:Url}:HttpTextInputStream
> let constant f:HttpFile = {u.instantiate-File} asa HttpFile
> let tis:HttpTextInputStream =
> {f.http-read-open
> request-method = HttpRequest-method.head,
> request-headers =
> {new HttpRequestHeaders, "X-Rocky-Header", "Yoh, Adrian."}
> always-return-response-headers? = true
> }
> {return tis}
> }
>
> The other parameters (beyond what read-open has) that you get are:
> request-data, which is used to send POST data, or some sort of
> HTTP form data (Using HttpFormData or possibly your own
> subclass of HttpRequestData)
> request-headers, with whatever extra HTTP headers you want to send.
> request-method, See above, but lets you choose which HTTP command
> to use (GET, POST, or HEAD for now.)
> auto-redirect?, Indicates if you want HTTP redirects to be followed,
> or if you don't want them to be followed (which will make the
> call throw an exception unless you also use
> always-return-response-headers? = true)
> always-return-response-headers?, Which lets you see the data and
> headers from a "failed" (i.e. not status 200) HTTP request.
>
> And finally it explicitly says that it returns an HttpTextInputStream,
> which has some accessors for HTTP response headers and the like.
> (Note that read-open on an http: Url/File made from an http: Url
> also returns that type, but you need to cast the return value.)
>
> Also there is an http-read-open-byte and async versions of both
> that work similarly to their non-http name sakes, but have the
> above parameters.
>
> William Bardwell
> wbardwel@...
Hi list,
I'm working on getting a handle on Curl's Manifests, as I'm tired of
battling with path problems as I develop applications (can be a pain to
re-organize things...), and I've run into a stumbling block.
I have an applet that defines a manifest that points to two packages --
BASIC-BUTTON and CMS-LOGIN.
Running the applet works fine -- the manifest is being used to locate all of
the needed files/packages.
I've created a .pcurl version of the BASIC-BUTTON, and would like to do the
same for the CMS-LOGIN, but the login package uses the BASIC-BUTTON, and as
the Manifest is defined in the applet itself, the CMS-LOGIN file doesn't
know where to look for the BASIC-BUTTON at, and gives me a file not found
error when I try to pcurl it.
Is there some way to let the CMS-LOGIN package know that it should use the
same manifest as the applet?
-Chris B.
Hi Friedger,
Not quite sure I follow you below.
Sounds like you're viewing the site from a Linux box to me : )
If you know that Curl's not installed (because you're not using Windoze),
then you can either click on the link at the bottom of the index.html
page -- with the switcher applet and javascript on it (you've got 5 seconds
before you're redirected to the 'no Curl plugin page'), or if you end up at
the next page, just click at the link at the bottom.
Somehow I get the feeling you are talking about something else though : )
-Chris B.
----- Original Message -----
From: "Friedger" <curl@...>
To: <curlbreaker-l@yahoogroups.com>
Sent: Thursday, January 23, 2003 4:03 PM
Subject: Re: [curlbreaker-l] *** ANN *** Have updated the 'switcher' article
on cb.com
>
> Can you add an index-without-curl page to your mk3-directory such that
> (sad) people who don't have Curl are not again asked again to download
> or install the plugin when they enter cB via the provided link on the
> switcher page.
>
> Maybe there should be two links:
> 1. "Meanwhile I installed Curl and want to see curlbreaker with curl"
> 2. "Still waiting for the plugin for my OS and want to see curlbreaker
> without curl"
>
> Friedger
>
>
> To unsubscribe from the curlbreaker-l list, send an email to:
> curlbreaker-l-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
Can you add an index-without-curl page to your mk3-directory such that
(sad) people who don't have Curl are not again asked again to download
or install the plugin when they enter cB via the provided link on the
switcher page.
Maybe there should be two links:
1. "Meanwhile I installed Curl and want to see curlbreaker with curl"
2. "Still waiting for the plugin for my OS and want to see curlbreaker
without curl"
Friedger
>
>
>
>>Hi
>>
>>One thought, how does curl work with search engines? if you need a
>>runtime engine on the client then search engines won't be able to
>>index the site?
>>
How do you index java applets? Which key words do you want to use?
Curl has the advantage that the applet files are plain text. One
possibility would be to read the {applet ...} description and look for
the keyword "description" or something like that. We could ask Google
if they would change their robots to index curl applet in a similar way
they do with PDF, PPT or DOC files.
Is there someone who has experiences with developing robots/search
engines and could give some more details?
I think more than indexing via meta tag isn't possible for curl applets.
Friedger
Hi list,
I've updated the article on www.curlbreaker.com to reflect the changes that
I've made over the last several days (thanks for all your input on the
subject!). I think the switcher approach is starting to get close to where
it needs to be -- please let me know if you find any other issues with it.
Thanks,
-Chris
--------------------------------------
Chris Banford
Editor
www.curlbreaker.com
editor@...
--------------------------------------
Hi list,
Was just asked this question (for which I didn't know the answer) and
thought it would be a good one to pass along to the list...
-Chris B.
-----------------------
> Hi
>
> One thought, how does curl work with search engines? if you need a
> runtime engine on the client then search engines won't be able to
> index the site?
>
>
> Best regards
>
> /Tore Nestenius
> WEBMASTER
> http://www.programmersheaven.com
>
> The only thing you can do is write
> your own C dll which "wraps" the SQL dll, using a simpler calling
> convention.
Anybody willing to do that? Grmpf.
Friedger
> Does anyone have an example of how to use:
>
> HttpFile.http-read-open
>
> I'm looking at the various ways to query a web server, and this one doesn't
> have an example in the online docs.
>
> Thanks,
> -Chris B.
Here's some more info from one of my fellow engineers, I hope it helps:
It is basically the same as File.read-open, except that you
have some extra HTTP related parameters.
So you do:
{define-proc public {open-http-url u:Url}:HttpTextInputStream
let constant f:HttpFile = {u.instantiate-File} asa HttpFile
let tis:HttpTextInputStream =
{f.http-read-open
request-method = HttpRequest-method.head,
request-headers =
{new HttpRequestHeaders, "X-Rocky-Header", "Yoh, Adrian."}
always-return-response-headers? = true
}
{return tis}
}
The other parameters (beyond what read-open has) that you get are:
request-data, which is used to send POST data, or some sort of
HTTP form data (Using HttpFormData or possibly your own
subclass of HttpRequestData)
request-headers, with whatever extra HTTP headers you want to send.
request-method, See above, but lets you choose which HTTP command
to use (GET, POST, or HEAD for now.)
auto-redirect?, Indicates if you want HTTP redirects to be followed,
or if you don't want them to be followed (which will make the
call throw an exception unless you also use
always-return-response-headers? = true)
always-return-response-headers?, Which lets you see the data and
headers from a "failed" (i.e. not status 200) HTTP request.
And finally it explicitly says that it returns an HttpTextInputStream,
which has some accessors for HTTP response headers and the like.
(Note that read-open on an http: Url/File made from an http: Url
also returns that type, but you need to cast the return value.)
Also there is an http-read-open-byte and async versions of both
that work similarly to their non-http name sakes, but have the
above parameters.
William Bardwell
wbardwel@...
> let new-size:int = {get-info buf.max-size, buf}
Correction, make that "buf.size". Letting C code write past a
FastArray's "size" is not something people should be doing, even if
the "max-size" indicates there's enough room.
-Mat
> {let getinfo = {api.lookup-proc "mysql_get_client_info",
> {proc-type {}:StringBuf},
> CallingConvention.stdcall
> }}
Unfortunately SharedLibrary has no idea what the actual signature of
the C function 'mysql_get_client_info' is; when you claim it returns
StringBuf in this example, it actually believes you and assumes that's
what the dll does. But of course that dll doesn't really return Curl
StringBuf objects, so the runtime crashes when it tries to treat a C
"string" pointer as a StringBuf.
Unfortunately, the SharedLibrary interface is very basic and lacks the
kind of marshalling to-and-from Curl objects that you would need to
write this cleanly and easily. The only thing you can do is write
your own C dll which "wraps" the SQL dll, using a simpler calling
convention. I wish I had a better story for you, but this isn't a
part of the product we've spent any time on. We only support the
bare-bones interface you need to write everything else.
For example, you could write a C proc like this in your wrapper dll:
__declspec(dllexport) int
wrap_mysql_get_client_info(int buf_max_size, unsigned short *buf)
{
// call mysql_get_client_info here and copy the chars into buf,
// but only up to buf_max_size characters.
}
Then, on the Curl side, you would do something like this:
let get-info:{proc-type {max-size:int, buf:CharVec}:int =
{my-wrapper-dll.lookup-proc
"wrap_mysql_get_client_info",
{proc-type {int, CharVec}:int}, CallingConvention.stdcall}
} asa {proc-type {int, CharVec}:int}
|| Call the wrapper with the simpler calling convention.
let buf:CharVec = {CharVec.from-size 1000, '\u0000'}
let new-size:int = {get-info buf.max-size, buf}
{buf.set-size new-size, '\u0000'}
|| Copy the characters into a StringBuf.
let str:StringBuf = {StringBuf efficient-size = buf.size}
{for c in buf do
{str.append c}
}
This works because a Curl {FastArray-of char} is represented as a
pointer to its first element (some extra header stuff precedes this in
memory), and because Curl uses the C calling convention (with
extensions for keyword arguments, multivalue return, etc.)
You can also pass in a Curl function pointer into C code; this could
work really well if you had a Curl function that, say, appended one
char to a StringBuf. Then you could record that function pointer in a
C global variable and use it as a callback to let C code append to
StringBufs you passed it, etc. which would avoid the bogus buffer size
limit in the example above.
ByteVec (a.k.a. {FastArray-of byte}) is of course also very useful
for passing values to and from C code, such as C strings. Fill
in a ByteVec with your characters and append one 0 byte and you
can pass it to C code as a normal "char *" C string.
I can't claim this hackery will be supported forever; for example, a
future Curl garbage collector that moved objects simply won't work if
external C code is using the pointers. But it will work for a while
at least.
Make sure that any Curl object you pass to C code is still pointed to
by something in your Curl program or it might get garbage collected,
since our garbage collector naturally can't know about your C code.
-Mat
I tried to the libmysql.dll to access my local data base. However, I haven't been successful, although I nearly tried everything. I always get a Memory access violation.
What's wrong? Does anybody have an idea or experiences with it?
Hi Rock,
Great to see you posting again!
> If you can detect 1.2, then you can take users to a page that instructs
> them to uninstall it and then install 2.0.
Before you go for the new version of Curl, could you give the updated applet
a whirl to see if it sends you to the page:
http://www.curlbreaker.com/mk3/old-plug-in-page.htm
If anyone else finds an issue with the switcher applet, please let me know.
-Chris B.
>>>>> "chris" == Chris Banford <chris@...> writes:
>> There may be nobody else in the world with Curl 1.2 still sitting
>> on their Windows box, so perhaps this isn't worth bothering
>> with. I will be upgrading myself shortly.
chris> I hope this is the case, but it's still a good point to bring
chris> up (for those of you Curl engineers listening! :)
We're listening. Speaking of old Curl, the other day I found some
Curl code from 1996 in my home directory, which I wrote when Curl was
still an MIT research project. Sadly, it doesn't still work unchanged. :-)
-Mat
Thanks Friedger, will see about updating the applet.
-Chris B.
> >>If you can detect 1.2, then you can take users to a page that instructs
> >>them to uninstall it and then install 2.0.
> >>
> >Not quite sure if there is a way to trap the older version of Curl --
would
> >be a nice thing to be able to do (and short-circuit the Curl Corp.
message),
> >as it would allow us to customize the message displayed for our users.
> >
> You can detect the curl version using
>
> curl-version or
> curl-version-major
>
> Depending on the result you can adapt the message. Make sure to write all
curl apis in
> the herald
> {curl 1.2, 1.6, 1.7, 2.0 applet}
> {applet license = "development"}
> ...
>
>
> Friedger
Chris Banford wrote:
>>If you can detect 1.2, then you can take users to a page that instructs
>>them to uninstall it and then install 2.0.
>>
>
>Not quite sure if there is a way to trap the older version of Curl -- would
>be a nice thing to be able to do (and short-circuit the Curl Corp. message),
>as it would allow us to customize the message displayed for our users.
>
You can detect the curl version using
curl-version or
curl-version-major
Depending on the result you can adapt the message. Make sure to write all curl
apis in
the herald
{curl 1.2, 1.6, 1.7, 2.0 applet}
{applet license = "development"}
...
Friedger
>
> If you can detect 1.2, then you can take users to a page that instructs
> them to uninstall it and then install 2.0.
Not quite sure if there is a way to trap the older version of Curl -- would
be a nice thing to be able to do (and short-circuit the Curl Corp. message),
as it would allow us to customize the message displayed for our users.
> There may be nobody else in the world with Curl 1.2 still sitting on their
> Windows box, so perhaps this isn't worth bothering with. I will be
> upgrading myself shortly.
I hope this is the case, but it's still a good point to bring up (for those
of you Curl engineers listening! :)
-Chris B.
On Monday 20 January 2003 06:16 am, you wrote:
> Hi Duke,
>
> I've posted an article on the simple applet/javascript combo I'm using to
> filter out those users who don't yet have the Curl RTE installed.
>
> www.curlbreaker.com
>
> When someone finds a problem with its functionality, please let me know :)
>
If you have Curl 1.2 installed (for example), it behaves a bit strange.
You first get the typical popup noting that the curl content does not
match the runtime. However before you can read this message fully and
respond, the JavaScript applet kicks in and also a Curl serialization error
occurs which replaces the original message about updating your runtime.
If you are quick enough and select "no" for updating the runtime, then
the Javascript redirect happens and no other errors occur.
If you are quick enough and select "yes" for updating the runtime, then
you get redirected to the Surge download page and no other erros occur.
Note that the Surge download page does not warn you about the fact that
the installation of th new Curl runtime will fail if you do not first
uninstall the old version of Curl. (I ran into this a couple of weeks ago.)
The Curl team should fix this!
To be most accurate, your page should say "As far as our .., you don't
have version 1.7 or 2.0 of the Curl Runtime Environment installed.
If you can detect 1.2, then you can take users to a page that instructs
them to uninstall it and then install 2.0.
There may be nobody else in the world with Curl 1.2 still sitting on their
Windows box, so perhaps this isn't worth bothering with. I will be
upgrading myself shortly.
Regards,
Rock
Hi Alex,
Thanks for the help -- the converter (although not quite perfect) is *very*
cool!
Are you going to continue to work on it? Let me know if you'd like to have
some input.
Regards,
-Chris
----- Original Message -----
From: "Alex Fedotov" <feal@...>
To: <curlbreaker-l@yahoogroups.com>
Sent: Wednesday, January 22, 2003 8:04 AM
Subject: Re: [curlbreaker-l] Html2Curl (0.0.1.3) for Win32
> Chris Banford wrote:
>
> >Hi Alex,
> >
> >Sorry, but I'm not much of a DOS command line guy --
> >
> >Could you explain exactly how to make your program work? I've gotten
errors,
> >and even crashed Curl, so I'm obviously missing something.
> >
> >-Chris B.
> >
> >
> >
> Hi!
> It test for decoding www.yahoo.com main page.
> Unzip attached file and run file "run.bat".
>
> To unsubscribe from the curlbreaker-l list, send an email to:
> curlbreaker-l-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Thanks Juha, this looks like what I need to get my feet on the ground.
-Chris B.
> >Does anyone have an example of how to use:
>
> HttpFile.http-read-open
>
> >I'm looking at the various ways to query a web server, and this one
doesn't
> >have an example in the online docs.
>
>
> This proc sends a request to the asp page and builds a string from the
> response. Database.xmlComposer is a proc that builds a request string.
>
> --
> Juha Martikainen
>
>
> {define-proc private {getXMLdata mode:String, a:any}:(String,String)
>
> let web-url:Url = {url ASPPath&"default.asp"}
> let http-file:HttpFile = {web-url.instantiate-File} asa HttpFile
>
> {let post-data:HttpXMLRequestData={new HttpXMLRequestData ,""}}
> {let error:String=""}
>
> {set post-data = {HttpXMLRequestData {Database.xmlComposer mode,a}}}
>
> {let request-headers:HttpRequestHeaders = {HttpRequestHeaders}}
>
> {let web-stream:HttpTextInputStream =
> {http-file.http-read-open
> request-data=post-data,
> request-headers=request-headers,
> request-method=HttpRequestMethod.post,
> always-return-response-headers?=true
> }
> }
>
> {let xmldata:String = ""}
> {while true do
> let (liner:StringBuf, n:int) =
> {web-stream.read-one-line}
> {if n == 0 then {break}}
> {let stri:String = {liner.to-String}}
> {set xmldata = xmldata&stri}
> }
> {web-stream.close}
> {return xmldata,error}
> }
>Does anyone have an example of how to use:
HttpFile.http-read-open
>I'm looking at the various ways to query a web server, and this one doesn't
>have an example in the online docs.
This proc sends a request to the asp page and builds a string from the
response. Database.xmlComposer is a proc that builds a request string.
--
Juha Martikainen
{define-proc private {getXMLdata mode:String, a:any}:(String,String)
let web-url:Url = {url ASPPath&"default.asp"}
let http-file:HttpFile = {web-url.instantiate-File} asa HttpFile
{let post-data:HttpXMLRequestData={new HttpXMLRequestData ,""}}
{let error:String=""}
{set post-data = {HttpXMLRequestData {Database.xmlComposer mode,a}}}
{let request-headers:HttpRequestHeaders = {HttpRequestHeaders}}
{let web-stream:HttpTextInputStream =
{http-file.http-read-open
request-data=post-data,
request-headers=request-headers,
request-method=HttpRequestMethod.post,
always-return-response-headers?=true
}
}
{let xmldata:String = ""}
{while true do
let (liner:StringBuf, n:int) =
{web-stream.read-one-line}
{if n == 0 then {break}}
{let stri:String = {liner.to-String}}
{set xmldata = xmldata&stri}
}
{web-stream.close}
{return xmldata,error}
}
Chris Banford wrote:
>Hi Alex,
>
>Sorry, but I'm not much of a DOS command line guy --
>
>Could you explain exactly how to make your program work? I've gotten errors,
>and even crashed Curl, so I'm obviously missing something.
>
>-Chris B.
>
>
>
Hi!
It test for decoding www.yahoo.com main page.
Unzip attached file and run file "run.bat".
Hi List,
Does anyone have an example of how to use:
HttpFile.http-read-open
I'm looking at the various ways to query a web server, and this one doesn't
have an example in the online docs.
Thanks,
-Chris B.
Hi Alex,
Sorry, but I'm not much of a DOS command line guy --
Could you explain exactly how to make your program work? I've gotten errors,
and even crashed Curl, so I'm obviously missing something.
-Chris B.
> Chris Banford wrote:
>
> >Hi Alex,
> >
> >Any instructions on what it does, and how to use it?
> >
> >-Chris B.
> >
> >
> >
> Hi!
> It simple decoder from html format to curl format.
>
> Sample : html2curl.exe test.html test.curl
>
> Program read test.html file and create test.curl.
>
>
>
>
>
> To unsubscribe from the curlbreaker-l list, send an email to:
> curlbreaker-l-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>