Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/12/22 in all areas

  1. Anders Melander

    Interfaces - Time to face my ignorance.

    Why? What problem are you trying to solve? While I'm definitely a proponent of interfaces at a higher level, at low level they often just obfuscate the code. Apart from that I think your solution has a number of "smells": Why is the TDrawingObject.ObjectType writable? Does the ObjectType really need to change after construction? Why is TDrawingObject.DrawingObjectsList writable? Who owns the list? (might have been covered before. TL;DR) Instead of exposing the whole TObjectList<> class, expose only the relevant parts (Add, Remove, Enumerator). See: Why is TDrawingObjectsList.OwnsObjects part of the API? Isn't the ownership an implementation detail?
  2. sgcWebSockets is a complete package providing access to WebSocket, MQTT, STOMP, HTTP/2, STUN, TURN... and more protocols and APIs.  What's new - Added support for OpenSSL 3.0.0 (Windows, OSX, Android, iOS and Linux) - Added support for RTCMultiConnection, which is a WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.) Multi-User Video Conference Screen Sharing Video Broadcasting Main Features: - WebSocket and HTTP/2 Support: sgcWebSockets includes client and server-side implementations of the WebSocket protocol (RFC 6455). HTTP/s is also full supported. Support for plain TCP is also included. - SSL/TLS for Security: Your messages are secure using our SSL/TLS implementation. Widest compatibility via support for modern TLS 1.3 and TLS 1.2 - Protocols and APIs: Several protocols are supported: MQTT (3.1.1 and 5.0), STOMP, WEBRTC, SIGNALR CORE, WAMP... Built-in protocols support Transactions, Datasets, QoS, big file transfers and more. APIs supported for third-parties like Binance, Coinbase, Kraken, FTX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Javascript and .NET projects. Includes Server, Clients and several protocols for building and connecting to WebSocket applications. - High Performance WebSocket Server based on Microsoft HTTP Framework and IOCP. - Authorization protocols like OAuth2 and JWT are supported on Server and Client Components. - STUN and TURN protocols are supported on Server and Client Components Trial Version: https://www.esegece.com/websockets/download/download-delphi-cbuilder Compiled Demos: https://download.esegece.com/sgcWebSockets_bin.zip More Info: https://www.esegece.com/websockets
  3. You can compress the file before sending. Should give you the best result.
  4. These numbers are randomly distributed? When not, it might be more space efficient to store differences (after converting them to integers). If differences are small, you could use variable-length storing (7 bit data, 1 bit as indicator, that another byte is used). And finally a compression.
  5. If the values for each block don't use the full value range, you can store a base value and only the difference for the others. In other words: Instead of always subtract 30, find the min value of that block (Vmin), store that followed by the other values with the min value subtracted (V - VMin). Of course that would only help if Vmax - Vmin <= 65535.
  6. Vincent Gsell

    Is it Omni question ?

    Even is heap is captured, object life time is not guaranted. i.e. : Your Exception object (E) is (certainly) no longer available when Proc in queue is running. Put E.Message in a string just before TThread.Queue Hint : CoInitialize... Try ... Finally CoUninitialize end; would be cooler here !
  7. Dalija Prasnikar

    Interfaces - Time to face my ignorance.

    If you are having trouble managing objects memory, then using interfaces is a bad option as using them requires even more knowledge. Yes, they can manage memory for you, but there is so much fine print attached I wouldn't recommend it as a starting point. Your drawing object list class also has some unnecessary code as it inherits from generic TObjectList that already automatically handles all that. I have simplified your code and added some basic workflow. uses System.Generics.Collections; type TDrawingObjectType = (doChild, doBackground); TDrawingObjectsList = class; //Forward Declaration TDrawingObject = class private FObjectType: TDrawingObjectType; FDrawingObjectsList: TDrawingObjectsList; public constructor Create(AObjectType: TDrawingObjectType); destructor Destroy; override; property ObjectType: TDrawingObjectType read FObjectType write FObjectType; property DrawingObjectsList: TDrawingObjectsList read FDrawingObjectsList; end; TDrawingObjectsList = class(TObjectList<TDrawingObject>) public procedure DrawDraw(ACanvas: IskCanvas); procedure LoadDrawingObjects; end; procedure BuildList(List: TDrawingObjectsList); var Root: TDrawingObject; implementation constructor TDrawingObject.Create(AObjectType: TDrawingObjectType); begin FDrawingObjectsList := TDrawingObjectsList.Create(True); end; destructor TDrawingObject.Destroy; begin FDrawingObjectsList.Free; inherited; end; procedure BuildList(List: TDrawingObjectsList); var Item: TDrawingObject; begin List.Clear; // build list Item := TDrawingObject.Create(doChild); // set Item data // ... // Add Item to List List.Add(Item); Item := TDrawingObject.Create(doChild); // set Item data // ... // Add Item to List List.Add(Item); end; initialization Root := TDrawingObject.Create(doBackground); BuildList(Root.DrawingObjectsList); finalization Root.Free; end. FDrawingObjectsList list will handle lifetime of any drawing object added to the list, so you don't have to deal with them. Please note that you cannot add same drawing object to multiple lists as it will be released twice, causing exception. Next, FDrawingObjectsList belongs to its drawing object instance and as such it should be constructed in constructor and destroyed in destructor of TDrawingObject. Nobody else should free that list nor assign anything to its reference there is no reason for it to be writeable property. Constructing/destroying part is the simplest and safest possible, there are other more complex coding patterns that involve lazy initialization, but they require more code and there is more room for bugs. Unless you need to preserve memory as much as possible, you don't need to deal with more complicated code. And if needed you can easily add that later on. There is additional mistake in your destructor declaration. You are missing override directive. Without it destructor will never be called and you will have memory leaks. I have created global Root object and populated it in initialization section. You don't have to make it a global, this is just to illustrate how to work with Root object and how to populate its data. BuildList takes TDrawingObjectsList as a parameter and populates existing list without constructing new one. if the list already has some items it will be cleared - you can omit clearing the list if you know you will populate it only once, or you can clear it in outside code before calling BuildList. I am not going to comment on the interface part as it would be a really long write.
  8. Don't insert tabs in your source. Don't use [weak] Use the notification mechanism built into TComponent: type TComponentA = class(TComponent, IComponentAl) private FComponentB: TComponentB; private procedure SetComponentB(const Value: TComponentB); protected procedure Notification(AComponent: TComponent; Operation: TOperation); override; published property ComponentB: TComponentB read FComponentB write SetComponentB; end; procedure TComponentA.SetComponentB(const Value: TComponentB); begin if (FComponentB <> nil) then FComponentB.RemoveFreeNotification(Self); FComponentB := Value; if (FComponentB <> nil) then FComponentB.AddFreeNotification(Self); end; procedure TComponentA.Notification(AComponent: TComponent; Operation: TOperation); begin inherited; if (AComponent = FComponentB) and (Operation = opRemove) then FComponentB := nil; end;
  9. DelphiUdIT

    Windows XP App

    If you are FTDI chips in use you have only one way to work on XP: you must use the VCP drivers of FTDI (Virtual Com Port) that simulates the standard Windows com serial port. The drivers should be signed with version prior 2.12.24 !!! You'll find the drivers for XP in this page: All VCP FTDI drivers version for all version of SO Of course you can use the driver on XP if the FT4232 chip is supported ..... In your TCOMPort component use COMx, I mean the COM port listed in the device manager of windows. Hope this help. Bye
  10. DelphiUdIT

    Windows XP App

    That function is called for example by the library used with FTDI USB to RS232 / RS485 peripherals. If someone has integrated FTDI peripheral functionality as a COM (serial) component that function may be called. But from what I know, the drivers for those devices no longer load in XP. The serial devices of the FTDI are in very common use.
  11. Angus Robertson

    Windows XP App

    I guess there is more than one component called TComPort, I was referring to the Winsoft version, but that seems to be called ComPort. A quick search of TComPort does not find any setupdi functions. Nor support for modern compilers. Angus
  12. JDRenk

    Windows XP App

    Yes, XP must go away!
  13. David Heffernan

    Windows XP App

    Wouldn't it just be better to stop using XP? Doesn't even sound like you have a machine to test on which is tough for a program based on USB devices.
  14. David Heffernan

    Windows XP App

    Then it sounds like the issue is with your USB library. You'll need to dig into this, but my expectation is that the Delphi runtime won't call that function, so it's your code that does. You'll be more experienced once you solve this!!
  15. Remy Lebeau

    Windows XP App

  16. sgcWebSockets is a complete package providing access to WebSocket, MQTT, STOMP, AMQP, HTTP/2, STUN, TURN... and more protocols and APIs.  What's new in latest versions - Added support for WhatsApp Cloud API. Meta (formally Facebook) announced recently that all businesses can now access WhatsApp Cloud API for free (the requirement of using a third-party solution provider is not needed anymore). The API allows to send Text, Media, Location and Interactive Messages. Receive notification status about messages sent and much more. https://www.esegece.com/community/blog/delphi-whatsapp-cloud-api An online WhatsApp Bot demo is available, just open the following link in your phone and send any text message to interactuate with the Bot. https://www.esegece.com/demo/whatsapp - OpenAPI Pascal Client Parser can generate client SDKs for any API: OpenAPI 3.0, Swagger 2.0 and Swagger 1.0 (JSON or YAML formats). The following SDKs have been generated: Amazon AWS SDK, Google Cloud SDK and Microsoft Azure SDK. https://www.esegece.com/openapi Main Features: - WebSocket and HTTP/2 Support: sgcWebSockets includes client and server-side implementations of the WebSocket protocol (RFC 6455). HTTP/s is also full supported. Support for plain TCP is also included. - SSL/TLS for Security: Your messages are secure using our SSL/TLS implementation. Widest compatibility via support for modern TLS 1.3 and TLS 1.2 - Protocols and APIs: Several protocols are supported: MQTT (3.1.1 and 5.0), STOMP, AMQP, WEBRTC, SIGNALR CORE, WAMP... Built-in protocols support Transactions, Datasets, QoS, big file transfers and more. APIs supported for third-parties like Binance, Coinbase, Kraken, FTX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Javascript and .NET projects. Includes Server, Clients and several protocols for building and connecting to WebSocket applications. - High Performance WebSocket Server based on Microsoft HTTP Framework and IOCP. - WhatsApp and Telegram clients. - Authorization protocols like OAuth2 and JWT are supported on Server and Client Components. - STUN and TURN protocols are supported on Server and Client Components - OpenAPI Pascal Client Generator for OpenAPI 3.0 and Swagger 1.0-2.0. Trial Version: https://www.esegece.com/websockets/download/download-delphi-cbuilder Compiled Demos: https://download.esegece.com/sgcWebSockets_bin.zip More Info: https://www.esegece.com/websockets
  17. sgcWebSockets is a complete package providing access to WebSocket, MQTT, STOMP, AMQP, HTTP/2, STUN, TURN... and more protocols and APIs.  What's new in latest versions - Added support for AMQP 0.9.1 client protocol. - Servers can integrate external OAuth2 Providers like Azure AD, Google, Facebook... so the user can login using Azure Account. - Implemented Kucoin Client WebSocket and REST APIs (sport and futures). - Improved Binance and FTX clients, now support Binance.us and FTX.us brokers. - Updated Telegram libraries to the latest version (Windows, OSX, Android, iOS and Linux). Main Features: - WebSocket and HTTP/2 Support: sgcWebSockets includes client and server-side implementations of the WebSocket protocol (RFC 6455). HTTP/s is also full supported. Support for plain TCP is also included. - SSL/TLS for Security: Your messages are secure using our SSL/TLS implementation. Widest compatibility via support for modern TLS 1.3 and TLS 1.2 - Protocols and APIs: Several protocols are supported: MQTT (3.1.1 and 5.0), STOMP, AMQP, WEBRTC, SIGNALR CORE, WAMP... Built-in protocols support Transactions, Datasets, QoS, big file transfers and more. APIs supported for third-parties like Binance, Coinbase, Kraken, FTX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Javascript and .NET projects. Includes Server, Clients and several protocols for building and connecting to WebSocket applications. - High Performance WebSocket Server based on Microsoft HTTP Framework and IOCP. - Authorization protocols like OAuth2 and JWT are supported on Server and Client Components. - STUN and TURN protocols are supported on Server and Client Components Trial Version: https://www.esegece.com/websockets/download/download-delphi-cbuilder Compiled Demos: https://download.esegece.com/sgcWebSockets_bin.zip More Info: https://www.esegece.com/websockets
  18. Hi, I am Sergio the developer of sgcWebsockets library (esegece.com). The MQTT protocol is supported (3.1.1 and 5.0) on plain TCP and WebSocket connections (secure connections are supported too) and can be compiled on all Delphi personalities (windows, mobile, linux...). You can check the following link, which contains more info about the MQTT client component: https://www.esegece.com/websockets/protocols/mqtt The documentation can be accessed from here: https://www.esegece.com/help/sgcWebSockets/#t=Components%2FProtocols%2FSubprotocols%2FMQTT%2FProtocol_MQTT.htm Kind Regards, Sergio
  19. sgcWebSockets is a complete package providing access to WebSocket, MQTT, STOMP, HTTP/2, STUN, TURN... and more protocols and APIs.  What's new - Support for Rad Studio 11 Alexandria, including the new OSXARM64. - New STUN/TURN Server and client 100% Pascal Code allowing to create Video conferences using WebRTC protocol and a WebBrowser as client. TURN Protocol TURN Client Component TURN Server Component STUN/TURN Server and Client The following online Demo shows how to create a Video Conference using the sgcWebSockets STUN/TURN server to bind/relay data and a WebSocket Server for signaling. The Demo is based on the AppRTC application from Github. WebRTC Demo - A new online Demo showing how integrate DevExtreme Data Grid with sgcWebSockets library, providing real-time updates using WebSocket as protocol. https://www.esegece.com:2053/devextreme_grid Main Features: - WebSocket and HTTP/2 Support: sgcWebSockets includes client and server-side implementations of the WebSocket protocol (RFC 6455). HTTP/s is also full supported. Support for plain TCP is also included. - SSL/TLS for Security: Your messages are secure using our SSL/TLS implementation. Widest compatibility via support for modern TLS 1.3 and TLS 1.2 - Protocols and APIs: Several protocols are supported: MQTT (3.1.1 and 5.0), STOMP, WEBRTC, SIGNALR CORE, WAMP... Built-in protocols support Transactions, Datasets, QoS, big file transfers and more. APIs supported for third-parties like Binance, Coinbase, Kraken, FTX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Javascript and .NET projects. Includes Server, Clients and several protocols for building and connecting to WebSocket applications. - High Performance WebSocket Server based on Microsoft HTTP Framework and IOCP. Trial Version: https://www.esegece.com/websockets/download Compiled Demos: https://download.esegece.com/sgcWebSockets_bin.zip More Info: https://www.esegece.com/websockets
  20. sgcWebSockets is a complete package providing access to HTML5 WebSockets API (WebSocket is a web technology providing for bi-directional, full-duplex communications channels, over a single Transmission Control Protocol (TCP) socket) allowing to create WebSocket Servers, and WebSocket clients in VCL, Lazarus and Firemonkey Applications.  What's new - New STUN Server and client components, allows to discover public IP address and can be used for WebRTC applications. STUN Delphi Client and Server - Apple Push Notifications Support using HTTP/2 client component. How Register App Send HTTP/2 Notifications Apple Push Notifications using JWT Apple Push Notifications using a Certificate - Improved OAuth2 Client, now supports Client Credentials, this means that can run as a service or an automated application. OAuth2 Client Credentials - FTX API is now supported allowing to receive real-time market data, place new orders, manage account and more. FTX API Client - Free TradeBar Application for Binance and Coinbase Pro Brokers. Shows how use sgcWebSockets API Clients to send Orders to the Broker. TradeBar for Binance TradeBar for Coinbase Pro Main Features: - WebSocket and HTTP/2 Support: sgcWebSockets includes client and server-side implementations of the WebSocket protocol (RFC 6455). HTTP/s is also full supported. Support for plain TCP is also included. - SSL/TLS for Security: Your messages are secure using our SSL/TLS implementation. Widest compatibility via support for modern TLS 1.3 and TLS 1.2 - Protocols and APIs: Several protocols are supported: MQTT (3.1.1 and 5.0), STOMP, WEBRTC, SIGNALR CORE, WAMP... Built-in protocols support Transactions, Datasets, QoS, big file transfers and more. APIs supported for third-parties like Binance, Coinbase, Kraken, FTX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Javascript and .NET projects. Includes Server, Clients and several protocols for building and connecting to WebSocket applications. - High Performance WebSocket Server based on Microsoft HTTP Framework and IOCP. Trial Version: https://www.esegece.com/websockets/download Compiled Demos: https://www.esegece.com/download/sgcWebSockets_bin.zip More Info: https://www.esegece.com/websockets
  21. esegece

    iOS push notification http/2

    Hi, sgcWebSockets (which I am the developer) supports HTTP/2 in Client and Server components (source code is 100% Delphi code without external dependencies, except openSSL libraries), so you can send push notifications using HTTP/2 protocol. To send notifications you can use Token-Based or Certificate-Based trust with APNs using HTTP/2 protocol and TLS 1.2 or later, both types of authentication are supported by sgcWebSockets. You can read more about this from the links below: Documentation Apple Push Notifications HTTP/2 Compiled Demo https://www.esegece.com/download/protocols/sgcApplePushNotifications.zip (Demo sources can be found in the trial, in folder: Demos\20.HTTP_Protocol\07.Apple_Push_Notifications) Trial https://www.esegece.com/websockets/download/download-delphi-cbuilder Kind Regards, Sergio
  22. Rollo62

    iPhoneOS15.X.sdk

    Welcome to the Apple money machine Thats why we are always forced to buy their latest stuff (and nobody really complains). I'm afraid there is no way out, but I haven't tried with hackintoshs or the like, beside thats illegal. I have the experience that Apple may control well when it requires real, certified hardware, instead of things like a VM.
×