Re: [fpc-pascal] identifier scope problem
try prefixing by the unit name: procedure tcls.method(x,y: tt); begin if a.equals(x,y) then ... end; Thierry leledumbo wrote: consider the following code snippet: unit a; interface type tt = ... tcls = class procedure method(x,y: tt); end; function equals(x,y: tt): boolean; implementation function equals(x,y: tt): boolean; begin ... end; procedure tcls.method(x,y: tt); begin if equals(x,y) then ... end; end. In the code above, equals will refer to tobject.equals instead of equals defined in the unit. How can I refer to that one instead? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] identifier scope problem
On Mon 3 May 2010, leledumbo wrote: > In the code above, equals will refer to tobject.equals instead of equals > defined in the unit. How can I refer to that one instead? I'm unable to reproduce your error. Real code that I could actually compile and run would make this a lot easier. That said, have you tried unitname.equals? Cheers, David ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] identifier scope problem
consider the following code snippet: unit a; interface type tt = ... tcls = class procedure method(x,y: tt); end; function equals(x,y: tt): boolean; implementation function equals(x,y: tt): boolean; begin ... end; procedure tcls.method(x,y: tt); begin if equals(x,y) then ... end; end. In the code above, equals will refer to tobject.equals instead of equals defined in the unit. How can I refer to that one instead? -- View this message in context: http://old.nabble.com/identifier-scope-problem-tp28443031p28443031.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC + 64bit Windows => anybody?
On 3 May 2010 17:08, Jonas Maebe wrote: > > http://www.freepascal.org/download.var lists all available stable releases. I did look there, but only now did I see the Win64 at the bottom of the list. :-( Initially I saw the first one as "Win32, Win64 and WinCE", but the link takes you to Win32 download, so I was a bit confused/uncertain. -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On 3 May 2010 20:38, Marcos Douglas wrote: > BTW, is tiOPF life? Not 100% sure what you mean. Maybe "is it alive?" If so, yes tiOPF is still actively being used and developed. A new branch was started recently to work on tiOPF3 features which will include Unicode support (but FPC is lagging behind Delphi on that one now). tiOPF2 is very stable for many years already - hence the reason there are less commits than say 5 years ago, but that is just a sign that framework+applications are working well, not that tiOPF is dead. -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On 3 May 2010 17:10, Lee Jenkins wrote: > > I am most interested to hear how tiOPF handles under a threaded environment > when you move to FastCGI, Graeme. Well, Peter H. and others have used tiOPF in a threaded environment for years, so it does work. The only threaded part of tiOPF that I have use thus far is loading some lookup data in a background thread while users are logging in, and used the threaded debugging output (debug to file, GUI and console) all at once without degrading application speed. All debug output is cached output (except for console) and thread safe - works perfectly under our test systems (Windows and Linux). But yes, I am very eager to switch to FastCGI, to help manage open database connections (normally the slowest code in any desktop/web app). -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] optional parameter
On Mon, 3 May 2010 14:28:13 -0300 Flávio Etrusco wrote: > > Needed to change the > > parameter to be a pointer to the record instead (so the default can be > > nil), but this creates a > > trap for the calling code. > > Else, is there a common trick or workaround? > > > > What trap? Simply that the caller must know a pointer must be passed instead of the parameter. And think at it everytime. Denis vit esse estrany ☣ spir.wikidot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] optional parameter
On Mon, 03 May 2010 19:15:57 +0100 Martin wrote: > On 03/05/2010 10:58, spir ☣ wrote: > > Hello, > > > > A few questions on the topic: > > > > * Is it possible to define an optional parameter without default value? > > > > * Is it at all possible for an optional *argument* not to be the last in > > actual call? Eg > > procedure p(a:Integer=0 ; b:Integer=0) > >How can the caller pass b and not a? > > > > * The ref states: "For dynamic arrays or other types that can be considered > > as equivalent to a pointer, the only possible default value is Nil." > > Does this apply to any non-atomic type? Which are the "other types that can > > be considered as equivalent to a pointer"? > > Tried with a record, but cannot make it be accepted by the compiler. Needed > > to change the parameter to be a pointer to the record instead (so the > > default can be nil), but this creates a trap for the calling code. > > Else, is there a common trick or workaround? > > > > Maybe you want to use overloading instead of optioanl parameters? > > Procedure Foo; overload; // no params > Procedure Foo(SomeRecord: TRecordType); overload; // no params > > then of course you need to implement twice > > Procedure Foo; > var a: TRecordType; > begin > a:= xxx;/your defaults >Foo(a); > end; > > Procedure Foo(SomeRecord: TRecordType); > begin >/ do work > end; Right, thank you, did not know "overload". This seems to be a good solution. Denis vit esse estrany ☣ spir.wikidot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Marcos Douglas wrote: Lee Jenkins wrote: My goals in its development has been to ensure that the framwork overall: A) Not tied to any particular GUI front-end, they should be swappable. I should be able to present my Model/Controller (or other business logic) in different UI's such as Flex, Silverlight, ExtJS, Dojo, OpenLaszlo, etc while still keeping 95% of the code on the server. His framework already supports all of these UI?! No. Only a partially finished Flex UI and the Dojo UI I'm working on now. My point was that would be possible to "plug in" different UI's. B) Any server platform or protocol. For instance, you should be able to deploy your application using what ever server protocol that is appropriate for the job. So feasibly you should be able to deploy your server app to FastCGI, Apache Module, ISAPI or even a stand alone synapse based HTTP server like I am using for testing. This is very interesting ... but you are not creating too many options? If there are many options, more harder it is to understand, isn't? I don't think so because the framework itself doesn't incorporate any communication protocols. Using your favorite existing Server platform (like fpWeb/LazWeb) you write a small method for when a request comes in like the one below to handle the request/response: var lApp: TRiaApplication; begin lApp := FServer.ServerPool.RetrieveOrCreateApplication(URI, lSessionOID); try lApp.HandleClientRequest(InputData, OutputData, Cookies); // Pass back and new or changed cookies to the server. if lApp.OutCookies.Count > 0 then begin for lCounter := 0 to lApp.OutCookies.Count - 1 do begin OutCookies.Add(lApp.OutCookies[lCounter]); end; end; finally FServer.ServerPool.ReleaseApplication(lApp); end; end; InputDate is the post data received from the client and OutputData is a stream that will contain the response to send to the client. So in your server application, you're just feeding the TRiaApplication with simple data to handle the request and sending back to the client the data that TRiaApplication provides back in the OutputData stream. Its always works the same way, since TRiaApplication doesn't care where InputData and OutputData come from so you can use any server platform and then simply feed the TRiaApplication as indicated. The TRiaApplication.HandleClientRequest method has two overloads that can take either Streams or Strings: procedure HandleClientRequest(const AInput: string; var AReturnString: string; ACookies: TStringList); overload; virtual; procedure HandleClientRequest(AInStream, AOutStream: TStream; ACookies: TStringList); overload; virtual; -- Warm Regards, Lee ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Graeme Geldenhuys wrote: > > All HTML code (inside our pascal code) is tagged with class of div id's. We > then use CSS to adjust our UI the way we want. > > For inspiration of this concept, have a look at: > http://www.csszengarden.com/ > > All the pages (themes) available is all build with the exact same HTML file > (nobody is allowed to change that file), just the CSS files are different. > Pretty awesome! Interesting... OK, thanks to sharing this idea. > Our CGI applications (three of them) are just one part of our complete > product. We have a desktop GUI part as well. The CGI applications reuse a > lot of code from the desktop. We implement the Model-GUI-Mediator design > pattern, to split UI code from Business Domain code. Our applications talk > to a Firebird RDBMS, and use SqlDB components, but we do *not* code for > SqlDB directly. Instead we use tiOPF (http://www.tiopf.com) which is a > Object Persistence Framework to manage all our data persistence (loading > and saving of Objects). So with a single compiler define we can switch from > Firebird to MySQL or PostgreSQL etc without a single line of code that > needs to change. We can even switch database components (eg: SqlDB -> > FBLib) with a single compiler define, and again, no lines of code need to > change. Right. I also use an OPF made-in-home, but this is out of scope CGI's problems. BTW, is tiOPF life? Lee Jenkins wrote: > > I am most interested to hear how tiOPF handles under a threaded environment > when you move to FastCGI, Graeme. Me too. -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Lee Jenkins wrote: > > Yes, I had plans to release it open source when its ready for testing, > probably within 3-4 weeks from now. This is great! > The idea of the framework is mainly based on Proxy pattern. You build your > gui within the server session, similar to how ExtPascal does it though with > a more VCL/LCL kinds of model than ExtPascal. however, note that it doesn't > use VCL/LCL and is based non-gui objects like TInterfacedPersistent to avoid > dependencies on Lazarus LCL or Delphi VCL. Interesting! > My goals in its development has been to ensure that the framwork overall: > > A) Not tied to any particular GUI front-end, they should be swappable. I > should be able to present my Model/Controller (or other business logic) in > different UI's such as Flex, Silverlight, ExtJS, Dojo, OpenLaszlo, etc while > still keeping 95% of the code on the server. His framework already supports all of these UI?! > B) Any server platform or protocol. For instance, you should be able to > deploy your application using what ever server protocol that is appropriate > for the job. So feasibly you should be able to deploy your server app to > FastCGI, Apache Module, ISAPI or even a stand alone synapse based HTTP > server like I am using for testing. This is very interesting ... but you are not creating too many options? If there are many options, more harder it is to understand, isn't? > Think of it as using the client UI as a puppet, with the server telling the > client what to display through a two-way event system. > > Here is a short screencast of the framework using the Flex UI layer. Note > that its pretty old and the framework has come a long way since this > screencast and as I said, I'm going through some refactoring now since I > have to change some things for the customer anyway. Thanks for the link! -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] optional parameter
On 03/05/2010 10:58, spir ☣ wrote: Hello, A few questions on the topic: * Is it possible to define an optional parameter without default value? * Is it at all possible for an optional *argument* not to be the last in actual call? Eg procedure p(a:Integer=0 ; b:Integer=0) How can the caller pass b and not a? * The ref states: "For dynamic arrays or other types that can be considered as equivalent to a pointer, the only possible default value is Nil." Does this apply to any non-atomic type? Which are the "other types that can be considered as equivalent to a pointer"? Tried with a record, but cannot make it be accepted by the compiler. Needed to change the parameter to be a pointer to the record instead (so the default can be nil), but this creates a trap for the calling code. Else, is there a common trick or workaround? Maybe you want to use overloading instead of optioanl parameters? Procedure Foo; overload; // no params Procedure Foo(SomeRecord: TRecordType); overload; // no params then of course you need to implement twice Procedure Foo; var a: TRecordType; begin a:= xxx;/your defaults Foo(a); end; Procedure Foo(SomeRecord: TRecordType); begin / do work end; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] optional parameter
2010/5/3 spir ☣ : > Hello, > > A few questions on the topic: > > * Is it possible to define an optional parameter without default value? > > * Is it at all possible for an optional *argument* not to be the last in > actual call? Eg > procedure p(a:Integer=0 ; b:Integer=0) > How can the caller pass b and not a? No and no. > * The ref states: "For dynamic arrays or other types that can be considered > as equivalent to a pointer, the only possible default value is Nil." > Does this apply to any non-atomic type? Which are the "other types that can > be considered as equivalent to a pointer"? Class, AnsiString. > Tried with a record, but cannot make it be accepted by the compiler. Needed > to change the > parameter to be a pointer to the record instead (so the default can be nil), > but this creates a > trap for the calling code. > Else, is there a common trick or workaround? > What trap? -Flávio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC + 64bit Windows => anybody?
There is a 64-bit cross compiler for Windows, and I have been using it over the last few months. I am porting my company's loan calculation DLL from Delphi to FPC. This was initially done to support 32-bit linux, but the pace has picked up due to a client who wants to know when a 64-bit version will be available for Windows. A 64-bit version of Delphi is nowhere to be seen, and no one at Embarcadero will even talk about when it will be available, hence my efforts with FPC. The results so far have been fairly promising, as I now have shared libraries for all 4 platforms (Win 32/64, Linux 32/64). There have been a few hiccups along the way, but I have worked most of them out. The only thing I need to work on now is improving the speed of the 64-bit Windows port - it is just extremely sluggish compared to the other 3 platforms, and I'm not sure why. Good luck, Alan On Mon, May 3, 2010 at 8:08 AM, Jonas Maebe wrote: > > On 03 May 2010, at 15:53, Graeme Geldenhuys wrote: > > > Does FPC support 64-bit Windows? If so, is it stable (like 64-bit Linux) > or > > still experimental? > > http://www.freepascal.org/download.var lists all available stable > releases. > > > Jonas > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Graeme Geldenhuys wrote: Our CGI applications (three of them) are just one part of our complete product. We have a desktop GUI part as well. The CGI applications reuse a lot of code from the desktop. We implement the Model-GUI-Mediator design pattern, to split UI code from Business Domain code. Our applications talk to a Firebird RDBMS, and use SqlDB components, but we do *not* code for SqlDB directly. Instead we use tiOPF (http://www.tiopf.com) which is a Object Persistence Framework to manage all our data persistence (loading and saving of Objects). So with a single compiler define we can switch from Firebird to MySQL or PostgreSQL etc without a single line of code that needs to change. We can even switch database components (eg: SqlDB -> FBLib) with a single compiler define, and again, no lines of code need to change. I am most interested to hear how tiOPF handles under a threaded environment when you move to FastCGI, Graeme. -- Warm Regards, Lee ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC + 64bit Windows => anybody?
On 03 May 2010, at 15:53, Graeme Geldenhuys wrote: > Does FPC support 64-bit Windows? If so, is it stable (like 64-bit Linux) or > still experimental? http://www.freepascal.org/download.var lists all available stable releases. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC + 64bit Windows => anybody?
Hi, I often hear of developers using FPC on 64-bit Linux. My development machine is the same. But I can't say I have ever heard of anybody using 64-bit Windows with FPC. Does FPC support 64-bit Windows? If so, is it stable (like 64-bit Linux) or still experimental? Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Marcos Douglas het geskryf: > > There are HTML code inside Pascal code? All HTML code (inside our pascal code) is tagged with class of div id's. We then use CSS to adjust our UI the way we want. For inspiration of this concept, have a look at: http://www.csszengarden.com/ All the pages (themes) available is all build with the exact same HTML file (nobody is allowed to change that file), just the CSS files are different. Pretty awesome! > Thanks for the file. > So, you don't have any lib dependencies in your aplications? Our CGI applications (three of them) are just one part of our complete product. We have a desktop GUI part as well. The CGI applications reuse a lot of code from the desktop. We implement the Model-GUI-Mediator design pattern, to split UI code from Business Domain code. Our applications talk to a Firebird RDBMS, and use SqlDB components, but we do *not* code for SqlDB directly. Instead we use tiOPF (http://www.tiopf.com) which is a Object Persistence Framework to manage all our data persistence (loading and saving of Objects). So with a single compiler define we can switch from Firebird to MySQL or PostgreSQL etc without a single line of code that needs to change. We can even switch database components (eg: SqlDB -> FBLib) with a single compiler define, and again, no lines of code need to change. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Lee Jenkins wrote: Here is a short screencast of the framework using the Flex UI layer. Note that its pretty old and the framework has come a long way since this screencast and as I said, I'm going through some refactoring now since I have to change some things for the customer anyway. http://preview.tinyurl.com/18r Not sure why TinyURL spazzed out with the first link but here is on that works: http://preview.tinyurl.com/23uewfx -- Warm Regards, Lee ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Marcos Douglas wrote: Hi Lee, So I'm taking advantage of the extra time and refactoring the framework a bit and implementing a DHTML UI layer now. We looked at ExtJS as well as YahooUI, OpenLaszlo and a few of the others and eventually decided on Dojo javascript tookit, but different UI layers can be plugged in. Heck, even an LCL or fpGUI layer is feasible. Your project is open source? I'm very interested about that. Do you use some "template engine" for UI? The tecnology WebBroker (old Delphi) had macros for replace in events like #name or #salary. That is very simply but very coupled. We had HTML code coupled with Pascal code. The designers could not easily change UI code because that. Yes, I had plans to release it open source when its ready for testing, probably within 3-4 weeks from now. The idea of the framework is mainly based on Proxy pattern. You build your gui within the server session, similar to how ExtPascal does it though with a more VCL/LCL kinds of model than ExtPascal. however, note that it doesn't use VCL/LCL and is based non-gui objects like TInterfacedPersistent to avoid dependencies on Lazarus LCL or Delphi VCL. My goals in its development has been to ensure that the framwork overall: A) Not tied to any particular GUI front-end, they should be swappable. I should be able to present my Model/Controller (or other business logic) in different UI's such as Flex, Silverlight, ExtJS, Dojo, OpenLaszlo, etc while still keeping 95% of the code on the server. B) Any server platform or protocol. For instance, you should be able to deploy your application using what ever server protocol that is appropriate for the job. So feasibly you should be able to deploy your server app to FastCGI, Apache Module, ISAPI or even a stand alone synapse based HTTP server like I am using for testing. Think of it as using the client UI as a puppet, with the server telling the client what to display through a two-way event system. Here is a short screencast of the framework using the Flex UI layer. Note that its pretty old and the framework has come a long way since this screencast and as I said, I'm going through some refactoring now since I have to change some things for the customer anyway. http://preview.tinyurl.com/18r -- Warm Regards, Lee ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On Mon, May 3, 2010 at 11:07 AM, Graeme Geldenhuys wrote: > > No templates and hard-crafted UI with our own HTML and CSS markup. Our CGI > apps have a very dynamic interface which is build from information stored > in a database. There are HTML code inside Pascal code? > I only know about FastCGI. I have never really looked at how it works yet. > We do use PWU (Powutils), but actually just one or two methods, not much > really. We can actually remove the dependency on PWU. > > The version of PWU that we use are available for download in the following > URL. The latest version in the PWU repository doesn't compile for us, for > some months now. The project seems dead. > > http://opensoft.homeip.net/~graemeg/pwu-1.6.0.2.tar.gz Thanks for the file. So, you don't have any lib dependencies in your aplications? -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Marcos Douglas het geskryf: > > What do you use in UI? > What about templates, do you use? No templates and hard-crafted UI with our own HTML and CSS markup. Our CGI apps have a very dynamic interface which is build from information stored in a database. > If you have some news about on learning FastCGI, tell us, please. I only know about FastCGI. I have never really looked at how it works yet. We do use PWU (Powutils), but actually just one or two methods, not much really. We can actually remove the dependency on PWU. The version of PWU that we use are available for download in the following URL. The latest version in the PWU repository doesn't compile for us, for some months now. The project seems dead. http://opensoft.homeip.net/~graemeg/pwu-1.6.0.2.tar.gz Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On Mon, May 3, 2010 at 9:41 AM, Graeme Geldenhuys wrote: > At the moment we use plain CGI apps. > I forgot: Do you continues using cgiapp unit? Have you seen Powtils? Here http://wiki.lazarus.freepascal.org/CGI_Web_Programming recommends. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On Mon, May 3, 2010 at 9:41 AM, Graeme Geldenhuys wrote: > Marcos Douglas het geskryf: >> >> I do not knew about this! Can you post a few links of companies using >> ExtPascal? Would be very good to post these links in list of >> ExtPascal. > > Many are developers I read about in the Lazarus and FPC-users mailing list. > > >> What about do you think about performance of CGI apps? > > At the moment we use plain CGI apps. Even though our application needs to > create on every user interaction a new database connection, our application > is still sufficiently fast. Only after two years of development, did I find > out about FastCGI and how it differs. So as soon as time permits, I will be > porting our CGI apps to FastCGI - simply to keep database connections open, > and keep other lookup lists in memory - this should improve performance a lot. What do you use in UI? What about templates, do you use? If you have some news about on learning FastCGI, tell us, please. -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On Mon, May 3, 2010 at 9:37 AM, Rainer Stratmann wrote: > > I don't know what CGI is. > Here http://wiki.lazarus.freepascal.org/CGI_Web_Programming -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On Mon, May 3, 2010 at 9:37 AM, Rainer Stratmann wrote: > I don't know what CGI is. Nevertheless I was able to program a webserver > completely in freepascal. It isn't that complicate (if you have time). > If a connection comes in then I prove how many connections are already open, > and if it exceeds the max_connection value (which I set to 20 now) then I > close immediately the new incoming connection. If you want I show you sample > code. I work with nonblocked sockets. So everything is in one thread. I will appreciate it very much see this code, thanks! -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Hi Lee, On Sun, May 2, 2010 at 3:10 PM, Lee Jenkins wrote: > > * Virtual Private Hosting is really cheap now, largely alleviating the > problem of deploying native executables to web servers like FastCGI, ISAPI, > apache_mod, etc. Yes, you right. > I am working on a project now for RIA similar in concept to ExtPascal, but > abstracting out the UI framework with most of the logic executing on the > server so that I can plug in different UI's without touching my > model/controller. That is what I looking for! That is what I looking for! I do not want to use ExtPascal because it depends on ExtJS and their documents (to generate the Pascal code). I wish I could choose the JavaScript framework. > I was about 90% finished with the Flex UI layer when the customer whose site > I'm writing, got spooked by all the Apple/Adobe/HTML5 debate that has heated > up and became adamant about not using flash based UI, limiting Flash to > playing video where necesary and using DHMTL for client UI. > > So I'm taking advantage of the extra time and refactoring the framework a > bit and implementing a DHTML UI layer now. We looked at ExtJS as well as > YahooUI, OpenLaszlo and a few of the others and eventually decided on Dojo > javascript tookit, but different UI layers can be plugged in. Heck, even an > LCL or fpGUI layer is feasible. Your project is open source? I'm very interested about that. Do you use some "template engine" for UI? The tecnology WebBroker (old Delphi) had macros for replace in events like #name or #salary. That is very simply but very coupled. We had HTML code coupled with Pascal code. The designers could not easily change UI code because that. -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Marcos Douglas het geskryf: > > I do not knew about this! Can you post a few links of companies using > ExtPascal? Would be very good to post these links in list of > ExtPascal. Many are developers I read about in the Lazarus and FPC-users mailing list. > What about do you think about performance of CGI apps? At the moment we use plain CGI apps. Even though our application needs to create on every user interaction a new database connection, our application is still sufficiently fast. Only after two years of development, did I find out about FastCGI and how it differs. So as soon as time permits, I will be porting our CGI apps to FastCGI - simply to keep database connections open, and keep other lookup lists in memory - this should improve performance a lot. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Am Monday 03 May 2010 14:24:48 schrieb Marcos Douglas: > On Sun, May 2, 2010 at 2:29 PM, Graeme Geldenhuys > > wrote: > > Some reasons: > > * Free Pascal is open source (always available and no vendor lock-in) > > * Free Pascal is free, so can always use latest version at NO cost. > > * Previous skills from Delphi 7 project can be reused. No need to > > retrain developers. Saving 1000's in cost. > > * Previous business domain code can be reused. Saving hundreds of hours > > in development time. > > * No runtime or VM is required to run apps (unlike PHP, C# or Java). > > * Development tools are free and again open source. > > Yes, are good reasons. > > > I know of many developers or companies using ExtPascal to write web > > apps. I unfortunately have not looked at it yet. I started our CGI > > apps long before I found out about ExtPascal. > > I do not knew about this! Can you post a few links of companies using > ExtPascal? Would be very good to post these links in list of > ExtPascal. > > Well, ExtPascal use FastCGI approach. People say FastCGI is more > powerful than CGI, because the application continues in memory... > What about do you think about performance of CGI apps? > > > On Sun, May 2, 2010 at 3:09 PM, Rainer Stratmann > > wrote: > > Here is a Web Server programmed entirely in Freepascal: > > http://ip.klimaregelung.de/ip.php?action=connect&benutzercode=Stratmann > > No Apache or PHP or something else. > > > > Because it is a small embedded computer at home only 20 connections at a > > time are possible. But it would be possible to expand with more powerful > > computers. > > Do you use FastCGI or CGI? > How do you limits max connections? I don't know what CGI is. Nevertheless I was able to program a webserver completely in freepascal. It isn't that complicate (if you have time). If a connection comes in then I prove how many connections are already open, and if it exceeds the max_connection value (which I set to 20 now) then I close immediately the new incoming connection. If you want I show you sample code. I work with nonblocked sockets. So everything is in one thread. best regards, Rainer > > -- > Marcos Douglas > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
On Sun, May 2, 2010 at 2:29 PM, Graeme Geldenhuys wrote: > > Some reasons: > * Free Pascal is open source (always available and no vendor lock-in) > * Free Pascal is free, so can always use latest version at NO cost. > * Previous skills from Delphi 7 project can be reused. No need to retrain > developers. Saving 1000's in cost. > * Previous business domain code can be reused. Saving hundreds of hours > in development time. > * No runtime or VM is required to run apps (unlike PHP, C# or Java). > * Development tools are free and again open source. Yes, are good reasons. > I know of many developers or companies using ExtPascal to write web > apps. I unfortunately have not looked at it yet. I started our CGI > apps long before I found out about ExtPascal. I do not knew about this! Can you post a few links of companies using ExtPascal? Would be very good to post these links in list of ExtPascal. Well, ExtPascal use FastCGI approach. People say FastCGI is more powerful than CGI, because the application continues in memory... What about do you think about performance of CGI apps? On Sun, May 2, 2010 at 3:09 PM, Rainer Stratmann wrote: > Here is a Web Server programmed entirely in Freepascal: > http://ip.klimaregelung.de/ip.php?action=connect&benutzercode=Stratmann > No Apache or PHP or something else. > > Because it is a small embedded computer at home only 20 connections at a time > are possible. But it would be possible to expand with more powerful > computers. Do you use FastCGI or CGI? How do you limits max connections? -- Marcos Douglas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] linked list to criticize
On Sun, 2 May 2010 22:20:43 +0200 Felipe Monteiro de Carvalho wrote: > Hello, > > I think it would be good if you add a link to your package here: > > http://wiki.lazarus.freepascal.org/Components_and_Code_examples > Thanks, I'll add it there if some of you test it. (Self-testing one's own tool, from my experience, is not reliable for making it public.) The only builtin check is about index interval --but with Pascal type-checking I cannot find any other need. An issue is that it's not a generic container: items are typed at programming time (ints in original code for illustration). (But it's not such problematic for people using exclusively OO, I guess, since they can use a root class.) Denis vit esse estrany ☣ spir.wikidot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] linked list to criticize
On Mon, 3 May 2010 16:02:32 +1000 "Paul Nicholls" wrote: > Hi Denis, > nice :) > > I'm curious, why didn't you make it a class...wouldn't that have made it > nicer/easier to use and program? Yes, for sure. Not beeing able to use the OO syntax is really a pain! (Even inside the LinkedList unit itself.) But it is all what we miss, I guess. One point for me precisely was to write it from scratch, without any higher-level OO structure (object, class). Explore the techniques and issues of writing OO-like code in a language that would not come equipped with such a framework. A side-question is also to avoid overloading code with a prebuilt OO layer, for efficiency (*). I take the opportunity to ask about the speed cost of using FreePascal's class-system vs plain Pascal. And the same about using objects vs plain records. I have no idea about this. Are there some data about this? Denis (*) Even more because in a while I intend to write a custom OO system (prototype-based). Building it on top FreePascal's class system makes a double OO layer, from client code(s point of view. PS: I have slightly changed the online code: * Replaced methods in correct order (for me), thank to one of you pointing me to "forward" :-) * List_new now accepts directly an optional array of startup elements, not a pointer to it (I discovered arrays can have a 'nil' default.) vit esse estrany ☣ spir.wikidot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] optional parameter
Hello, A few questions on the topic: * Is it possible to define an optional parameter without default value? * Is it at all possible for an optional *argument* not to be the last in actual call? Eg procedure p(a:Integer=0 ; b:Integer=0) How can the caller pass b and not a? * The ref states: "For dynamic arrays or other types that can be considered as equivalent to a pointer, the only possible default value is Nil." Does this apply to any non-atomic type? Which are the "other types that can be considered as equivalent to a pointer"? Tried with a record, but cannot make it be accepted by the compiler. Needed to change the parameter to be a pointer to the record instead (so the default can be nil), but this creates a trap for the calling code. Else, is there a common trick or workaround? Denis vit esse estrany ☣ spir.wikidot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] linked list to criticize
I don't wish to sound negative here, but I think something like doubly-linked lists is fundamental and doesn't need an implementation specially made for the FPC community, unless it needs to be adapted to the language implementation itself or the execution environment. There must be dozens of implementations out there in textbooks and even in languages other than Pascal and it should be possible to check the code against that, just by inspection alone, not even by running tests. If it has to fit into some preferred FPC libraries, or the FPC community's ways of working that's okay, but its correctness should never be in doubt before it goes in. On 2 May 2010 21:20, Felipe Monteiro de Carvalho < felipemonteiro.carva...@gmail.com> wrote: > Hello, > > I think it would be good if you add a link to your package here: > > http://wiki.lazarus.freepascal.org/Components_and_Code_examples > > -- > Felipe Monteiro de Carvalho > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > -- Frank Church === http://devblog.brahmancreations.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] linked list to criticize
Paul Nicholls het geskryf: > > I'm curious, why didn't you make it a class...wouldn't that have made it > nicer/easier to use and program? My thoughts too. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
duilio foschi het geskryf: > how do I build a minimal 'hello world' CGI application under Free Pascal ? Can't get simpler than this: - program cgitest; {$mode objfpc}{$H+} uses Classes; begin writeln('Content-Type:text/html',#10#13); writeln(''); writeln('FPC Test'); writeln('Hello World'); writeln(''); end. --- Output is shown in the attached screenshot. Obviously you need a webserver to correctly view the results. Simply install Apache and enable CGI support (if not enabled by default). As you can see from the sample application, CGI apps are simply glorified console applications. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ <>___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] linked list to criticize + generics
> I'm curious, why didn't you make it a class...wouldn't that have made it > nicer/easier to use and program? +1 It should be a class, yes. Now you have loads of global functions. The integer data type doesn't make much sense but your comment says it will be changed to generics type. That sounds good. Container classes are maybe the only place where generics really are useful. I often derive a list from TObjectList and redefine its "Items" property and "GetItem" + "SetItem" methods just to get a compiler type checking for correct type and to avoid type-casting later in code, and to benefit from Lazarus' hint and code completion features. Generics would do the same thing easier. Once I had to maintain a Java program made without generics. The first thing I did, even before understanding the code much, was to define generics type for all containers by guessing it from type-casts. It helped me to understand the code better and to avoid errors later when changing it. I even spotter clear errors (wrong type-casts) in the original code. With Eclipse's hints and code completion it was a huge improvement. Object Pascal generics containers + Lazarus would give the same benefits. If someone is working on the generic containers this linked list effort should be added there (after making it a class and adding generics support). Actually it should be coordinated somehow because the containers could share some code. Delphi 2009 introduced generic containers which have some clever code. I think it needs effort to support native types like string and arrays. Supporting only class types (TObject->) would be easier. Without generics support the linked list data type could be TObject which lets you forget the pointer syntax. Sometimes it causes overhead but it is very small compared to virtual machine overhead (Java, .NET etc.) while the syntax is about equally clear. Regards, Juha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] TCgiApplication in cgiapp unit - mostly deprecated
Lele, I need instructions for _dumbier_ users :) 1. == >After hosted, CGI can now be used normally as >http://www.yourserver.com[.xx]/yourlogin/cgi-bin/cginame.exe (I will use my web browser, I suppose...) However I have no web site on my server... :( So where to store and how to call the application ? 2. == what should I see on screen ? Thank you Peppe 2010/5/3 leledumbo : > >> how do I build a minimal 'hello world' CGI application under Free Pascal ? >> >> Where do I find 'instructions for dummies' ? > > Have a look http://wiki.lazarus.freepascal.org/CGI_Web_Programming here . > > -- > View this message in context: > http://old.nabble.com/TCgiApplication-in-cgiapp-unit---mostly-deprecated-tp28413954p28432080.html > Sent from the Free Pascal - General mailing list archive at Nabble.com. > > ___ > fpc-pascal maillist - fpc-pas...@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal