[fpc-pascal] sqldb, oracle, and mac os x

2009-11-26 Thread Bee Jay

Hi all,

I'm writing a program which connects to a remote Oracle server using  
sqlDB (TOracleConnection). TOracleConnection keeps telling me that  
Oracle client library (libociei.dylib) is not yet installed. However,  
I'm pretty sure that it's already installed correctly since Oracle's  
SQLPlus is already able to connect to the remote database server.


I installed Oracle's Instant Client Basic Package and SQL*Plus Package  
from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html 
 using the 32 bit version (I'm on Leopard Intel). Set the required  
symlinks and environment variables (ORACLE_HOME, DYLD_LIBRARY_PATH,  
SQL_PATH) within /etc/profile, .bash_login, and environment.plist.  
Testing the installation using SQLPlus showed that SQLPlus is able to  
connect to an Oracle database.


I'm using FPC v.2.2.4 and Lazarus 9.29. This is my first experience  
accessing Oracle from Mac OS. I never had this kind of problem while  
on Linux (Ubuntu and CentOS).


Any hints? TIA.

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-13 Thread Bee Jay

We have already merged the wikis, what about merging the forums?
I would propose merging into the Lazarus forum.


Why don't we make our own forum application using fpWeb (or Powtils or  
ExtPascal)? Specially dedicated for FPC and Lazarus users. It can be a  
showcase that pascal (FPC/Lazarus in this case) also can be used to  
build a web application. If we're so proud that our compiler can  
compile itself, why don't we create our own forum? ;)


This might be the right moment.

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-13 Thread Bee Jay
Then it would be possible to make a userfriendly forum and to add  
useful

functions.


Of course, since we have all the source code that we are fluent at. :D  
Another thing is... it could also be a test suite for fpWeb both on  
performance and maintenance which both usually become main  
consideration when one choosing a framework and/or the language. ;)


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-13 Thread Bee Jay
if someone appear with the native pascal forum solution we will  
create a site based on it and merge everything there :)


Is there someone out there had done this (pascal forum)? AFAIK, I only  
knew one: Powtils forum (which is now closed). Honestly, I never used  
fpWeb because I was a Powtils user, and now an ExtPascal user. But if  
there's someone willing to start a new project for pascal forum then  
I'd like to join. :)


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-13 Thread Bee Jay

Time?


I believe I could make a basic forum application within a few days, in  
my spare time, using ExtPascal. But I myself don't think ExtPascal  
would be the correct tool to be used since it creates a non search  
engine friendly application (because of Ajax). I think fpWeb would be  
the best tool because it's provided by FPC and Lazarus (lazWeb), so we  
would have many people to be asked for if we're in trouble. :D


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-14 Thread Bee Jay
The ExtPascal statement is not quite correct; you can perfectly make  
a search-engine friendly site, but you must cater for this when you  
start your design. It diminishes the speed slightly, but not so much  
that it hurts.


Yes, I knew that, though I didn't like it. I still prefer using fpWeb  
as it's provided out-of-the-box by FPC/Lazarus so anybody interested  
with the source code, one doesn't need to bother download from third- 
party component provider.


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-14 Thread Bee Jay
When we planned to move the lazarus forum the same discussion was  
started. It took months without result.


Because not many people know how to build a web application using  
pascal. That's why I propose some of us who have experience with that  
to build one. This project can be used to promote pascal for web  
application development.



Building a proper forum is not something you do in a few days.


Yes, and it would take forever if no one dare to start it. ;)

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-15 Thread Bee Jay
So Bee, register a project on SourceForge or GitHub and start  
coding. Maybe
somebody will contribute at some stage. Like they said in some old  
movie:

"Build it and they will come".


If I made one, then I'll make it using Powtils (fully CGI) or  
ExtPascal (fully Ajax) because that's what I know and have been  
experience with. I myself prefer to use fpWeb since it's provided by  
FPC's FCL. No third party dependency is good for new comers, and it's  
also better FPC/Lazarus promotion. I also intend to study fpWeb and  
would try to combine it with ExtPascal, if possible.


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] midlet pascal and fpc

2009-12-16 Thread Bee Jay

Hi all,

I just knew recently that Midlet Pascal went open source, through FPC  
wiki. Quite a good news, IMO. Since it's now open source, is it  
possible to start working on java byte code generator in FPC based on  
Midlet Pascal code? This will help FPC targetting mobile devices that  
only support java application such as Blackberry. Well, I almost know  
nothing about compiler development, so I just hope it'd be possible  
someday through the help of Midlet Pascal code.


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-17 Thread Bee Jay
So I would recommend going with something closer to home (part of  
FPC) -
like fpWeb. This gives much better certainty that it will be  
continuously
maintained - even if that only means no new feature but at least  
compilable

with latest FPC.


Yes, that's also the main reason of mine to build a web forum using  
fpWeb, instead of Powtils or ExtPascal.


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-17 Thread Bee Jay

Well, fpWeb is winner, yes?
Bee can create a sourceforge project?


If it would use fpWeb then I refuse to be the project owner because I  
almost know nothing about fpWeb. I even intend to study fpWeb from  
this project. The project owner should be someone who knows how to  
build (at least) the application skeleton using the choosen framework  
as the base for further work by someone elses.


BTW, I prefer googlecode to host an open source project.

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Forum merger

2009-12-17 Thread Bee Jay
The advantage of fpweb is that it doesn't matter whether you want to  
use
an apache module, plain cgi or fastcgi, or in a standalone server.  
It works with all 4 types.


Is there any demo or documentation about them, especially the FCGI? I  
only saw CGI demos and very lack of documentation around fpWeb, CMIIW.


I've been spoiled by ExtPascal, and I love the CGI gateway and auto- 
shutdown feature of ExtPascal. Can a similar feature be implemented in  
fpWeb?


How about binding with JS framework for the browser side UI? Also the  
Ajax part. I propose fpWeb to support Google's Closure for that purpose.


Are they possible to be done with fpWeb? How much effort will be  
required to achieve it? Where should we start to work on it?


TIA.

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] mixin feature

2009-12-23 Thread Bee Jay

Hi all,

I'm now studying Qooxdoo (JS framework) to make ExtPascal-like tool  
based on it. Qooxdoo's OO implementation has mixin feature (http://en.wikipedia.org/wiki/Mixin 
). Since this feature is not provided by object pascal language, I  
have trouble writing the library wrapper. For the first step, maybe I  
just could skip the feature. But this would prevent custom widget  
creation of Qooxdoo from pascal. Somehow, I'm curious about it since  
QWT (qooxdoo for GWT) is able to provide mixin in Java which also  
doesn't support mixin. So I think there must be a way to implement it  
in Pascal as well.


Can someone tell me how to implement "fake" mixin feature in pascal?  
Or better, is it possible if FPC provides such language feature? I  
think it's good language feature (compare to sealed class, for  
example) and can be quite useful in some cases.


TIA.

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] mixin feature

2009-12-24 Thread Bee Jay

I'm not aware of any existing AOP framework for Pascal.


I don't think neither GWT or QWT is implementing AOP. CMIIW.

I think the regular way to do this in Object Pascal is via  
implements-style delegation (which doesn't really fake mixins; I  
think it provides exactly the same functionality, just using a  
slightly different concept). I don't think that's already fully  
functional in FPC, but Florian and Sergei (Gorelkin) have recently  
improved it quite a bit.


Yes. I also think class helper feature may provide similar  
functionality. But AFAIK FPC doesn't yet support either feature. :(


--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] mixin feature

2009-12-24 Thread Bee Jay
I don't think class helpers are a real language instrument. They are  
more a

workaround for certain cases when other classes are set in stone.


I know, class helper is only a work around until pascal supports real  
mixin feature. But, with that I'm still able to see a workaround. I  
think I must stay with the first plan, simply ignore mixin and prevent  
custom widget creation. Until FPC support mixin or similar  
functionality.


Thanks.

--

-Bee-

...making buzzes at http://twitter.com/beezing
...writing stories at http://beeography.wordpress.com

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-24 Thread Bee Jay
On 24 Mei 2010, at 22:13, Leonardo M. Ramé wrote:

> With CGI you have one advantage over Apache Modules or Embedded web servers, 
> as far as your "actions" do their work without errors, you don't have to 
> worry about possible memory leaks related to concurrency problems or threads 
> or anything like that, CGI's are much less complex than servers.

That's why I like the CGI gateway mechanism from ExtPascal. The CGI app 
(lightweight) will run the ascociated FCGI app (the true app) if it's not yet 
running. If it's already running, the CGI app acts as request proxy for the 
FCGI app. As FCGI no longer got requests (went idle) for some time, it 
terminates itself. So, you got CGI and FCGI advantages combined. It's also 
easier during development, especially debugging. Well, for some small apps, it 
might be overkill. But, for medium to large apps, with hundreds of concurrent 
requests, it simply shines over plain CGI.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-24 Thread Bee Jay

On 25 Mei 2010, at 24:10, Marcos Douglas wrote:

> "If it's already running, the CGI app acts as request proxy for the FCGI app"
> Would not the oposite?

Because FCGI app is the true worker app. CGI proxy is lightweight app. It does 
nothing but redirecting incoming request and outgoing response, aka proxy. 
Since it's lightweight, the CGI penalty can be ignored.

> A FCGI lightweight app would be the proxy for some CGI apps. The FCGI
> stay in memory, so it is more fast for requests, while CGI app would
> be more specialized.

Take a simple common case, an app that need to connect to a database, run an 
sql query, format the result, send it to client, and close the db connection. 
If it's a CGI app, the whole process is done on every single client request. 
100 incoming request, then 100 times it's done over and over. 

If it's a FCGI app, you could make it connect to database once when it goes up, 
run the sql query once when the first request comes, format the result, send it 
to client, then cache the formatted result. If another similar request coming 
in, since the FCGI app stays in the memory, it could simply re-send the cached 
result without re-connect and re-query to the database. The cache can be 
refreshed (re-query the database) upon some conditional triggers, i.e. time 
interval, number of similar request, or some special kind of request (update 
query, etc). The db connection only need to be closed before the FCGI app is 
about to terminate itself at the end of its session. You can imagine how big 
performance boost you will get. ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-24 Thread Bee Jay

On 25 Mei 2010, at 02:15, Marcos Douglas wrote:

> On Mon, May 24, 2010 at 3:58 PM, Lee Jenkins  wrote:
>> 
>> Why do you need verification?  That information is readily available on
>> ExtPascal's wiki.
>> 
>> http://code.google.com/p/extpascal/wiki/GettingStarted
> 
> Bee said something and Leonardo responded... I want know what Bee
> think about that answer.

Yes, I agree with Leonardo. Another plus is you got better control over FCGI 
app if you're using CGI gateway. You're able to terminate, restart, redirect to 
other app on other machine, etc. without even touching the web server. If 
you're using plain FCGI, you have to stop the entire web server if you want to 
do something with the FCGI app.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-24 Thread Bee Jay

On 25 Mei 2010, at 11:29, Bee Jay wrote:

> 
> On 25 Mei 2010, at 02:15, Marcos Douglas wrote:
> 
>> On Mon, May 24, 2010 at 3:58 PM, Lee Jenkins  wrote:
>>> 
>>> Why do you need verification?  That information is readily available on
>>> ExtPascal's wiki.
>>> 
>>> http://code.google.com/p/extpascal/wiki/GettingStarted
>> 
>> Bee said something and Leonardo responded... I want know what Bee
>> think about that answer.
> 
> Yes, I agree with Leonardo. Another plus is you got better control over FCGI 
> app if you're using CGI gateway. You're able to terminate, restart, redirect 
> to other app on other machine, etc. without even touching the web server. If 
> you're using plain FCGI, you have to stop the entire web server if you want 
> to do something with the FCGI app.

Oh, did I mention live debugging? ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 11:32, Bee Jay wrote:

> Oh, did I mention live debugging? ;)

Oh, did I mention that FCGI is an open standardized protocol that is supported 
by virtually any web servers? That means you could avoid vendor technology 
locked-in, such as Apache mod or IIS ISAPI. ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 14:06, Graeme Geldenhuys wrote:

> I have never looked at FastCGI before, but what you are descibing is
> exactly what I wanted to do with CGI. Create a GUI or Service/Daemon
> application (application server) that the CGI apps talks to. The
> application server would setup the DB connection and stay running. The CGI
> simply forwards requests back and forth.  I'm glad to see my idea is not
> impossible and was already implemented. :-)

ExtPascal had been using this technique since about two years ago! I told you 
about this more than once, but you never listen to me. ;) :D

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 14:43, Graeme Geldenhuys wrote:

> My major concern is vendor lock-in. Something we want to avoid at all costs
> - we have been burnt too many times. So I'll stay away from ExtPascal
> because that requires ExtJS which is a commercial product you have to
> purchase (starting at $729 and going up to $39,129), and what if ExtJS goes
> out of business tomorrow.

Because the exact same reason, ExtPascal got some code refactoring lately. The 
refactoring purpose is to separate FCGI code from ExtJS wrapper code 
(decouple). By using the latest SVN of ExtPascal, you should be able to use the 
FCGI part only without need to bother with the ExtJS part. However, the 
refactoring result isn't yet fully tested and it might leave some coupled code 
behind.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 01:43, Marcos Douglas wrote:
> On Mon, May 24, 2010 at 3:30 PM, Leonardo M. Ramé  
> wrote:
>> Marcos, nobody is saying that you don't have to destroy instances when 
>> programming CGI apps.
> 
> Okay, but if there is not memory leaks...
> I ever free my objects! But I did not know about no memory leaks in
> CGI programs...

Ok, Marcos... let's take a look at the logic of memory allocation. Everytime an 
app need memory, it requests it to the OS. So, OS always knows which part of 
memory belongs to what app. Once the app is terminated, OS will release all the 
memory allocated for the app so it can be used by other apps. This means memory 
leak only happens during the life of an app. The problem is... if your app is 
always running and keep requesting memory that will never be released later, 
the OS will unable to serve memory allocation request from other apps. At the 
end, the OS will be running out of memory, then the whole system will crash. 
That's why memory leak is a serious issue for long time running app such as 
FCGI app, service, daemon, etc. For an app with short life time, this isn't a 
serious issue. Nevertheless, it's a good and recommended practice to make sure 
your app has no memory leaks.

However, there's a chance when memory leak still persist though an app had 
already been terminated. It happens when some apps request for shared memory 
allocation. Since the memory is being used together by some apps, the memory 
will not be released until ALL the apps that using it got terminated. If the 
shared memory also being used by the OS kernel, then it will never be released 
by the OS, unless you restart the whole system. It is a very serious issue.

HTH.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 15:12, Michael Van Canneyt wrote:

> Seems like Graeme is not the only one who is not always listening:

Hahahaha... I know. :D When you point a finger, there are three fingers 
pointing back at you! ;)

> I said several times before, FastCGI exists since a long time in Free Pascal; 
> why would you need ExtPascal code for it ?

Sorry, maybe I missed some of your emails. When I needed FCGI, I found 
ExtPascal first before fpWeb. I found fpWeb when my app had coded mostly using 
ExtPascal. So, I ignored it at that time. Now, I'm considering to use fpWeb for 
my next projects. But, the lack of CGI gateway/proxy support, and knowing 
ExtPascal code got refactor lately, I haven't yet made any decision. Any 
suggestion?

> All in all, I see very little reason for using ExtPascal - if you are
> interested only in the FastCGI code. If you want ExtJS, it's a different
> story.

Though I no longer use ExtPascal, except to maintain 2 legacy web apps that 
already been on production, I still care about this project. Its future is 
still promising to provide web app dev tool using pascal. Especially when 
Wanderlan is starting to work on the web IDE. Perhaps fpWeb got better design 
and all, but the ease of use of ExtPascal made it more attractive to common 
delphi/pascal programmers, especially with ExtP Toolkit. I even promoting it in 
my local delphi/pascal community, along with fpWeb and FreeSpider. More 
alternative is better for the community, I suppose. ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 15:55, Michael Van Canneyt wrote:

> The CGI gateway is on my todo list, as you know.

Now everybody knows. ;)

> Obviously. I think ExtPascal is promising, but sadly suffers from some major
> design flaws (garbage collect, thread model); which prevent me from
> using it: they can (and do) lead to serious memory corruption.

I'm maintaining 2 FCGI apps using CGI gateway. The FCGI app will terminate 
itself after being idle for 30 minutes. So far, everything is fine. Though I 
must admit that once in a while it just hung up but it very rarely happened. 
According to the app log, it only happen twice last year, which made me have to 
kill it manually. Well, I can live with that. :D Maybe it's because the 
suspected memory corruption as you said?

Could you point out which code exactly that lead to serious memory corruption? 
I could propose code review to Wanderlan if I can prove it.

> I still follow its progress, but see no signs that the design flaws will be 
> fixed, even with the recent refactorings :/


Wanderlan is an open minded person. If you could prove the arguments, he will 
listen up to you. ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay
On 25 Mei 2010, at 17:36, Michael Van Canneyt wrote:

> Here I can reliably reproduce the memory corruption. It crashes the output
> regularly. (with random use, it happens 10-15 times a day, in a test 
> enviromnent).

Would you share the test code?

> The bug is in the garbage collector, which attempts to free objects that have 
> already been freed, but were not removed from the garbage collector list.

Again, which part of the code?

> I know that the garbage collector was reworked, but the correct
> implementation would have been to remove the garbage collector
> altogether and use TComponent decsendents instead.

Because the high demand of it, some of us could convince Wanderlan that it 
would make ExtPascal better in the long run. Wanderlan is considering to do 
exactly that. See... ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 20:31, Michael Van Canneyt wrote:

> But maybe the new garbage collector no longer has the problem; in that case,
> my remarks are void.

I hope so. I haven't try the latest SVN either. :D

> Tell him he should also get rid of the one-thread-per-session
> model, because it is simply not correct in many circumstances. It is visible
> in the use of threadvars.

Any suggestion how to do it better?

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 25 Mei 2010, at 23:37, Marcos Douglas wrote:

> My only doubt is: why to use CGI proxy, not a FCGI?

The main purpose of CGI proxy existence is to provide solution for some 
environments where FCGI setup isn't possible. The other advantages are bonuses. 
;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Powtils Apache and Windows Seven 64bits

2010-05-25 Thread Bee Jay

On 26 Mei 2010, at 24:12, Marcos Douglas wrote:

> If the environment allows use FCGI, you would not CGI gateway?

No, because I WANT to use those bonuses. However, by able to use the bonuses, 
you can't negate the main purpose of its existence.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-28 Thread Bee Jay
Hi all,

After a bit studying fpWeb package, especially the FCGI application, I have a 
feature request to it. Would you (Joost? Michael?) please add auto shutdown 
(after some idle time) feature to TFCGIApplication? If you had looked at 
ExtPascal's FCGI implementation, it offers this feature. This feature is to 
prevent the FCGI app keep always running when it actually does nothing (idle). 
For some situations, this feature is usefull and handy. I saw the CGI gateway 
already able to execute local FCGI app if it fails to connect to it.

I know I should supply a patch for this. But I'm not that confident to do it 
because I don't think I already got a good grasp to the code. The class 
hirarchy and dependency is quite complex, at least to me. I'm afraid I'm gonna 
mess them up. :D Or, if you don't have time to do it, please give me some 
lights about how to implement this feature correctly (how and where).

For any response, I thank you in advance. :)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-29 Thread Bee Jay
On 28 Mei 2010, at 23:18, Michael Van Canneyt wrote:

> Unless Joost does it first, I'll have a look at it next week. But it will be 
> under control of an option, and this option will be 'off' by default.

Of course. I agree with that. It'd be nicer if the option can be set from the 
config file, just like the way I implemented it in ExtPascal. Thank you. :)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-29 Thread Bee Jay
On 29 Mei 2010, at 15:36, Michael Van Canneyt wrote:

> The FCL FastCGI class does not have a config file.
> If you want that, you must implement that yourself.

Alright then.

> It is one of the flaws of ExtPascal's implementation: everything is tied
> together, using fixed formats for config files.

Whether it's a flaw or not, it just a matter of POV. Wanderlan seems to be a 
KISS concept lover. When a simpler way could get the job done, then be it. If 
then something more complex is needed, then improve it when the need is here. 
He's a very pragmatic developer, I would say.

> When it would be far better to provide properties which can be set/unset at 
> will: A modular design,
> allowing to re-use the components in setups that the implementor didn't think 
> of.

ExtPascal's code, despite the flaws as you said, is very easy to be understood 
because of its simplicity. Somehow I think it's good to attract new 
contributors because s/he doesn't need too learn a huge beast OO framework 
beneath it. I only needed a mere couple of hours to get a good grasp of it. If 
the code become more complex, a refactoring effort can be done easily. Besides, 
it's (always) a work in progress. I believe it'll evolve, just like the other 
open source projects. ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-29 Thread Bee Jay
On 29 Mei 2010, at 16:52, Michael Van Canneyt wrote:

> Yes, but he chooses a very restrictive approach. As it is, you must
> convince him to change something. With the modular component approach, you 
> don't need to wait.

Why should I have to wait? I got the source code, all of them. If I need some 
new features and I'm able to implement it myself, nobody could prevent me to do 
it. That's why the simplicity of ExtPascal code does matter in some cases.

> He had some very good ideas in ExtPascal, and they are certainly worth 
> looking at.

Yes, before I knew ExtPascal, I never thought such tool can be build (pascal vs 
js ui framework integration). Even Morfik is unable to do it, at least not 
easily. :)

> Let us hope so :-)

Well... it's happening. :)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-30 Thread Bee Jay
On 28 Mei 2010, at 23:18, Michael Van Canneyt wrote:

> I'll have a look at it next week. But it will be under control of an option, 
> and this option will be 'off' by default.

Another thought about this feature. I think it'd be nice if there's an option 
to shutdown the app gracefully. What I mean by gracefully is when the app get a 
shutdown request, and the option is 'on', then the app doesn't suddently 
terminate itself but it waits until all currently active sessions got closed 
and also doesn't accept new sessions. This condition (waiting for termination) 
status can be read by the app through a read-only flag so the app can raise an 
alert to end users announcing that the app is about to close so the users are 
asked to immediately finish their job and quit (logout). So, the app doesn't 
need to wait forever.

What do you think, Michael?

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Between bug?

2010-05-30 Thread Bee Jay
Hi all,

Try the following code snippet:

uses
  DateUtils;
var
  a,b: TDateTime;
  i: integer;
begin
  a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0);
  for i := 0 to 9 do
  begin
b := EncodeDateTime(2010, 1, 1, 0, 0, i, 0);
Writeln(SecondsBetween(a,b):3);
  end;
end;

I think the result isn't correct. It also affects other Between 
functions e.g. SecondsBetween, MinutesBetween, etc. 

But if I changed the milisecond part of a or b or both to anything but 0 then 
the result is correct. Is this a bug? Or did I miss something?

TIA.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpweb fcgi: auto shutdown feature

2010-05-30 Thread Bee Jay
On 30 Mei 2010, at 19:06, Michael Van Canneyt wrote:

> But if you want it, it's really easy to do in fcl-web. Create a webmodule, 
> implement the OnRequest handler of the module, and add
>  Application.Terminate:=True;
>  Handled:=True;
> in the handler. Then register the module with the name 'shutdown'.

Ok, thanks for the hint.

> Obviously, I'd add some security mechanism

Of course. Absolutely, Michael. :)

> But the url
> http://www.yourhost.com/shutdown?password=mysecret
> will still shutdown your app.

Plus SSL. ;)

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Between bug?

2010-05-30 Thread Bee Jay
On 30 Mei 2010, at 19:18, Marco van de Voort wrote:

> IIRC this is normal and delphi compatible and due to TDatetime being a
> floating point type.

No, it's not Delphi compatible. Delphi's result is alot worst, at least on 
Delphi 7. And I didn't ask to make it truly compatible with Delphi. ;)

> *between does a trunc, and
> "time" is a floating point values, so values might be rounded here and
> there.

What if an app need a precise and correct result, say a rocket launcher? :D Is 
there other alternative solution?

> Sometimes the rounding means that e.g. date+1second is rounded to a bit more
> than date + 1second.  Then later secondsbetween sees no whole second between
> and this results in this behaviour.

What about other languages result? C or PHP, for example.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Between bug?

2010-05-30 Thread Bee Jay
On 30 Mei 2010, at 19:28, Jonas Maebe wrote:

> Then it shouldn't use floating point. Ever.

Well... then it shouldn't be using FPC? ;)

Ok, forget about the rocket launcher. The important note that I think need to 
be addressed is the bug only occurs if the milisecond part of a or b is 0. 
Other than 0, then those functions work correctly.

I believe most of us rarely write a program that need precision to milisecond, 
usually we simply put 0 on the milisecond part. The worst thing is, the other 
similar functions e.g. HoursBetween etc. which commonly used are also affected 
by the bug. So, the simple thing could lead to a serious problem.

Should I report this to mantis?

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Between bug?

2010-05-31 Thread Bee Jay
On 30 Mei 2010, at 19:47, Jonas Maebe wrote:

> They should not be using any FPC functionality relying on floating point. Any 
> person who uses floating point should know that by definition it is inexact 
> (ranging from "a little" to "enormously", depending on what you do).

I understand.

> That last sentence is a fundamental principle of any algorithm that uses 
> floating point.

I see.

> If you need exact date/time calculations, you cannot use TDateTime. In fact, 
> several of the TDateTime helpers are literally defined as only offering 
> approximations (e.g. 
> http://www.freepascal.org/docs-html/rtl/dateutils/monthspan.html).

I understand that to have exact and precise date/time calculation, I can't use 
TDateTime. I am not asking for complete rewrite of DateUtils. I was just 
showing a small common mistake that could lead to a serious error in date/time 
calculation for common programming need. The source of the problem is clear. 
Can't we just supply a simple workaround for that bug? Instead of discussion 
about the risk of using floating point calculation.

Say for example, when msec part of a or b (in the previous code snippet) is 
equal to zero, the library will "autocorrect" it to prevent the bug arises. Or, 
the less precise functions e.g. HoursBetween, DaysBetween, etc could simply 
ignore the msec part. Common usage won't care about the msec anyway. The msec 
part would be truly taken into account on MilisecondsBetween function where the 
msec value does matter.

Or, at least, if we don't want to fix it, then state the bug clearly in the 
docs with "won't fix" status or something. So the users would have been warned 
since the beginning (I assume they read the docs) and they can carefully use 
TDateTime especially when involving msec part.

> You have to implement a separate unit that is written from the start to offer 
> the precision that you require if you need more than what TDateTime offers.

I don't need to write a rocket launcher app, yet. :D But if I do, I surely take 
your advice. I just want to use DateUtils unit safely by ignoring msec values 
which could lead to a serious bug while I don't really care about its value.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Between bug?

2010-05-31 Thread Bee Jay
> But if I changed the milisecond part of a or b or both to anything but 0 then 
> the result is correct.

Correction... the bug arises NOT only if the msec part is 0. The bug arises if 
msec part of both variables are EQUAL. If they are different, at least 1 msec, 
then those functions produce correct result.

See how serious the effect cause by this little bug...

> uses
>  DateUtils;
> var
>  a,b: TDateTime;
>  i: integer;
> begin
>  a := EncodeDateTime(2010, 1, 1, 0, 0, 0, 0);
>  for i := 0 to 9 do
>  begin
>b := EncodeDateTime(2010+i, 1, 1, 0, 0, 0, 0);
>Writeln(YearsBetween(a,b):3);
>  end;
> end;


Please note that I'm using YearsBetween in the above test. I'm not talking 
about superb precision in msec. The workaround is pretty trivial. If it 
compares the date part, both should at least have 1 day difference. If it 
compares the time part, both should at least have 1 msec difference. But I 
haven't done a thorough test, I might left other effects behind.

I think it'd be nice if it's corrected right from the DateUtils itself. Should 
I report it as bug?

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] PChar & AnsiString

2010-06-02 Thread Bee Jay
On 1 Jun 2010, at 22:13, spir ☣ wrote:

> (*) And to some more constructs in other languages, like foreach (*the* 
> feature I miss in freepascal):
>   foreach name in names do ... end;

http://wiki.freepascal.org/for-in_loop

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] PChar & AnsiString -- for-in loop enumerator

2010-06-02 Thread Bee Jay

On 2 Jun 2010, at 20:09, spir wrote:

>> http://wiki.freepascal.org/for-in_loop
> 
> Is this implemented? (unable to make it work -- the compiler refuses the 
> for...in notation)

AFAIK, yes. At least, I know it's already in trunk since a while ago. Never use 
it myself though.

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] The new book: "WEB and database programming with fpc and Lazarus for newbies and professionals"

2010-06-17 Thread Bee Jay
On 18 Jun 2010, at 02:58, Burkhard Carstens wrote:

> What about ExtJS being GPL licensed? Got a developer license? 

Yes, if you make commercial apps.

> Here you refere to the ExtJS components of fpweb, right? IOW. if those 
> are (or will be) universal, they should get renamed? (see, you are in 
> that stuff, so for you, all this is clear. for a newbie (at least for 
> me), it's still all confusing .. so having clear and distinct names 
> would help.. e.g. if it's about the fpWeb components for use with ExtJS 
> JavaScript Framework, they should be called fpExtJS components ..)

fpWeb is general purpose framework. You may use it with any JS frameworks out 
there. Michael had made an example how to use it with ExtJS. So, fpWeb is 
already an apropriate name, IMO.

> Yes, thanks! It does make more and more sense. Unfortunately, my 
> customers are not (yet) interested in web apps, so it's just a hobby 
> right now. Therefore it will take some time before I gain ground in 
> this.

Good for you. My clients had demanded web app, from previous desktop app, since 
about 4 years ago. This year they are asking about mobile app support. What a 
coincidence, I saw ExtJS became Sencha right about time. It's my luck, I guess. 
:D

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] MongoDB Driver for FPC

2010-08-22 Thread Bee Jay
> Does anyone know of a FPC driver implementation for MongoDB ?

check this out: http://code.google.com/p/pebongo/

-Bee-

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal