Re: Re[2]: [fpc-pascal] fpWeb and html and uri escaping/unescaping elements

2011-05-25 Thread ik
On Tue, May 24, 2011 at 12:21, José Mejuto joshy...@gmail.com wrote: Hello FPC-Pascal, Tuesday, May 24, 2011, 10:09:03 AM, you wrote: i I've created a patch with the Escape and unEscape functions, and place it i here: http://bugs.freepascal.org/view.php?id=19407 Un/escapeHTML parsing

Re: [fpc-pascal] Re: TimSort

2011-05-25 Thread Marco van de Voort
In our previous episode, Mattias Gaertner said: A quick look at wikipedia will show that timsort has a disadvantage too. It needs up to N records memory, not just Log(n) records like e.g. Quicksort. It *can* be implemented to need only log(n). But the current fpc implementation of

RE : Re[2]: [fpc-pascal] fpWeb and html and uri escaping/unescapingelements

2011-05-25 Thread Ludo Brands
You should not unescape recursively. Input to EscapeHTML: 'lt;' Output: 'amp;lt;' : Correct UnescapeHTML: input 'amp;lt;' Output '' Wrong. This is because you replace 'amp;' with '' resulting in 'lt;' which is translated to ' ' in the next line. Ludo -Message d'origine- De :

Re: RE : Re[2]: [fpc-pascal] fpWeb and html and uri escaping/unescapingelements

2011-05-25 Thread ik
On Wed, May 25, 2011 at 10:09, Ludo Brands ludo.bra...@free.fr wrote: You should not unescape recursively. Input to EscapeHTML: 'lt;' Output: 'amp;lt;' : Correct UnescapeHTML: input 'amp;lt;' Output '' Wrong. This is because you replace 'amp;' with '' resulting in 'lt;' which is

Re: [fpc-pascal] Re: TimSort

2011-05-25 Thread Mattias Gaertner
On Wed, 25 May 2011 09:02:46 +0200 (CEST) mar...@stack.nl (Marco van de Voort) wrote: In our previous episode, Mattias Gaertner said: A quick look at wikipedia will show that timsort has a disadvantage too. It needs up to N records memory, not just Log(n) records like e.g.

RE : [fpc-pascal] fpWeb and html and uri escaping/unescaping elements

2011-05-25 Thread Ludo Brands
This is a very minimalistic implementation covering only partial ascii character escaping. To cover ASCII only in unescapeHTML you should also add 'nbsp' which corresponds with the space character ' '. Also the format #entity_number; is missing ('lt;' or '#60;' equals '') To support iso-8859-1

Re[4]: [fpc-pascal] fpWeb and html and uri escaping/unescaping elements

2011-05-25 Thread José Mejuto
Hello FPC-Pascal, Wednesday, May 25, 2011, 8:33:57 AM, you wrote: amp;lt; i I'm not sure what you mean here. That's an already escaped html. Let it be a mini htmlpage: htmltitle-amp;lt;-/title/html i If you have already html entities you should not escape them. If you do not i have html

Re[2]: [fpc-pascal] Re: TimSort

2011-05-25 Thread José Mejuto
Hello FPC-Pascal, Wednesday, May 25, 2011, 9:02:46 AM, you wrote: MvdV For heavier sorting I usually use heapsort and quicksort routines that date MvdV back to my M2 days MvdV Usually heapsort since it is quite fast for already sorted collections. Instead HeapSort you can use SmoothSort which

RE : RE : Re[2]: [fpc-pascal] fpWeb and html and uriescaping/unescapingelements

2011-05-25 Thread Ludo Brands
So you suggest to place the amp; translation last. That would be a solution for this problem. My previous comments on the minimalistic approach of the implementation suggest a different approach: scan the source string once and replace html entities as you find them (with a look up table for

Re: RE : RE : Re[2]: [fpc-pascal] fpWeb and html and uriescaping/unescapingelements

2011-05-25 Thread ik
On Wed, May 25, 2011 at 14:04, Ludo Brands ludo.bra...@free.fr wrote: So you suggest to place the amp; translation last. That would be a solution for this problem. My previous comments on the minimalistic approach of the implementation suggest a different approach: scan the source string

Re: RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Roberto Padovani
2011/5/24 Ludo Brands ludo.bra...@free.fr: The following delphi articles should help creating an event sink: http://www.informit.com/articles/article.aspx?p=130494seqNum=5  This is an interesting one since it is written for Delphi 3-4 which missed a lot of the automated COM handling. This is

RE : RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Ludo Brands
Interfaceconnect calls Advice on the objects IConnectionPoint. I can't share Delphi code here but essentially what you do is: Get IConnectionPointContainer (CPC) from IUnknown (ActiveXObject) : ActiveXObject.QueryInterface(IConnectionPointContainer, CPC); Get IConnectionPoint (ppcp) for the

Re: RE : RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Roberto Padovani
2011/5/25 Ludo Brands ludo.bra...@free.fr: Regarding the tlb to pascal conversion, AFAIK there is no support in fpc. Delphi is clearly better equiped to work with COM objects. I have also been playing around with a generic eventsink class but the problem is that events can have parameters

[fpc-pascal] Re: fpc-pascal Digest, Vol 83, Issue 52

2011-05-25 Thread Luis Fernando Del Aguila Mejía
El 25/05/2011 01:35 a.m., fpc-pascal-requ...@lists.freepascal.org escribió: Question out of curiosity: Is there a reason why you allocate an array by hand? Yes, getmem return NIL, when no more memory is available. SetLength, no return NIL, It is work with Exceptions. My intention was whether

RE : RE : RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Ludo Brands
The code in article http://www.informit.com/articles/article.aspx?p=130494seqNum=5 goes a long way in doing what you want to do. Unit Eventsink does pretty much of the legwork. You should remove the procedure register since that is the Delphi way to get a component on the toolbar. Remove also the

[fpc-pascal] Re: Suffix Trie implementation, please review

2011-05-25 Thread leledumbo
I guess you forgot the attachment? My bad... well it was midnight here ;) There you go: http://free-pascal-general.1045716.n5.nabble.com/file/n4425751/suffixtrie.zip suffixtrie.zip BTW, do you know the hashtrie component? Only ever heard of, never know the details. Thanks, this could be a

Re: RE : RE : RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Roberto Padovani
2011/5/25 Ludo Brands ludo.bra...@free.fr: The code in article http://www.informit.com/articles/article.aspx?p=130494seqNum=5 goes a long way in doing what you want to do. Unit Eventsink does pretty much of the legwork. You should remove the procedure register since that is the Delphi way to

Re: [fpc-pascal] getmem

2011-05-25 Thread Luis Fernando Del Aguila Mejía
El 25/05/2011 01:35 a.m., fpc-pascal-requ...@lists.freepascal.org escribió: Question out of curiosity: Is there a reason why you allocate an array by hand? Yes, getmem return NIL, when no more memory is available. SetLength, no return NIL, It is work with Exceptions. My intention was whether

RE : RE : RE : RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Ludo Brands
Using variants you can transparently walk along the exposed objects. The variant contains the Idispatch of the object and gets the exposed methods at runtime. Properties are implemented as get and put methods or just get methods for read only properties. If you have something like Itransducers

Re: RE : RE : RE : RE : RE : RE : [fpc-pascal] support for using an activex

2011-05-25 Thread Roberto Padovani
Always thanks! Given your evident experience on this matter, I kindly ask your advice on what is best to do. opt 1) create a fpc class with some pascal style methods, which in their implementation use variants and call the IDevice class with late-binding . meaning that there is no compiler