Re: [fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread Graeme Geldenhuys
On 18/10/2011 21:44, Michael Van Canneyt wrote: > > use DBUS to query HAL. Normally you should get most of the info. > > I wrote an article on how to do this in FPC. if you want, I can send it to > you. Would you mind sending me that article too, please. I'm using Turbo Power's OnGuard in our

Re: [fpc-pascal] CGI under Freepascal

2011-10-18 Thread Graeme Geldenhuys
On 18/10/2011 16:51, Michael Van Canneyt wrote: > > You can always search for powtils, but as far as I know it is unmaintained. I use powtils (aka pwu), and it works very well. We have 3 CGI apps developed with powtils, connecting to a database backend etc. It is easy to use and relatively easy

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Sven Barth
Am 18.10.2011 23:08, schrieb Andrew Pennebaker: Barth, something's not quite right. I've compiled and installed the trunk version of fpc, but it won't recognize this syntax. paycheck.pas: unit Paycheck; interface type TArray = array of T; ... Trace: fpc example.pas Compiling example.pas Compi

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Sven Barth
Am 18.10.2011 21:59, schrieb Jonas Maebe: On 18 Oct 2011, at 21:55, Sven Barth wrote: type TGenArray = array of T; // this should work in trunk already function Concat(Arr1, Arr2: TGenArray): TGenArray; begin SetLength(Result, Length(aArray1) + Length(aArray2)); if Length(aArray1)> 0

Re: [fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread Jorge Aldo G. de F. Junior
I think all this info can be found on /proc directory... 2011/10/18 ik : > Hello list, > > I'm trying to figure out how to get hardware information about the machine > i'm running at in Linux OS. > For example: hard-drive size, manufacture etc... > BIOS information, screen information (regardless

Re: [fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread Den Jean
On Tuesday 18 October 2011 19:36:48 ik wrote: > Does anyone know or can point me on how to do it ? read the output of lshw or read its source on how to do it yourself. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Andrew Pennebaker
The procedural typesdoc is informative, thanks for the suggestion. Eh, much humor will be lost on me. I'm a Pascal newbie, so if you suggest function pointers, even with (satire!) comments, that's what I'll use. Pointers do the jo

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Andrew Pennebaker
Barth, something's not quite right. I've compiled and installed the trunk version of fpc, but it won't recognize this syntax. paycheck.pas: unit Paycheck; interface type TArray = array of T; ... Trace: fpc example.pas Compiling example.pas Compiling paycheck.pas paycheck.pas(4,8) Fatal: Syntax

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Roland Schäfer
On 10/18/2011 10:23 PM, Andrew Pennebaker wrote: > Schäfer, thanks, that's a lot of practical information. Have you used > Haskell QuickCheck In fact, I have, but I don't see the connection. > Yes, pointers are probably the only way I can implement this, for now. If at > all possible, I'd like to

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Andrew Pennebaker
Schäfer, thanks, that's a lot of practical information. Have you used Haskell QuickCheck? It's amazing that such a strictly typed language can do these sorts of things. Yes, pointers are probably the only way I can implement this, for

Re: [fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread Sven Barth
On 18.10.2011 21:50, ik wrote: On Tue, Oct 18, 2011 at 21:44, Michael Van Canneyt mailto:mich...@freepascal.org>> wrote: On Tue, 18 Oct 2011, ik wrote: Hello list, I'm trying to figure out how to get hardware information about the machine i'm running at in Linux O

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Jonas Maebe
On 18 Oct 2011, at 21:55, Sven Barth wrote: > > type > TGenArray = array of T; // this should work in trunk already > > function Concat(Arr1, Arr2: TGenArray): TGenArray; > begin > SetLength(Result, Length(aArray1) + Length(aArray2)); > if Length(aArray1) > 0 then >Move(aArray1[0], Resul

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Sven Barth
On 18.10.2011 21:30, Jonas Maebe wrote: On 18 Oct 2011, at 20:03, Andrew Pennebaker wrote: In particular, if anyone knows a way to implement a general concatenation function Concat(Arr1, Arr2), let me know. I'm under the impression that you are trying to program in a statically typed langua

Re: [fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread ik
On Tue, Oct 18, 2011 at 21:44, Michael Van Canneyt wrote: > > > On Tue, 18 Oct 2011, ik wrote: > > Hello list, >> >> I'm trying to figure out how to get hardware information about the machine >> i'm running at in Linux OS. >> For example: hard-drive size, manufacture etc... >> BIOS information, s

Re: [fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread Michael Van Canneyt
On Tue, 18 Oct 2011, ik wrote: Hello list, I'm trying to figure out how to get hardware information about the machine i'm running at in Linux OS. For example: hard-drive size, manufacture etc... BIOS information, screen information (regardless of X, that is the hardware itself), cards that

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Sven Barth
On 18.10.2011 21:27, Roland Schäfer wrote: Sven pointed out yesterday that you cannot achieve in FPC what you want to achieve. (I haven't used Delphi in a long time and don't know what exactly anonymous functions are in Delphi, but I strongly tend to trust his word.) You can't get anonymous but o

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Alberto Narduzzi
anonimous types, thrice, generic array concatenation, interpreting Pascal, anonymous functions... I'm guessing what language you come from. Then, the second question arises: why Pascal, now. Anyway, I think that immersing yourself in some classes and pointer logic could help you find some so

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Jonas Maebe
On 18 Oct 2011, at 20:03, Andrew Pennebaker wrote: > In particular, if anyone knows a way to implement a general concatenation > function Concat(Arr1, Arr2), let me know. I'm under the impression that you are trying to program in a statically typed language the same way as you'd use a dynamical

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Roland Schäfer
On 10/18/2011 8:10 PM, Andrew Pennebaker wrote: > Sokol, I'm writing a function GenArray(generator) that returns a random > array populated by calling the generator function. So the return type of > GenArray matches "array of" the return type of the generator function, for > any generator function.

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Andrew Pennebaker
Sokol, I'm writing a function GenArray(generator) that returns a random array populated by calling the generator function. So the return type of GenArray matches "array of" the return type of the generator function, for any generator function. E.g., GenArray(GenChar) would return a random string.

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Andrew Pennebaker
In particular, if anyone knows a way to implement a general concatenation function Concat(Arr1, Arr2), let me know. Cheers, Andrew Pennebaker www.yellosoft.us On Tue, Oct 18, 2011 at 1:59 PM, Andrew Pennebaker < andrew.penneba...@gmail.com> wrote: > Thrice is designed to work for *any* array ty

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Andrew Pennebaker
Thrice is designed to work for *any* array type, e.g. arrays of arrays of arrays of bytes. Even if I hardcoded several thousand possible types, Thrice wouldn't work for custom user types. If you do find a way to make this work, please let me know. Cheers, Andrew Pennebaker www.yellosoft.us On T

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Andrew Pennebaker
RRUZhas the answer: const XLAT_SIZE = 53; xlat : Array[0..XLAT_SIZE-1] of Integer = ( $64, $73, $66, $64, $3b, $6b, $66, $6f, $41, $2c, $2e, $69, $79, $65, $77, $72, $6b, $6c, $64, $4a, $4b, $44, $4

[fpc-pascal] Getting Hardware information in Linux

2011-10-18 Thread ik
Hello list, I'm trying to figure out how to get hardware information about the machine i'm running at in Linux OS. For example: hard-drive size, manufacture etc... BIOS information, screen information (regardless of X, that is the hardware itself), cards that are assigned and the whole information

Re: [fpc-pascal] CGI under Freepascal

2011-10-18 Thread Michael Van Canneyt
On Tue, 18 Oct 2011, Luciano de Souza wrote: Hello listers, I am trying to use CGI with Pascal. I don't have background in web development, but principles of CGI seems to be simple. [snip] The variety of projects under Freepascal is so big that I will be not surprised with other solu

Re: [fpc-pascal] CGI under Freepascal

2011-10-18 Thread Felipe Monteiro de Carvalho
I think that fpweb is the best option, since most people seam to be using it. But the wiki has an example about how to do a more simple CGI app: http://wiki.lazarus.freepascal.org/CGI_Web_Programming The provided minimal example teaches all the basics. -- Felipe Monteiro de Carvalho __

[fpc-pascal] CGI under Freepascal

2011-10-18 Thread Luciano de Souza
Hello listers, I am trying to use CGI with Pascal. I don't have background in web development, but principles of CGI seems to be simple. The first way could be FPWeb. However, I prefer another solution even if it is the best bet. It requires complex compilations and configurations since it's

Re: [fpc-pascal] Re: fpweb and reading the contents of a request

2011-10-18 Thread Felipe Monteiro de Carvalho
On Tue, Oct 18, 2011 at 11:35 AM, herux wrote: > Try using Indy or Synapse as HttpClient to send data content  using HTTP POST > with the parameters as you mean. my FPWeb success to do it using PHP via > CURL. !? My problem was sending data from JavaScript to FPWeb, I fail to see how any of this

Re: [fpc-pascal] Re: fpweb and reading the contents of a request

2011-10-18 Thread Sven Barth
Am 18.10.2011 11:35, schrieb herux: Try using Indy or Synapse as HttpClient to send data content using HTTP POST with the parameters as you mean. my FPWeb success to do it using PHP via CURL. I guess this is not a limitation of HTTP, just not the standard for web scripting One should at least

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Sven Barth
Am 18.10.2011 11:33, schrieb Sven Barth: Am 18.10.2011 11:19, schrieb Vincent Snijders: 2011/10/18 Sven Barth: Am 18.10.2011 11:12, schrieb Sven Barth: type TByteArray = array of Byte; function XlatPrime(): TByteArray; begin XlatPrime := TByteArray.Create( $64, $73, $66, $64, $3b, $6b, $66,

[fpc-pascal] Re: fpweb and reading the contents of a request

2011-10-18 Thread herux
Try using Indy or Synapse as HttpClient to send data content using HTTP POST with the parameters as you mean. my FPWeb success to do it using PHP via CURL. I guess this is not a limitation of HTTP, just not the standard for web scripting - - -- View this message in context: http://free-pasc

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Sven Barth
Am 18.10.2011 11:19, schrieb Vincent Snijders: 2011/10/18 Sven Barth: Am 18.10.2011 11:12, schrieb Sven Barth: type TByteArray = array of Byte; function XlatPrime(): TByteArray; begin XlatPrime := TByteArray.Create( $64, $73, $66, $64, $3b, $6b, $66, $6f, $41, $2c, $2e, $69, $79, $65, $77, $7

[fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Lukasz Sokol
[...] (facepalm) I did not try 'anonymous' function as you asked, oh. Need to learn to read ;) L. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Vladimir Zhirov
Sven Barth wrote: > Generic functions are NOT implemented in trunk (at least as > far as I know...). Ouch, sorry. I read about "generic procedural types" at "New features trunk" wiki page and thought it was what OP need. Andrew, I apologize for misinformation and thanks Sven for correcting me. ___

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Vincent Snijders
2011/10/18 Sven Barth : > Am 18.10.2011 11:12, schrieb Sven Barth: >> >> type >> TByteArray = array of Byte; >> >> function XlatPrime(): TByteArray; >> begin >> XlatPrime := TByteArray.Create( >> $64, $73, $66, $64, $3b, $6b, $66, $6f, >> $41, $2c, $2e, $69, $79, $65, $77, $72, >> $6b, $6c, $64, $4

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Sven Barth
Am 18.10.2011 11:12, schrieb Sven Barth: type TByteArray = array of Byte; function XlatPrime(): TByteArray; begin XlatPrime := TByteArray.Create( $64, $73, $66, $64, $3b, $6b, $66, $6f, $41, $2c, $2e, $69, $79, $65, $77, $72, $6b, $6c, $64, $4a, $4b, $44, $48, $53, $55, $42, $73, $67, $76, $63,

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Sven Barth
Am 18.10.2011 10:52, schrieb Vladimir Zhirov: The solution would require generic functions, these are implemented in FPC trunk only. Generic functions are NOT implemented in trunk (at least as far as I know...). Regards, Sven ___ fpc-pascal mailli

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Sven Barth
Am 18.10.2011 05:47, schrieb Andrew Pennebaker: But, but, the docs imply that this is the syntax for a function that returns an array of bytes. [snip] function XlatPrime () : array of byte; begin XlatPrime := ( $64, $73, $66, $64, $3b, $6b, $66, $6f, $41, $2c, $2e, $69, $79, $65, $77, $72, $6b,

[fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Lukasz Sokol
On 17/10/2011 21:53, Andrew Pennebaker wrote: > Does Free Pascal have anonymous functions that you can pass around, > e.g. to a sort(compare : function, arr : array) function? > > If not, does anyone know any hacks to accomplish this? > > Cheers, > > Andrew Pennebaker www.yellosoft.us

Re: [fpc-pascal] Delphi's anonymous functions in Free Pascal

2011-10-18 Thread Sven Barth
Am 17.10.2011 22:53, schrieb Andrew Pennebaker: Does Free Pascal have anonymous functions that you can pass around, e.g. to a sort(compare : function, arr : array) function? If not, does anyone know any hacks to accomplish this? No, FPC does not support this currently and I know no one who pla

Re: [fpc-pascal] How can I implement "thrice" in Free Pascal?

2011-10-18 Thread Vladimir Zhirov
Andrew Pennebaker wrote: > thrice :: a -> [a] > thrice x = [x, x, x] > I know the answer involves generics, but the docs don't > offer examples using Free Pascal's built-in generic types. The solution would require generic functions, these are implemented in FPC trunk only. In the latest release (

Re: [fpc-pascal] fpc has trouble with array types

2011-10-18 Thread Felipe Monteiro de Carvalho
On Tue, Oct 18, 2011 at 5:47 AM, Andrew Pennebaker wrote: > function XlatPrime () : array of byte; > begin > XlatPrime := ( > $64, $73, $66, $64, $3b, $6b, $66, $6f, I think that a syntax similar to this is available only for constant initialization. Actually I remember it from constant initializ