Leaderboard
Popular Content
Showing content with the highest reputation on 01/29/21 in all areas
-
Hashing Street Addresses ?
A.M. Hoornweg replied to david_navigator's topic in Algorithms, Data Structures and Class Design
Can you use the postal code to identify the town and street? In the Netherlands we have a system where the postal code combined with the house nr uniquely identifies an address. For example, enter "Netherlands 2594 BD 10" in google Maps and you'll see where our king lives. -
Hashing Street Addresses ?
david_navigator replied to david_navigator's topic in Algorithms, Data Structures and Class Design
Thanks for all the replies and suggestions. Just went for a walk with the dog and realised that I don't need the address info at all, I can index the other data fields (5 x integers) to find the record I need 🙂 Amazing how doing something different often brings alternative solutions to the forefront. -
Hashing Street Addresses ?
Darian Miller replied to david_navigator's topic in Algorithms, Data Structures and Class Design
Also, zipcodes in the U.S. change all the time. Your best bet is to standardize the address and use that. (120,N,Franklin,St,Chicago,IL,USA) The standardization doesn't have to be perfect, just consistent. Just know that it won't ever be 100% correct and you will eventually end up with duplicates with differently formatted addresses. Otherwise just create a full covering index. Have an address table with a GUID as Primary Key and your 6 address fields. Create an index on your 6 address fields as varchars. Create a values table with your source/destination address guids and then your 10 floats. To optimize have a small Source Address table, and a larger Destination Address table. -
Install recent Delphi versions on Windows XP
Darian Miller replied to dummzeuch's topic in Delphi IDE and APIs
Agreed!! Even in simple usage it is unbelievably unnoying to have something running as a quick one-off on a Windows 10 system and come back the next morning to find the process was terminated and the system restarted due to a forced update. There are some options of blocking Windows 10 updates, but Microsoft seems to be actively working against those settings. Best bet is to block outgoing connections to the update servers at your firewall or simply redefine their update servers in a Hosts entry on the computer which is what I plan on doing soon as this just happened again to me yesterday. -
Prevent External DLL from Exiting Application
David Heffernan replied to fjames's topic in Python4Delphi
That's what RPyC would gain you -
Prevent External DLL from Exiting Application
Der schöne Günther replied to fjames's topic in Python4Delphi
Running the code in an auxiliary process instead of your own could also be an option if you cannot fix the cause and only battle the symptoms. -
My mistake. The ACanvas in my code is a DevExpress TcxCanvas - I didn't think about that. I think that if you use SaveDC/RestoreDC with a TCanvas then you'll need to lock the canvas to guard against the DC being changed. Something like this: ACanvas.Lock; try SaveDC(ACanvas.Handle); try ... finally RestoreDC(ACanvas.Handle, -1); end; finally ACanvas.Unlock; end;
-
ANN: Sempare Template Engine for Delphi
darnocian replied to darnocian's topic in Delphi Third-Party
BTW. The new release v1.4.0 is now also available on GetIt (https://getitnow.embarcadero.com/?q=sempare&product=rad-studio) -
ANN: Sempare Template Engine for Delphi
darnocian replied to darnocian's topic in Delphi Third-Party
I think subres should be an index into ChildRecords. Try change: to '<% for subresIdx in ChildRecords %>SubRes: |<% ChildRecords[subresIdx].Description %>|<br><%end%>'+ I've just renamed the variable as well to make it clearer. It may seem undesirable, but did it this way as sometimes you want to know where you are in the array. If you have many variables, you should be able to do: <% with ChildRecords[subresIdx] %> <% Description %> <% Vehicle %> <% end %> -
Hashing Street Addresses ?
David Heffernan replied to david_navigator's topic in Algorithms, Data Structures and Class Design
Yeah, that's not a hash. And what you want (known max length) is clearly impossible. If you could store arbitrary data in a lossless way in a data of a fixed length, then well, you can see where I am going. -
Hashing Street Addresses ?
Lars Fosdal replied to david_navigator's topic in Algorithms, Data Structures and Class Design
It looks like he wants to use a hash as a signature for an address - but that signature is only as good as the code doing signature building and the quality of the supplied data. The algorithm would need to understand ordering, abbreviations, perhaps even common typos. -
Hashing Street Addresses ?
David Heffernan replied to david_navigator's topic in Algorithms, Data Structures and Class Design
OK, maybe I misunderstood. I saw "hashing" and "indexed on", and inferred that you want to use a hashed collection like a dictionary. Hence the need to define data structure and what equality means. But perhaps you want to hash this data for some other reason. What will you do with this hash? -
If you are Ok with Java you can translate it to Delphi. Go to F-Droid Best for Android sources
- 14 replies
-
- screen
- screenshot
-
(and 2 more)
Tagged with:
-
Handle KeepAlive messages in a separate Thread (Indy TIdTCPClient)
Remy Lebeau replied to VTTB's topic in Network, Cloud and Web
You have two threads that are wanting to read at the same time, and write at the same time. This is not a good design choice. It is a race between the threads, you don't know which thread will actually receive which message, so BOTH threads have to be ready to reply to KeepAlives, and BOTH threads have to be ready to handle non-KeepAlive replies. And worse, it is possible that one thread may read bytes that the other thread is expecting. It is just not a good situation to be in. I would suggest a completely different approach. Have 2 worker threads - 1 thread whose sole task is to read ALL incoming packets, and 1 thread whose sole task is to write ALL outgoing packets. When the reading thread receives a message, if the message is a KeepAlive then the reading thread can ask the writing thread to send a reply, otherwise the reading thread can dispatch the message for processing as needed (which probably shouldn't be done in the main thread, if you can avoid it). When the main thread (or any other thread) wants to send a message, it can ask the writing thread to send it. This way, you don't need to synchronize the reads and writes anymore. Only synchronize the requests for sending messages. Reading thread: Reader.Execute while not Terminated receive data (no timeout) if message type is keepalive create ack message Writer.Send(message) else dispatch message for processing Writing thread: Writer.Send(message) queue.lock try queue.add(message) signal.set finally queue.unlock end Writer.Execute while not Terminated if signal.wait(timeout) try queue.lock try make copy of queue queue.clear signal.reset finally queue.unlock end; send messages in copy finally copy.clear end; Main thread: Main.DoSomething create xml message Writer.Send(message) Main.DataReceived(data) parse data if should send next message create xml message Writer.Send(message) -
@Dany Marmur as far as I can see @EgonHugeist already started the development of the Zeos-based memory table. The latest snapshot already has the TZMemTable component - now it's time to start to play with it! Edit: Seems to be working as it should: procedure TForm1.FormCreate(Sender: TObject); begin ZMemTable1.FieldDefs.Add('MyField', ftWideString); ZMemTable1.Open; Try ShowMessage(ZMemTable1.RecordCount.ToString); ZMemTable1.Append; ZMemTable1.FieldByName('MyField').AsString := 'Hello world!'; ZMemTable1.Post; ShowMessage(ZMemTable1.RecordCount.ToString + sLineBreak + ZMemTable1.FieldByName('MyField').AsString); Finally ZMemTable1.Close; End; end; At the moment it throws a nullpointer AV if it's destroyed while it's open but I'll send a pull request with a fix in a minute.
-
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 - The HTTP/2 Server has been improved in this version, HTTP/2 server push has been added as a new feature, has passed conformance tests to ensure is implemented according RFC7540 and RFC7541 and some bugs have been fixed. HTTP/2 Conformance Tests HTTP/2 Server Push - FastMM5 support, check the following article which compares the performance of sgcWebSockets library using FastMM4, FastMM5 and FastMM4-AVX FastMM4 vs FastMM5 vs FasMM4-AVX - Improved Google PubSub, now supports Service Accounts as a new Authentication protocol, this means that you can run a service or an automated application with the need to authenticate using a Web-Browser like with OAuth2 Google PubSub Service Accounts - Improved Telegram Client, now supports send messages with buttons. Telegram Send Messages With Buttons - Reverse Proxy is supported for HTTP requests. Forward HTTP requests 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, TLS 1.2, TLS 1.1 and TLS 1.0 - 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 Pusher, Bitfinex, Huobi, CEX... - Cross-platform: Share your code using our WebSockets library for your Delphi VCL, Firemonkey, Intraweb, Javascript and C# 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
-
We are glad to announce that StyleControls VCL v. 4.78 is released! http://www.almdev.com StyleControls VCL is a powerful, stable package of components, which uses Classic drawing, system Themes, GDI+ and VCL Styles. This package contains the unique solutions to extend standard VCL controls and also has many unique, advanced controls to create applications with UWP / Fluent UI design. Also with this package you can really improve applying and using of VCL Styles in your application.
-
For years Wilfried Mestdagh was maintaining a very good ICS FAQ at www.mestdagh.biz/ics/faq. He recently died 😞 RIP. We are looking for volunteers wanting to copy his valuable content to wiki.overbyte.be where other FAQ are already there. I'm afraid this content will disappear soon. If you want to help, contact me privately by email (You'll find my email at www.overbyte.be). Thanks.