My 2 cents on the "strictness" of the parsing.
Since there are various, more or less accepted, "rules", a
"strictness" parameter could be added as an optional parameter to the
function.
It does not break consistency with other conversion functions, since
they are hardly open for interpretation, a
So the question is, what does or should do RomanToInt for invalid input?
It is NOT called "CheckValidRoman", so it could be that the result for
invalid input is simply undefined. If it is, then all is ok.
so, what does "10AT" (or "$10AT" for tht matter) return for HexToDec???
maybe NaN, if the
Are you sure regarding M considering there is no symbol for 5000? Or
didn't Romans count to more than 5000 - 1?
yes I am. as 5000 - 1 would need to be written CMXCIX, which has the
4-M-in-a-row, that is invalid, as a maximum of three is allowed.
Yes, probably ancient Romans had no need to
What about making an option of it?
Anyhow, if the function accepts invalid combinations, what should it
return? For some, the answer would be obvious (), but some
combinations are indeed ambiguous (M) So that we maybe could accept
unambiguous invalid combinations, but I don't see how to a
What about making an option of it?
If it accepts, then it should apply the subtraction rule: only the
(one) numeral left to the other (bigger one) can be subtracted.
So IIIM would be III + IM = 3 + 1000-1 = 1002 (and not 1000-3 = 997)
There should be no ambiguity there, it's only a pain to watc
Ooops,
I also forgot to mention that only I, X, C and M can appear up to three
times in a row. V, L and D does not; they can only once.
Cheers again, A.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/
Premise: I didn't go through your entire implementation, thou' at first
sight looks much better than the current one.
I know roman numerals since I was 8 or 9 yo, that makes a quick and dirt
result of about 35 years.
Thing is:
1. in the roman numerals, not all the digits can be subtracted fr
I am not an expert of PostGres but maybe you are missing the doubled quotes?
q.Params.ParamByName('id').AsString :=
''71d6776e-1564-11e3-ad65-5349928f15b0'';
Cheers, A.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepasc
On 17/07/13 00:56, vfclists . wrote:
It is hardly for the end users sake unless the enduser is a programmer.
we're talking about programming languages here, so that... whoever else
shall an end user of a development tool/library be?!?!?!?
X_X
___
On 17/07/13 00:56, vfclists . wrote:
I completely disagree. It is the code that is the primary expression
of intent not the comments. This is mainly accomplished through
sensible identifier naming.
I perfectly agree, a well formed name is worth a thousand words, in this
context.
On 18/06/13 18:42, leledumbo wrote:
well, to be honest, int hahaha[10] -> hahaha: array[0..9] of integer;
it is not just adding "0.."
anyway, a change in the converter should be more adequate, IMHO, that by
default translates [X] into [0 .. X-1]
just my 2c
I think this was requested a lo
I am familiar with the basic underlying methods available for transferring data
between processes on Windows and Unix, i.e. Pipes, Shared memory, and TCP/IP -
but what I am not familiar with is any higher level functionality that may be
available on FPC.
If I'd do something in this scope, I'd
But pointer are always a source of errors.
Only use them when it's unavoidable.
If you can do the same without pointers then don't use them. ;-)
Of course, if you just use pointers because others do, indeed they might
be...
No comment.
A.
___
fpc-p
The reason for using a buffer in tdataset is that a record's data normally
is located in one continuous buffer, from which a value is picked from the
right spot (including strings) You can't have that with variants.
Hm... right.
So, if I will have a class like a TParam, that have FValue: Variant
To stress this a bit: around two weeks ago I told my "program
optimization" teacher (who's the head of the "programing languages"
chair) about Free Pascal (and Delphi) and he didn't know that Pascal
"already" supports OOP... :(
don't be so sad... pass your exams, whatever it takes to, then rethi
If there problems with capitalization of certain characters exist then
these problems should be solved or
if that's not possible for some reason such characters should not be
allowed in file systems.
But giving it all over to the user and tell him "We did not know how to
handle this mess, just tr
No. This does not work with mediawiki.
Of course not... that was just an example.
A.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
I doubt that mediawiki uses malformed urls.
And any browser and http client uses it without warning.
as I said, it was out of curiosity.
Googling around anyway, shows that there are some special characters out
there (obviously), which are meant to compose the url itself: colon,
slash, dot, q.
The fact it appends a slash at the end is probably because it thinks
it's a path...
But, just out of curiosity... isn't it a malformed *http* url if it
contains a colon?
Cheer, A.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://li
Thanks for the fix, but it makes the code a bit more complicated than
I'd hoped/thought based on my (over simple?) impression that local fns
are used in place of those in units. John
this would be true if you declared another function fnb locally, so that
calling fnb could eventually override t
> That's what happens when someone sends a mail while their system
> clock is set such a date in the future.
shouldn't it be better if the mail messages were registered with the
server's date and time?
This is just a guess... ;-)
Cheers, A.
___
f
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
Well, I would advice only to use it if you *know* the maximum nesting
depth. Otherwise it can crash easily.
I was not focusing on the problems that could arise using recursion, my
point simply was that in this case, use of recursion was a no-need.
Of course when using recursion you _MUST_ kee
ly know how deep may the nesting.
Just my 2c
Cheers, A.
--
Alberto Narduzzi
ANSware Ltd.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Sorry,
I agree. But as I search for text within PDF files?
I assumed true the following statement of yours...
[Somebody can help me please?
I need to search strings in Text files using just FPC.]
so I suggested the fast-enough (in my opinion) use of the Pos function.
If _now_ you want to sea
Somebody can help me please?
I need to search strings in Text files using just FPC.
how about reading every line and then using Pos() to see if some string
is there?
HTH ;-)
Cheers, A.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
h
. I don't use nested
procedures as parameters, so from the error message I just assumed they
weren't allowed.
Cheers, A.
--
Alberto Narduzzi
ANSware Ltd.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
also suggest you do
Type TMyProc Procedure(var y:myObject);
(*) in case of an object method, I think you must add "Of Object" at the
end of its declaration.
it makes all more readable on first instance.
Just my 2c
Cheers, A.
--
Alberto Narduzzi
A
Andrew Brunner wrote:
It most certainly is not "safe". LOL. Free calls destroy.. Destroy
may contain other frees and routines... You cannot guarantee that free
will even return.
the point was to call .Free on an object that might not have been
initialized, not what Free ( or destroy, for the
TObject is the base class, it inherits from nobody. To make the whole
weel run a base class must exists which provide basic functionality
like Create/Destroy and other methods/events like "ClassName",
"InheritsFrom"; so if no class is specified it automatically inherits
from TObject.
I see, and
Hi,
Struct is declared as "class" so it inherits from TObject if not other
class is especified.
is that true? I don't mean not to trust you, but is the compiler
assuming that, or is it a FPC rule? IMO a class is a class, and doesn't
inherit from anything else. Unless specified. BTW, From who
ok, now the code fragments look more clear.
I have no more suggestions but the one about deriving your TStruct from
TObject, as almost everything in the LCL (and/or VCL, I guess I name
them right) is a descendant of it.
Again. maybe it's not the best thing you'll like to do, but this way
IMHO
i := self.names.indexOf(name);
val := Struct(self.values[i]);
raises "got untyped expected Struct". Sure, that's why I'm trying to cast... Without
casting to Struct, the compiler indeed throws "got pointer expected Struct". I'm very
surprised since I already did this.
in first place, you
Thank you.
Does this mean that to be able to define a literal value like "byteset := [0, 3, 101]"
for a set (and probably for an array) I must have defined a custom type for it; correct? (It's the
only difference I see with my trials: numbers in my code is not of a custom type but simply a var
Hi,
But I have really no idea how to translate the c headerfile
with its structures to freepascal.
Is there anybody out who can help me to translate the
header file into a unit ?
Can you pass over the .h file? Maybe I can help.
Please, check the rules of the ML, as I can't tell you for sure y
35 matches
Mail list logo