-
Content Count
1167 -
Joined
-
Last visited
-
Days Won
16
Everything posted by FPiette
-
Works now.
-
Still down for me.
-
Count requests in different intervals
FPiette replied to chkaufmann's topic in Algorithms, Data Structures and Class Design
It is enough to store the request count per 5 sec interval. The other intervals can be computed form the 5 sec interval. To count for the 5 sec interval, you can increment a counter (in memory or in SQL table), rounding the timestamp to the nearest 5 sec and using that rounded value plus the user ID to locate the record to update (or insert if not already existent). At regular interval, you can delete all counters older than the desired retention time. For performance reason, you may buffer the counter in memory for one or more 5 sec intervals and then flush the memory to the database to secure the data. With that scheme; you have at most 12 * 60 * 24 = 17280 counter per day per active user. 2 bytes (short int) is enough if no use has more than 65535 requests per day. If they can do more, then you need more bytes per counter. -
Look at this report : https://quality.embarcadero.com/browse/RSP-33766 This is probably a similar issue. You should create a new report with the issue you see.
-
Yes, it should. I always code like that and when taking code from elsewhere, I rewrite it like that.
-
I like to use FreeAndNil for the same reason David explained for the rest : One day you make your procedure more complex, adding some code lines after the FreeAndNil and yet use the freed variable. Calling FreeAndNil instead of Free will make you quickly discover (AV° the error you made. The price is very low for this security.
-
You are partially right. This recommendation is for destructing a form in the context of an event handler of that form. In that case you need to call Release which defers the actual destruction after the event is terminated. This doesn't apply in this case.
-
You should stay with the original version for the reasons David gave. Additionally, pay attention to code indentation like this: procedure TMainForm.ButtonClick(Sender: Object) var myForm: TMyForm; begin MyForm := TMyForm.Create(nil); try MyForm.ShowModal; finally FreeAndNil(MyForm); end; end;
-
Copying character to string problem
FPiette replied to Lainkes's topic in Algorithms, Data Structures and Class Design
Yes I do. -
Copying character to string problem
FPiette replied to Lainkes's topic in Algorithms, Data Structures and Class Design
You said: " In Delphi a string is essentially a 1 based array of char". No matter how you try to say it is it doesn't make it happens. A Delphi string is NOT an array of elements of type char. If the were, they would be interchangeable and you admitted they are not. -
Copying character to string problem
FPiette replied to Lainkes's topic in Algorithms, Data Structures and Class Design
They key word is "Viewing". That's what I said: compiler magic makes that happens a string is not an array but sometimes looks like an array of char because of the [ ] that is usable. The two types string and array of char are not interchangeable. You will confuse the OP pretending they are the same. -
Copying character to string problem
FPiette replied to Lainkes's topic in Algorithms, Data Structures and Class Design
In Delphi a string is essentially a 1 based array of char Not really and I know you know it. It looks much like a 1 based array of char but it isn't at all compiler magic happens here. A string is a record with data used by the compiler a pointer to the actual characters, a count of characters (length), a reference count and more. -
Copying character to string problem
FPiette replied to Lainkes's topic in Algorithms, Data Structures and Class Design
Not at all ! -
Weird code in THttpConnection.ProcessWellKnownDir
FPiette replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
The new version I started to develop take 90% of existing ICS code. The new code is developed with Delphi 11 and no effort is done to support older compilers. Since I keep Delphi always up-to-date, it is likely that at the time of release, the next ICS version AKA V9 will officially and initially only support the latest Delphi at that time. -
One large unit vs multiple small units
FPiette replied to Oberon82's topic in RTL and Delphi Object Pascal
Like said, same app, since I heavily modularized I have not seen such issues any more. One frequent bug which becomes visible when changing OS is using a freed pointer or freed object or initialized local variable : the address point to somewhere not hurting in one OS but point to something useful in the other OS. I don't think the existed. But rearranging the code by moving some part of one unit in a new unit will cause the code to be linked in different places and the effect of the bug I mention above may be gone. Only the effect will magically disappear but not the bug, it will reappear later when code is again changed and the dangling pointer point again to something significant. As said in my first answer to the OP, that is how it should be done. But do not fall into the opposite trap and make lots of tiny units. -
One large unit vs multiple small units
FPiette replied to Oberon82's topic in RTL and Delphi Object Pascal
That is not a question of unit size nor number. Something else is wrong in your iOS or Android application. -
One large unit vs multiple small units
FPiette replied to Oberon82's topic in RTL and Delphi Object Pascal
Small units if better than one large. It helps separate things and it helps to program in a more object oriented way. -
Exception in TCustomSmtpClient.Destroy;
FPiette replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
You can use Delphi Remote debugger. You probably can run ReactOS in a virtual machine hosted on your Windows computer. I don't know ReactOS. It is not Windows and it is still at an early stage. You may be faced to incompatibilities between Windows and ReactOS. Did you try to run your program under Windows ? -
Exception in TCustomSmtpClient.Destroy;
FPiette replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
Run your application under the debugger in order to get the exact source line. -
Exception in TCustomSmtpClient.Destroy;
FPiette replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
You should tell us which source code line EXACTLY is causing the exception. madExcept could also help you find errors in code which doesn't immediately cause an exception. -
Weird code in THttpConnection.ProcessWellKnownDir
FPiette replied to Kyle_Katarn31's topic in ICS - Internet Component Suite
I'm not sure at all that the old Delphi compilers ICS still support have an option 3rd argument. -
This would probably break a lot of code!
-
I would suggest that the next time you buy a new computer, you restore a backup from the previous one (A full backup or a disk image). You'd probably have to "repair" windows if the hardware has changed. This would work if Embarcadero do NOT check for hardware configuration when validating the license (No idea if they do).
-
Recently I had to solve a similar issue. I solved it by spying the IDE file activity using ProcessMonitor (https://learn.microsoft.com/en-us/sysinternals/downloads/procmon). ProcessMonitor is a free tool which can display all file - among others - activity. Create a filter with the name of the module the IDE don't find and you'll get the list of folder where the IDE look for it.
-
Delphi TClientSocket can't connect to Arduino server, Socket error: 10061
FPiette replied to Dominik99's topic in VCL
Ethernet is not TCP/IP. Ethernet is a much lower level that TCP/IP. On a PC, when using TCP/IP, it almost always use Ethernet as lower level transport protocol. Tell us more about what you are EXACTLY using on your Arduino board and which model of Arduino board you are using so that we better understand what you are trying to do.