Jump to content

FPiette

Members
  • Content Count

    1210
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by FPiette

  1. FPiette

    FinalizeSsl

    Are you sure all communications are done when you stop your service? Remember ICS component are asynchronous and work in the background.
  2. FPiette

    ICS & DelphiMVCFramework

    At first glance it is not correct. The component is asynchronous. Calling one method will merely start the process in the background. You shouldn't detach the component from the thread before it has finished the operation you requested. You should remind that ICS components are asynchronous and doesn't require multi-threading to execute a lot of operations in parallel. Multi-threading is only useful if you have a large number (hundreds) of active communications simultaneously. Other operations that your application does may require multi-threading, for example lengthy SQL requests if they don't use an asynchronous programming model.
  3. FPiette

    custom fonts and sizes showmessage()

    Why not create your own ShowMessage function? After all it is simply a modal form that you can easily build yourself to fit your needs.
  4. Please also fix your message. You can edit it.
  5. What is js_keres function?
  6. Use one of the functions: function ObjectIsType(const obj: ISuperObject; typ: TSuperType): boolean; function ObjectGetType(const obj: ISuperObject): TSuperType;
  7. Ask the developer! Before asking, read the SuperObject documentation.
  8. FPiette

    Create an XSD validated XML file

    I have no idea about XSD but for sure you can do the check in Delphi using System.RegularExpressions to do the check.
  9. FPiette

    Net Find Component

    You have to try the component in a sample application, creating the component at runtime. When it works, you can consider installing it in the IDE. That's not specific to that component but it is how any component has to be developed. When the component is in the sample application, you can use the debugger to understand where and why it blocks.
  10. FPiette

    Net Find Component

    You probably forgot to change Winsock to OverbyteIcsWinSock. The use clause should be this: uses Windows, Classes, SysUtils, ExtCtrls, OverbyteIcsWSocket, OverbyteIcsWSocketS, OverbyteIcsWinSock;
  11. Is your problem solved? If not, on which line EXACTLY does your code cause an AV? Run your program under the debugger using the debug release.
  12. FPiette

    Net Find Component

    What is the problem with "Src : TSockAddrIn;" ? What error message give the compiler. You really have to help us to help you!
  13. FPiette

    ScreenSnap and real window position (D7)

    Override the form's DoShow procedure and from there post a custom message to the form. In the corresponding message handler restore the form position and size. If you want an example, look at https://github.com/fpiette/OvbImgOrganizer/blob/main/Source/OvbImgOrganizer.Main.pas
  14. On which line EXACTLY does your code cause an AV?
  15. FPiette

    Net Find Component

    Please describe the problem you get. And tell us which Delphi version you use.
  16. FPiette

    location based

    In which space are your points? The formula and code I gave is for computing the distance between two points of given by their geographic coordinates (On a sphere which is the earth in my code). The distance is computed on a great-circle. The formula for two points located on a plane is different and simpler.
  17. FPiette

    location based

    What is the relation with your initial question and my answer ?
  18. FPiette

    location based

    If you are talking about geographic coordinates, look at the haversine formula. function HaversineDist( Lat1 : Extended; // Latitude of point 1 in degrees Lng1 : Extended; // Longitude of point 1 in degrees Lat2 : Extended; // Latitude of point 2 in degrees Lng2 : Extended) // Longitude of point 2 in degrees : Extended; // Distance in meters var Dx, Dy, Dz : Extended; const Diameter = 2 * 6372.8 * 1000; // Meters begin Lng1 := DegToRad(Lng1 - Lng2); Lat1 := DegToRad(Lat1); Lat2 := DegToRad(Lat2); Dz := Sin(Lat1) - Sin(Lat2); Dx := Cos(Lng1) * Cos(Lat1) - Cos(Lat2); Dy := Sin(Lng1) * Cos(Lat1); Result := ArcSin(Sqrt(sqr(Dx) + Sqr(Dy) + Sqr(Dz)) / 2) * Diameter; end;
  19. FPiette

    Is Embarcadero's DocWiki down?

    Works now.
  20. FPiette

    Is Embarcadero's DocWiki down?

    Still down for me.
  21. 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.
  22. FPiette

    Set colour for TStaticText with themes.

    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.
  23. FPiette

    Change of coding style/structure..

    Yes, it should. I always code like that and when taking code from elsewhere, I rewrite it like that.
  24. FPiette

    Change of coding style/structure..

    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.
  25. FPiette

    Change of coding style/structure..

    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.
×