-
Content Count
1211 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
Class TSslHttpCli not found - DELPHI5
FPiette replied to 2nd-Snoopy's topic in ICS - Internet Component Suite
As far as I remember, the very old ICS which still support Delphi 5 lacks SSL although I'm not sure. Why can't you upgrade to latest Delphi version? If it is for hobby or small business, you can use the Community Edition which is free. Unless you use old components for which you don't have the source, it is not that difficult to port Delphi 5 to latest Delphi version. -
On Delphi 10.4.1 the MMX Code Explorer is mostly dead/inactive when running Delphi debugger
FPiette replied to panie's topic in MMX Code Explorer
I don't. -
TWSocketClient.OnDataAvailable not firing off after a day or two
FPiette replied to aehimself's topic in Network, Cloud and Web
Good to know. Thanks for reporting. -
On Delphi 10.4.1 the MMX Code Explorer is mostly dead/inactive when running Delphi debugger
FPiette replied to panie's topic in MMX Code Explorer
I'm sure everyone will love to have a styled VirtualTree! -
On Delphi 10.4.1 the MMX Code Explorer is mostly dead/inactive when running Delphi debugger
FPiette replied to panie's topic in MMX Code Explorer
Wouldn't be interesting to update VirtualTrees source code at https://github.com/JAM-Software/Virtual-TreeView ? -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
This article is about random insertion and random deletion, I guess they take into account the time required to locate the record in the list. If random means generating a random index number, then it is the worst case possible for linked list and best case for array (direct access). If that is a main access pattern, then a linked list is NOT the correct data structure. Insertion/deletion in a linked list is only quick provided the insertion/deletion point is already available. Measuring the performance for a search separately from performance for insert/delete itself is what has to be done to truly compare linked-list and arrays or any other data structure such as a dictionary or hash table. A linked list is excellent for a FIFO QUEUE or LIFO QUEUE (STACK). And that is the problem in the case of this message thread: communication which require a FIFO queue between receiving process and computing process. That is why I proposed a linked-list. -
On Delphi 10.4.1 the MMX Code Explorer is mostly dead/inactive when running Delphi debugger
FPiette replied to panie's topic in MMX Code Explorer
Installed. Up to now source indexer works as expected. Thanks. btw: I almost use only the source indexer. -
On Delphi 10.4.1 the MMX Code Explorer is mostly dead/inactive when running Delphi debugger
FPiette replied to panie's topic in MMX Code Explorer
Source indexer doesn't work here (not shown when asked). Never noticed it is when debug layout is active. I have a basic setup with MMX being the only add-on. -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Linked lists compared to arrays allow to insert/delete/move items without moving the whole array. When doing a FIFO, it is very important to be able to quickly insert at one end. With linked list it is easy to implement multiple queues, for example a free list and a busy list without moving data. Obviously, if you have a small numbers of items, it makes no differences. For a really small number of items, a linked list may even be slower that an array. As everywhere, use case are different and there is no best solution for everything. That's true for anything! Non optimized is... non optimized 🙂 -
Is it's safe to destroy TSslHttpCli while http request in progress ?
FPiette replied to Max Terentiev's topic in ICS - Internet Component Suite
Yes. The remote site will experience and abort error if a transfer is occurring. -
Is it's safe to destroy TSslHttpCli while http request in progress ?
FPiette replied to Max Terentiev's topic in ICS - Internet Component Suite
You should not destroy the component from an event handler of that component (general rule, not specific of ICS) or you'll experience access violation or other strange behavior. From an event handler, you can defer the destroy using a PostMessage of a custom message. That is what TForm.Release does by the way. -
Do you have gtClasse3.pas or gtClasse3.dcu somewhere in Delphi search path or project search path, or directly added in your project? Any typo error?
-
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Yes, I have no idea who you are! -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
No, only TCP. UDP is a datagram oriented protocol. But you are able to discover which protocol is used in your processor stuff. What I say is that you have to move the part of the code out of the processor code and move it to an intermediate layer between the low level receiver and high level the processor. Layers is the key success in protocol handling. RawByteString is low performance. It is all about memory alloc/free, data copy and memory fragmentation. Low performance but easier to design and develop. Linked list (Or queue if you want to encapsulate the linked list in another name) is the way to go for performance as I explained. And yes, I agree that this is more complex to design and develop but this is the price to pay for performance. I bet you will never do that change. You'll buy a higher performance computer. -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Not tricky but less trivial. As someone else said in this conversation, performance often means more complex solution. You put your priority where you want! Maybe you don't know, but I'm the author of ICS (Internet Component Suite) and what you describe is exactly what happens with a TCP stream which is what a TCP socket gives. So I have large experience in that kind of data receiving handling. There are 3 ways to delimit data: 1) There are delimiters such STX/END around a data block or a CRLF (or any other end-of-block marker) at the end of data block. 2) Each block begins with a data length. 3) Communication is closed or broken You should move the determination of the data block complete/incomplete in the receiving process or thread, not in the processing thread. This means that the same buffer (Pointer and length or pointer to star, offset and length) is given to the low level receiver until a complete data block is received. Only then this data block is put at the end of the incoming data linked list (or Queue if you prefer this term) for processing. -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
So this is perfect for a linked list! The linked list will grow as the source data thread add more buffer at the end. Buffer extracted from released buffers after processing or new buffer if no free available. Processors, will take a buffer from the start of the linked list for processing and move the buffer to the released linked list. Then you have to have a linked list per source data. When a processor retrieve the first buffer from the linked list and determine it is not complete, then it is flagged and it stays in the linked list. When the next data chunk arrive, and the first buffer in the list is flagged as incomplete, then it is flagged as fragment so that the processors knows that if must also retrieve the next item in the list (or a few ones) to get complete data. btw: Linked list are frequently used to implement queues (FIFO, LIFO). I never seriously looked at how Delphi RTL implement TQueue<T> but I think it is an array which is less efficient. -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
You'll get performance if you avoid copying data. If your receiver component accept a buffer (You said TBytes which is a TArray<Byte>), you can keep it into that buffer, add that buffer in a linked list of pointers to those TBytes buffer and pass another buffer for the next receive. Each "processor" will then receive the data it know how to handle right and produce some result maybe in the same buffer or in a new one. One a buffer is not needed, it is freed or better put on a second linked list with available buffers and reuse that buffer later. You'll avoid memory allocation/deallocation which produce memory fragmentation which is also very bad if the application has to run continuously. Resizing and array (Remember TBytes is an array) is an inefficient operation. It involve copying data because the array can't always be expanded in place and obviously it involves memory alloc/free because you use a dynamic array (TBytes). I don't know what your receiver looks like nor if the data size is known up front. But if possible, it is better to preallocate a buffer large enough for - let's say - 90% of the occurrences and reuse that buffer again and again (Because as I said above you have a linked list of free buffers). -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
Linked list is among the fastest. Much faster than arrays or strings. But since you didn't told us how data is coming and which processing you need to do, all answers (Mine and from others) are just guess and probably not really helpful. You'll get performance if you minimize the number of data copy and memory allocation. Be aware of hidden data copy and allocation when you resize a dynamic array or a string and all variation. -
Best type for data buffer: TBytes, RawByteString, String, AnsiString, ...
FPiette replied to Rollo62's topic in Algorithms, Data Structures and Class Design
You forgot a data structure specifically designed to handle the processing of your data. For example linked list of some basic data type. Since we don't say anything about the details of your processing, I can't be more specific. -
OverbyteIcsLIBEAY.hpp Line 58 typedef void __cdecl (*TCryptoThreadIDCallback)(Overbyteicsssleay::PCRYPTO_THREADID ID);
FPiette replied to ICS_NEW's topic in General Help
Yes, this is what is required. No need to build one for Delphi since it already exists. -
Have a look at this answer on StackOverflow. It is about a TEdit, but IMO the same concept applies to a TComboBox.
-
Use a TTimer to change the color of the button periodically. If you need a lot of them, you can derive your own TFlashingButton class/component to have an easy to use flashing button on the tool palette.
-
Maybe this: https://www.virtual-serial-port.org
-
Localization inquery
FPiette replied to Clément's topic in Algorithms, Data Structures and Class Design
I use dxGetText (https://sourceforge.net/projects/dxgettext/) in all my application which must support several languages. To do the translation it self, I used PoEdit (https://poedit.net/). I have never been confronted to some parts being translated in one language and others translated in a different languages but I think it is possible to do it since translation process pass by functions you have control on it. -
I am using that solution with great success. 1) The main service launch a child process which does the work. 2) The main service is notified by Windows when his child exit (You can have a thread waiting for process termination). 3) The main service check child process health by sending a request using IPC. In my case the child service is accessed by clients so the main service use the same code to connect to the child process. If the connection fails, then the main service kill the child process. 4) When the child service gracefully terminate it set a flag so that the main service do not restart it but also close. The flag is actually a file created by the main service and deleted by the child process when terminating properly. If the main service detect the file is still there when the child process terminate, then the child process crashed.