Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Is Lazarus supports WireCompression in Firebird 3?
« Last post by dsiders on Today at 07:54:18 pm »
Beside, do you know what library to include in the same application folder in Linux?

I'm not a Linux guru... but I think it should be called libz.so.
2
General / Re: Simple file with only one single record, but of HUGE size
« Last post by wp on Today at 07:38:14 pm »
But then you must close the file after writing each character and reopen it when the next character is to be written. And hope that the OS buffers already have been flushed. In total, this will make it even slower (what is the rate at which the characters arrive?)

I think it would be much better to invest in a UPS.
3
General / Re: TTask futures Delphi equivalent under FPC
« Last post by mr-highball on Today at 07:38:03 pm »
thanks,
does ezthread class automatically free itself onterminate?

Yes, it does as long as you don't hold on to a reference yourself (which may be useful if you want to reuse).
For example, if you were to create and assign to a private thread variable (ie. FThread: IEZThread), once the thread is terminated you would still have that reference and would have to nil it yourself when finished (destructor of object or OnDestroy in form).

Additionally, there are a lot of settings that can be configured, and callback methods for error/finish to fine tune the behavior. Linked is one sample showing some settings that may be of use to you:
https://github.com/mr-highball/ezthreads/blob/master/test/ezthreads_tester.lpr#L161
4
General / Re: Some questions about TEventLog
« Last post by Renat.Su on Today at 07:09:11 pm »
On the case, if someone will find in searching for this topic, then answers such:
1. With TEventLog in any way no. It is sewn in class and is not configurable (probably because it is not cross-platform)
Code: Pascal  [Select]
  1. Procedure TEventLog.ActivateSystemLog;
  2. begin
  3.   CheckIdentification;
  4.   OpenLog(Pchar(Identification),LOG_NOWAIT,LOG_USER); // LOG_USER - type of file log
  5. end;
2. As I understand it is not cross-platform. You must perform synchronization yourself
5
General / Re: Simple file with only one single record, but of HUGE size
« Last post by Epand on Today at 07:02:25 pm »
But you need ALL the filesize in memory?

No, I don't. The crux of the matter is to gather/retrieve the characters (which will be done character per character) and to safely store them together in one single huge line in the file.



The file will be filled sequentially character per character, no other choice.
Who made this insane requirement? Why don't you write to a buffer first and write that to disk only when it is full?

What may look insane at the first moment is not always insane  ;) .
The characters which fill the file are gathered/retrieved character per character with time intervals between actions getting each single character, where the intervals are neither known nor predictable. It's the fear that during the mentioned time intervals anything can happen, worst case may be power failure - although the software may run weeks the machine is not connected to an uninterruptible power supply. This whole combination led to the conclusion to fill the file character per character - to be on the safe side as each gathered character is important.
6
General / Re: TTask futures Delphi equivalent under FPC
« Last post by bobdp on Today at 07:01:17 pm »
thanks,
does ezthread class automatically free itself onterminate?
7
Lazarus / Re: Lazarus Release Candidate 2 for 2.0
« Last post by Alextp on Today at 06:58:23 pm »
Quote
>As wp noted, a square cross looks strange inside the rectangle. IMO things would get worse by the change.
Juha,
issue has 2 patches from me.
1st is safe: is only adds X for Listbox.
2nd is not safe and wp wrote about it.
Pls apply 1st one
8
Cocoa / Re: Tedit with readonly set to true doesn't work
« Last post by zeljko on Today at 06:32:54 pm »
Best would be to try with trunk if it works , and if that's not the case then open an issue against cocoa widgetset.
If it works there maybe it's merged into fixes_2.0 so will be available in RC3.
9
Beginners / Re: Determine if a char
« Last post by 440bx on Today at 06:17:47 pm »
I am not sure. I assumed it would be a tick or two faster when the string pass, as only one assignment happens.
The "exit(false);" causes an assignment, because of that, it's basically the same thing, the assignment just happens in a different place. (see ETA though.)

I like the second alternative, very clean and maintainable but, it generates more code and it's also a smidgen slower.   I like the "c in ..." but I don't want to pay extra for it. ;)
I hope this will change in the future.
That would be very nice, looking forward to that. :)

ETA: you are absolutely correct that when the string passes, the code you presented will be a hair faster because the assignment isn't executed.
10
Beginners / Re: Determine if a char
« Last post by engkin on Today at 06:10:48 pm »
Yes, those work too.  I like setting "result" explicitly at the function entry.
That is a safe way.

The first alternative generates code that is basically equivalent (code size and speed) as the code generated when setting result upfront.
I am not sure. I assumed it would be a tick or two faster when the string pass, as only one assignment happens. Both are identical when the string fail. But of course, the assignment upfront is the way to go.

I like the second alternative, very clean and maintainable but, it generates more code and it's also a smidgen slower.   I like the "c in ..." but I don't want to pay extra for it. ;)
I hope this will change in the future.
Pages: [1] 2 3 ... 10