Re: [Lazarus] Ann: TButtonEdit as replacement for TEditButton

2014-05-15 Thread Torsten Bonde Christiansen

On 2014-04-06 17:33, Bart wrote:

Hi all,

As per r44623 (trunk) the new TButtonEdit component replaces the
TEditButton component.
The new TButtonEdit is designed as "Grouped Control", so it should
properly anchor and align.
(You need to clean build Lazarus in order to update the componentpallette.)

Hi Bart.

I found a minor bug in the TCustomEditButton code regarding OnEditingDone.

I have created a bug-report here (with included patch): 
http://bugs.freepascal.org/view.php?id=26171


And thank you for a great component :)

Regards,
Torsten

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/14/2014 09:44 PM, Michael Van Canneyt wrote:


Hopefully you got rid of the fpgettimeofday, or else the component is 
no better than using Now() :-)

Michael,

Even though I of course was aware of this, I did used fpgettimeofday to 
implement TTimer with the "ActiveNoGui" WidgetType, as I did not find 
something more appropriate in the RTL.


Of course I could try to directly use the X86's "Performance counter" 
register, but there were discussions if same would by reliable usable in 
CPU / OS combinations. I also could try to use of course I do need vDSO 
in Linux arcs (is that always available ?) Of course in the end I need 
something that works for any CPU and OS.


At best, fpgettimeofday itself should be improved (maybe using 
"Performance counter" register if the Arch allows for or vDSO if the OS 
allows for).


-Michael


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

--- sorry, previous mail seems to be digested by some scrambler ---

On 05/14/2014 09:44 PM, Michael Van Canneyt wrote:


Hopefully you got rid of the fpgettimeofday, or else the component is
no better than using Now() :-)


Michael,

Even though I of course was aware of this, I did used fpgettimeofday to 
implement TTimer with the "ActiveNoGui" WidgetType, as I did not find 
something more appropriate in the RTL.


Of course I could try to directly read the X86's "Performance counter" 
register, but there were discussions if same would by reliable usable in 
CPU / OS combinations. I also could try to use vDSO in Linux archs (is 
that always available ?)


Of course in the end I need something that works for any CPU and OS.

At best, fpgettimeofday itself should be improved (maybe using 
"Performance counter" register if the Arch allows for or vDSO if the OS 
allows for).


-Michael


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Van Canneyt



On Thu, 15 May 2014, Michael Schnell wrote:


--- sorry, previous mail seems to be digested by some scrambler ---

On 05/14/2014 09:44 PM, Michael Van Canneyt wrote:


Hopefully you got rid of the fpgettimeofday, or else the component is
no better than using Now() :-)


Michael,

Even though I of course was aware of this, I did used fpgettimeofday to 
implement TTimer with the "ActiveNoGui" WidgetType, as I did not find 
something more appropriate in the RTL.


There is nothing cross platform. GetTickCount64 comes closest.



Of course I could try to directly read the X86's "Performance counter" 
register, but there were discussions if same would by reliable usable in CPU 
/ OS combinations. I also could try to use vDSO in Linux archs (is that 
always available ?)


Only in recent versions, and I am not sure it is always enabled, 
however I have not studied the subject in depth.




Of course in the end I need something that works for any CPU and OS.


There is nothing. EpikTimer pretends to fill this gap, but it does not.

Don't get me wrong: I have nothing against the epiktimer, but it is 
presented as some super cross-platform solution (or so I perceive it).


Which is simply not correct. Unless you use the i386 version 
of the compiler, it is not better than using now().




At best, fpgettimeofday itself should be improved (maybe using "Performance 
counter" register if the Arch allows for or vDSO if the OS allows for).


FYI: fpgettimeofday is a direct kernel call, there is nothing to improve.

get_clock() and friends could be used, but we need to add this to the 
(base)unix units first.
Now it is only available in the linux unit. I seem to recall that Marco Van De Voort was going 
to look into this, but memory is somewhat fuzzy on this subject...


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 09:51 AM, Michael Van Canneyt wrote:





Of course in the end I need something that works for any CPU and OS.


There is nothing. EpikTimer pretends to fill this gap, but it does not.

Yep.

If necessary I could try to do something myself (i.e. an improved 
version of fpgettimeofday), with alternative {$if -ed implementations 
for different settings of the arch and OS settings. But thoroughly 
testing this seems like a nightmare.




Don't get me wrong: I have nothing against the epiktimer, but it is 
presented as some super cross-platform solution (or so I perceive it).


Which is simply not correct. Unless you use the i386 version of the 
compiler, it is not better than using now().
In fact in Linux it does call fpgettimeofday() (or did I install an old 
version ? )




At best, fpgettimeofday itself should be improved (maybe using 
"Performance counter" register if the Arch allows for or vDSO if the 
OS allows for).


FYI: fpgettimeofday is a direct kernel call, there is nothing to improve.

I do know (I did ASM stepping), but it does not need to stay that way. 
(Or maybe there is a platform independent function in the RTL that is 
used to delegate to fpgettimeofday)


If the arch and OS allows for it could work differently (e.g. use vDSO 
or use a performance counter register, adding value calculated an 
initializing action.


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Van Canneyt



On Thu, 15 May 2014, Michael Schnell wrote:


On 05/15/2014 09:51 AM, Michael Van Canneyt wrote:





Of course in the end I need something that works for any CPU and OS.


There is nothing. EpikTimer pretends to fill this gap, but it does not.

Yep.

If necessary I could try to do something myself (i.e. an improved version of 
fpgettimeofday), with alternative {$if -ed implementations for different 
settings of the arch and OS settings. But thoroughly testing this seems like 
a nightmare.




Don't get me wrong: I have nothing against the epiktimer, but it is 
presented as some super cross-platform solution (or so I perceive it).


Which is simply not correct. Unless you use the i386 version of the 
compiler, it is not better than using now().
In fact in Linux it does call fpgettimeofday() (or did I install an old 
version ? )




At best, fpgettimeofday itself should be improved (maybe using 
"Performance counter" register if the Arch allows for or vDSO if the OS 
allows for).


FYI: fpgettimeofday is a direct kernel call, there is nothing to improve.

I do know (I did ASM stepping), but it does not need to stay that way. (Or 
maybe there is a platform independent function in the RTL that is used to 
delegate to fpgettimeofday)


It needs to stay that way, that is what the function is for: 
expose the POSIX GetTimeOfDay call. It is an official API and need not be changed.




If the arch and OS allows for it could work differently (e.g. use vDSO or use 
a performance counter register, adding value calculated an initializing 
action.


fpGetTimeOfDay is used to implement Now(). This should not be changed.

For timers and whatnot, the fpgettimeofday call is simply not suitable. 
It is an incredibly slow call, and needs to be replaced with something else.
get_clock() seems to be the way to go. 
vSDO is a very specific linux mechanism; I would recommend against it.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 11:18 AM, Michael Van Canneyt wrote:



fpGetTimeOfDay is used to implement Now(). This should not be changed.


Why not, If there are better ways ?

I did a quick search in the RTL sources and found that there is 
"GetTickCount64" that maybe could be used as a central cross-platform 
function to implement certain timing stuff (including NOW).


Right now this is not the case. fpGetTimeOfDay is called in several 
other locations. I suppose, here GetTickCount64 could be used.


Depending on "HAVECLOCKGETTIME" GetTickCount64 just calls fpGetTimeOfDay.

In - more advanced ? - archs. GetTickCount64 calls "clock_gettime".

In my X86 32 Bit Linux it indeed does call clock_gettime.

But this again is just a system call and so I suppose it does not help 
to improve performance.


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Henry Vermaak
On Thu, May 15, 2014 at 09:40:44AM +0200, Michael Schnell wrote:
> At best, fpgettimeofday itself should be improved (maybe using
> "Performance counter" register if the Arch allows for or vDSO if the
> OS allows for).

Only the speed can be improved by calling into the vDSO, not the
precision.  You need to use clock_gettime() for nanosecond precision
(and to be unaffected by discontinuous clock changes).

Henry

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Van Canneyt



On Thu, 15 May 2014, Michael Schnell wrote:


On 05/15/2014 11:18 AM, Michael Van Canneyt wrote:



fpGetTimeOfDay is used to implement Now(). This should not be changed.


Why not, If there are better ways ?

Right now this is not the case. fpGetTimeOfDay is called in several other 
locations. I suppose, here GetTickCount64 could be used.


I will stop the discussion, you clearly have no idea what you are talking about 
:)

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 11:43 AM, Henry Vermaak wrote:
Only the speed can be improved by calling into the vDSO, not the 
precision. You need to use clock_gettime() for nanosecond precision 


I see.

Is clock_gettime not available via vDSO ? To me this seems even more 
viable than for fpGetTimeOfDay.




(and to be unaffected by discontinuous clock changes).

Thanks for pointing out this

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Off topic. Version numbers

2014-05-15 Thread Santiago A.

Have you heard about  "Semantic Versioning 2.0.0" /http://semver.org/?

It is a proposal about how to assign version numbers in order to deal
with compatibility and dependences.

Perhaps Lazarus should thing about using it.

In short, this system is: Version numbers is x.y.z[-]
"z" changes about bugs refactorization etc (patches number)
"y" changes about improvements that add new functionality, but don't
break compatibility (minor version number)
"x" Changes that break compatibility (mayor version number)
- is whatever you want (build beta RC1 etc)

If I have a program that builds and works properly using version
3.20.123-2, I'm sure it will work:
for 3.20.[*] and for 3.[20..infinite].[*]
Perhaps it will work for 3.19, it depends on if I used new features
added in 3.20 o not.
It won't work for 4.* or 2.*


Example:
V 3.20.10
Tmyobject=class
  public
procedure foo1;
 end;

V 3.20.11
Tmyobject=class
  private
myvar:integer; // new internal var, nothing really changes. 
Increment patch version number
  public
procedure foo1;
procedure foo2;
  end;

V 3.21.11
Tmyobject=class
  private
myvar:integer;
  public
procedure foo1;
procedure foo2;
procedure fooNew; // New feature,programs that work with V 3.20
still work. Increment minor version number.
  end;

V 4.1.1
Tmyobject=class
  private
myVar:integer;
  public
// *** procedure foo1;  ** deprecated
procedure foo2; // Foo1 removed, could break compatibility.
Increment mayor version number
procedure fooNew;
  end;


The drawback is that is you must separate clearly bugs, new features
and  deprecating/changing functionality. Never the less, it is good for
the user.

wouldn't  Lazarus team, as user of FPC, love that, when FPC releases
2.7, not to need to check what/if breaks with 2.6, just be sure nothing
is breaks?

As the document states
"This is not a new or revolutionary idea. In fact, you probably do
something close to this already. The problem is that "close" isn't good
enough. Without compliance to some sort of formal specification, version
numbers are essentially useless for dependency management. By giving a
name and clear definition to the above ideas, it becomes easy to
communicate your intentions to the users of your software. Once these
intentions are clear, flexible (but not too flexible) dependency
specifications can finally be made."
 


-- 
Saludos

Santi
s...@ciberpiula.net


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Henry Vermaak
On Thu, May 15, 2014 at 12:12:06PM +0200, Michael Schnell wrote:
> On 05/15/2014 11:43 AM, Henry Vermaak wrote:
> >Only the speed can be improved by calling into the vDSO, not the
> >precision. You need to use clock_gettime() for nanosecond
> >precision
> 
> I see.
> 
> Is clock_gettime not available via vDSO ? To me this seems even more
> viable than for fpGetTimeOfDay.

Yes, as I said earlier.  It's in the man page, too.  And in the kernel
source I pointed to.

Henry

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Henry Vermaak
On Thu, May 15, 2014 at 11:41:32AM +0200, Michael Schnell wrote:
> On 05/15/2014 11:18 AM, Michael Van Canneyt wrote:
> >
> >
> >fpGetTimeOfDay is used to implement Now(). This should not be changed.
> 
> Why not, If there are better ways ?

"Better" needs to be defined here.  If you mean "faster", then you need
to call through the vDSO, so just link to the C library and use their
implementation.  Chances are that you are linking to the C library
anyway (we're on the lazarus list after all).  There isn't much reason
for fpc to implement this, but perhaps it warrants a comment in the
documentation (e.g. "glibc may have a much faster implementation that
doesn't use a syscall, if you're worried about performance").

gettimeofday() is the correct way to get the real wall clock time, there
is no "better" way for fpc to implement it (except for using
clock_gettime() with CLOCK_REALTIME, since technically gettimeofday() is
obsolete).

gettimeofday() is not what you want to use for a timer, though, since it
will change when someone sets the time on the system.  In that case you
want to use clock_gettime() with CLOCK_MONOTONIC, or even
CLOCK_MONOTONIC_RAW (linux only).  GetTickCount64 will use this on
linux, but it reduces the precision to milliseconds.

You seem a bit confused about some of these things, and people are
talking at cross purposes, so I'll end my part in the discussion
here.

Henry

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Van Canneyt



On Thu, 15 May 2014, Henry Vermaak wrote:


On Thu, May 15, 2014 at 11:41:32AM +0200, Michael Schnell wrote:

On 05/15/2014 11:18 AM, Michael Van Canneyt wrote:



fpGetTimeOfDay is used to implement Now(). This should not be changed.


Why not, If there are better ways ?


"Better" needs to be defined here.  If you mean "faster", then you need
to call through the vDSO, so just link to the C library and use their
implementation.  Chances are that you are linking to the C library
anyway (we're on the lazarus list after all).  There isn't much reason
for fpc to implement this, but perhaps it warrants a comment in the
documentation (e.g. "glibc may have a much faster implementation that
doesn't use a syscall, if you're worried about performance").

gettimeofday() is the correct way to get the real wall clock time, there
is no "better" way for fpc to implement it (except for using
clock_gettime() with CLOCK_REALTIME, since technically gettimeofday() is
obsolete).

gettimeofday() is not what you want to use for a timer, though, since it
will change when someone sets the time on the system.  In that case you
want to use clock_gettime() with CLOCK_MONOTONIC, or even
CLOCK_MONOTONIC_RAW (linux only).  GetTickCount64 will use this on
linux, but it reduces the precision to milliseconds.

You seem a bit confused about some of these things, and people are
talking at cross purposes, so I'll end my part in the discussion
here.


Henry, thank you for explaining it very clearly.

I no longer had the desire to do so.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Mark Morgan Lloyd

Michael Van Canneyt wrote:

For timers and whatnot, the fpgettimeofday call is simply not suitable. 
It is an incredibly slow call, and needs to be replaced with something 
else.
get_clock() seems to be the way to go. vSDO is a very specific linux 
mechanism; I would recommend against it.


I note that IBM mainframes have a counter which is defined as 
incrementing one particular bit at a 1mSec rate. The behaviour of bits 
to its right varies depending on the machine, and bits to its left count 
as expected. I can't remember the fixed-rate bit position, but it 
strikes me as an elegant intermediate format where an absolute date etc. 
isn't needed.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [ANN] Brook 3.0.0 release!

2014-05-15 Thread Leonardo M . Ramé
On 2014-05-13 20:10:20 -0300, silvioprog wrote:
> The Brook team is glad to announce the release 3.0.0.
> 
> This version was compiled and tested successfully with Free Pascal 2.6.4.
> Here is the list of changes between version 2.6.4 and 3.0.0 of the Brook:
> 
> https://github.com/silvioprog/brookframework/compare/57f8e01868dbec9708129bc789940df2a93c1637...v3.0.0(or
> short URL here:
> http://goo.gl/kr9oX0)
> 
> The release is available for download on Github:
> 
> https://github.com/silvioprog/brookframework/releases/tag/v3.0.0
> 
> Or through the "Latest Release" button on the project home page:
> 
> http://silvioprog.github.io/brookframework/
> 
> Minimum requirements:
> 
> Free Pascal 2.6.4. If you prefer the Lazarus interface, choose the 1.2.2
> version.
> 
> Enjoy!
> 

Hi Silvio, congratulations for the new release. I'm using it on one of
my apps, and it's fantastic!.

Can you add a "What's new" item in the home page or in the Wiki?. I
know we are programmers and shouldn't have problems reading the git
diff, but I'll be easy for us to know what additions and improvements
you made.

Regards,
-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 01:29 PM, Henry Vermaak wrote:
You seem a bit confused about some of these things, and people are 
talking at cross purposes,

Right you are.

I e.g. was inappropriately ignoring the fact that the time of day can be 
unaffectedly modified under the hood.


Now I know better. (Disregarding resolution that in fact could be 
handled in the RTL) seemingly we need as well a truly continuous time 
base plus  a "time of day" time base.



Thanks,
-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 01:06 PM, Henry Vermaak wrote:
Yes, as I said earlier. It's in the man page, too. And in the kernel 
source I pointed to.


Henry,
Thanks a lot for you patience !

So this (using vDSO to call "clock_gettime" in fact is what the OP was 
searching for, and what would needed tp be implemented in EpikTimer for 
make same acceptable for Michael vC (and myself), or even better might  
be provided by  the standard RTL.


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] [ANN] Brook 3.0.0 release!

2014-05-15 Thread Michael Schnell

On 05/15/2014 01:45 PM, Leonardo M. Ramé wrote:

Can you add a "What's new" item in the home page or in the Wiki?.


Plus a "What's old" item for silly me ;-) .

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Sven Barth
Am 15.05.2014 11:17 schrieb "Michael Van Canneyt" :
> get_clock() seems to be the way to go. vSDO is a very specific linux
mechanism; I would recommend against it.

Nevertheless we could add vDSO support to the Linux unit so that users can
make use of it without the need to link to libc or implement it themselves.
:)

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Van Canneyt



On Thu, 15 May 2014, Sven Barth wrote:



Am 15.05.2014 11:17 schrieb "Michael Van Canneyt" :
> get_clock() seems to be the way to go. vSDO is a very specific linux 
mechanism; I would recommend against it.

Nevertheless we could add vDSO support to the Linux unit so that users can make 
use of it without the need to link to libc or implement it themselves.
:)


No argument there.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 02:44 PM, Sven Barth wrote:


Nevertheless we could add vDSO support to the Linux unit so that users 
can make use of it without the need to link to libc or implement it 
themselves. :)




Hence fpGetTimeOfDay would need multiple implementations.

clock_gettime seems to be Linux-only anyway.

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Reimar Grabowski
On Thu, 15 May 2014 14:11:26 +0200
Michael Schnell  wrote:

> So this (using vDSO to call "clock_gettime" in fact is what the OP was 
> searching for

May I quote the OP for you:

"I need to develop a game for all possible Operating Systems."

Any mismatch between his statement and your conclusion?

R.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Off topic. Version numbers

2014-05-15 Thread Flávio Etrusco
On Thu, May 15, 2014 at 7:36 AM, Santiago A.  wrote:
>
> Have you heard about  "Semantic Versioning 2.0.0" /http://semver.org/?
>
> It is a proposal about how to assign version numbers in order to deal
> with compatibility and dependences.
>
> Perhaps Lazarus should thing about using it.
>
> In short, this system is: Version numbers is x.y.z[-]
> "z" changes about bugs refactorization etc (patches number)
> "y" changes about improvements that add new functionality, but don't
> break compatibility (minor version number)
> "x" Changes that break compatibility (mayor version number)
> - is whatever you want (build beta RC1 etc)
>

Both Lazarus and FPC follow this numbering scheme already - maybe not
very strictly, but they follow ;-) And the minor version number is
even for stable release series, and odd in the trunk/development
branch.

-Flávio

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Off topic. Version numbers

2014-05-15 Thread Mattias Gaertner
On Thu, 15 May 2014 13:19:41 -0300
Flávio Etrusco  wrote:

> On Thu, May 15, 2014 at 7:36 AM, Santiago A.  wrote:
> >
> > Have you heard about  "Semantic Versioning 2.0.0" /http://semver.org/?
> >
> > It is a proposal about how to assign version numbers in order to deal
> > with compatibility and dependences.
> >
> > Perhaps Lazarus should thing about using it.
> >
> > In short, this system is: Version numbers is x.y.z[-]
> > "z" changes about bugs refactorization etc (patches number)
> > "y" changes about improvements that add new functionality, but don't
> > break compatibility (minor version number)
> > "x" Changes that break compatibility (mayor version number)
> > - is whatever you want (build beta RC1 etc)
> >
> 
> Both Lazarus and FPC follow this numbering scheme already - maybe not
> very strictly, but they follow ;-) And the minor version number is
> even for stable release series, and odd in the trunk/development
> branch.

Not quite.
Lazarus x has only changed once from 0 to 1, reflecting a new branch
and release system.
y is for incompatibilities and new features.
z is for bug fix releases.

Probably it is possible to skip the x and use a y.z scheme.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Junior
The conversation was good, but I wonder if the epiktimer component would 
be the correct option. I need precision, I'll be working with many 
timers in milliseconds.


(Windows 32 bits/64bits; Linux 32 bits/64bits; Android; MacOS; among others)

Thanks


Em 15-05-2014 12:26, Reimar Grabowski escreveu:

On Thu, 15 May 2014 14:11:26 +0200
Michael Schnell  wrote:


So this (using vDSO to call "clock_gettime" in fact is what the OP was
searching for

May I quote the OP for you:

"I need to develop a game for all possible Operating Systems."

Any mismatch between his statement and your conclusion?

R.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Reimar Grabowski
On Thu, 15 May 2014 14:34:02 -0300
Junior  wrote:

> The conversation was good, but I wonder if the epiktimer component would 
> be the correct option. I need precision, I'll be working with many 
> timers in milliseconds.

In general it does it's job good enough for realtime purposes but take a look 
at the castle game engine they have their own cross plattform time keeping 
solution. For simple stuff even now() is good enough.
I am not sure why you need precision because games normally don't need that 
precise time keeping.
I hope you know what you are doing because basing your game on timers doesn't 
sound like a reasonable design decision to me.

R.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Junior
You know the game Travian? The game will be similar to it, but with 
other themes.


Em 15-05-2014 15:09, Reimar Grabowski escreveu:

On Thu, 15 May 2014 14:34:02 -0300
Junior  wrote:


The conversation was good, but I wonder if the epiktimer component would
be the correct option. I need precision, I'll be working with many
timers in milliseconds.

In general it does it's job good enough for realtime purposes but take a look 
at the castle game engine they have their own cross plattform time keeping 
solution. For simple stuff even now() is good enough.
I am not sure why you need precision because games normally don't need that 
precise time keeping.
I hope you know what you are doing because basing your game on timers doesn't 
sound like a reasonable design decision to me.

R.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Junior


Travian is an online game using a browser, in my project, the game will 
be a desktop with the same features of Travian program, but with 
internet access.
The multimedia part will benefit by seeking the images, sounds and 
videos on your local computer.


Em 15-05-2014 15:22, Junior escreveu:
You know the game Travian? The game will be similar to it, but with 
other themes.


Em 15-05-2014 15:09, Reimar Grabowski escreveu:

On Thu, 15 May 2014 14:34:02 -0300
Junior  wrote:

The conversation was good, but I wonder if the epiktimer component 
would

be the correct option. I need precision, I'll be working with many
timers in milliseconds.
In general it does it's job good enough for realtime purposes but 
take a look at the castle game engine they have their own cross 
plattform time keeping solution. For simple stuff even now() is good 
enough.
I am not sure why you need precision because games normally don't 
need that precise time keeping.
I hope you know what you are doing because basing your game on timers 
doesn't sound like a reasonable design decision to me.


R.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus





--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Ann: TButtonEdit as replacement for TEditButton

2014-05-15 Thread Bart
On 5/15/14, Torsten Bonde Christiansen  wrote:

> I found a minor bug in the TCustomEditButton code regarding OnEditingDone.
>
> I have created a bug-report here (with included patch):
> http://bugs.freepascal.org/view.php?id=26171

Fixed in r45044.
Thanks for the patch.
Please close the bugreport.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Extended format codes in FormatDateTime

2014-05-15 Thread Werner Pamler
In BugTracker, #0026168, I posted a patch to FormatDateTime which allows 
to use hour, minute, or second format codes in square brackets. If such 
codes are found in the format string the values of the corresponding 
quantitites do no longer overflow, but can grow beyond their usual limit 
of 24 (for hours) or 60 (for minutes and seconds). The idea behind that 
is that when adding or subtracting times the hours often become greater 
than 24, but there may be a wish to keep an hh:nn format without days. I 
need that feature in my current work with the fpspreadsheet date/time 
formats since Excel offers this [h]:mm:ss format string. Currently I 
have a patched version in the package, but it certainly would be better 
to have this feature in fpc/Lazarus generally.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Off topic. Version numbers

2014-05-15 Thread Flávio Etrusco
On Thu, May 15, 2014 at 1:29 PM, Mattias Gaertner
 wrote:
> On Thu, 15 May 2014 13:19:41 -0300
> Flávio Etrusco  wrote:
>
>> On Thu, May 15, 2014 at 7:36 AM, Santiago A.  wrote:
>> >
>> > Have you heard about  "Semantic Versioning 2.0.0" /http://semver.org/?
>> >
>> > It is a proposal about how to assign version numbers in order to deal
>> > with compatibility and dependences.
>> >
>> > Perhaps Lazarus should thing about using it.
>> >
>> > In short, this system is: Version numbers is x.y.z[-]
>> > "z" changes about bugs refactorization etc (patches number)
>> > "y" changes about improvements that add new functionality, but don't
>> > break compatibility (minor version number)
>> > "x" Changes that break compatibility (mayor version number)
>> > - is whatever you want (build beta RC1 etc)
>> >
>>
>> Both Lazarus and FPC follow this numbering scheme already - maybe not
>> very strictly, but they follow ;-) And the minor version number is
>> even for stable release series, and odd in the trunk/development
>> branch.
>
> Not quite.
> Lazarus x has only changed once from 0 to 1, reflecting a new branch
> and release system.
> y is for incompatibilities and new features.
> z is for bug fix releases.
>
> Probably it is possible to skip the x and use a y.z scheme.
>
> Mattias

So in practice it's the same, no? ;-)
It feels a bit annoying to have high numbers in the major version, and
I guess that's why no project ever follows that scheme to the letter.

Best regards,
Flávio

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 05:26 PM, Reimar Grabowski wrote:

OP:
"I need to develop a game for all possible Operating Systems."


"EpicTimer" uses "QueryPerformanceCounter" for Windows. I did not check 
into this,  but I suppose this already is what he needs.


But it uses "fpgettimeofday" in Linux. This is what Michael vC states to 
be not appropriate.


Hence using the vDSO to call "clock_gettime"sing in Linux should make 
the OP happy with Linux and Windows.


Sorry, but no Idea about other OSes.

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How to program with time in milliseconds?

2014-05-15 Thread Michael Schnell

On 05/15/2014 07:34 PM, Junior wrote:

 I need precision, I'll be working with many timers in milliseconds.

(Windows 32 bits/64bits; Linux 32 bits/64bits; Android; MacOS; among 
others)


No normal (not dedicatedtly "realtime") OS provides "decent" millisecond 
precision. The OS might stall any program at any time for seconds.


But a game is not supposed to be "hard realtime" but "very soft 
realtime". Hence it should not matter if such glitches once and again.


I supposed, an enhanced version of  "EpicTimer" might be useful. Decent 
arch/OS independent sub-millisecond timer support (e.g. using 
QueryPerformanceCounter and  "clock_gettime" via vDSO) would be even nicer.


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus