Jump to content

Leaderboard


Popular Content

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

  1. pyscripter

    Interesting way to copy dynamic arrays.

    B=A does not cost much B = Copy(A, 0) moves memory and has a cost. In my use case A may be recreated (maybe not). If it is not recreated then I save the moving of memory. If it is recreated B becomes a unique copy after SetLength(A,...)
  2. salvadordf

    My new project : WebView4Delphi

    I just published a new project in GitHub called WebView4Delphi. WebView4Delphi allows you to embed Chromium based web browsers in your Delphi or Lazarus applications using the WebView2 runtime. It uses the latest stable version of the WebView2 nuget package 1.0.1054.31. I used many of the tricks I learned creating CEF4Delphi and you will notice many similarities if you used it. I still have to write the documentation but you can build the available demos to see it working in VCL, FMX and Lazarus apps. There are a few things pending like the "windowless mode". It's being distributed with a simple MIT license so anyone can do whatever s/he wants with it. https://github.com/salvadordf/WebView4Delphi
  3. Chris Pim

    D11, Android new App Billing Service

    After running my changes live for a few days, it looks like adding the permission back in has fixed the developer_error issue. I have absolutely no idea why as the official docs say you shouldn't need it. If anyone else has issues with Android billing from Delphi 11, I suggest you leave the legacy Vendor Billing permission turned on and see if it help you too.
  4. Fellow Delphi developers, This is with great pleasure that we announce the immediate availability of HelpNDoc 7.8, an easy to use yet powerful help authoring tool producing CHM help files, responsive HTML 5 and mobile Websites, DocX and PDF manuals, Markdown documents, ePub and Kindle eBooks as well as Qt Help files from a single source. HelpNDoc is Free for personal use and evaluation purposes and is available at: https://www.helpndoc.com HelpNDoc 7.8 provides many new features and enhancements such as the ability to insert documents and snippets' content into topics and to quickly convert topic content to snippets, new editor and user interface APIs to automate topic creation and modification, improved HTML and document importers and much more... You can learn more about this update at: https://www.helpndoc.com/news-and-articles/2021-12-07-use-snippets-as-topic-templates-reuse-topic-content-automate-topic-writing-and-more-in-helpndoc-7.8/ Video of some of the new features in HelpNDoc 7.8: Download HelpNDoc now and use it for free for personal and evaluation purposes: https://www.helpndoc.com/download Follow our step-by-step video guides to learn how to use HelpNDoc: Best regards, John, HelpNDoc team. https://www.helpndoc.com
  5. Anders Melander

    Interesting way to copy dynamic arrays.

    There's DynArrayUnique but it's undocumented and not really fit for direct use: procedure DynArrayUnique(var A: Pointer; typeInfo: Pointer); begin if (A <> nil) and (PDynArrayRec(PByte(A) - SizeOf(TDynArrayRec))^.RefCnt > 1) then DynArrayCopy(A, A, typeInfo); end;
  6. David Heffernan

    Interesting way to copy dynamic arrays.

    What would be nice would be if Emba could add a MakeUnique(arr) so that you could write code like with with clear intent
  7. Arsl01

    Deploy Delphi 11 iOS 15 XCode 13

    I solved the problem, it's my fault, I made the wrong certificate settings, sorry
  8. There's now an example of how to run a process on Android, here: https://github.com/DelphiWorlds/HowTo/tree/main/Demos/AndroidRunProcess Sadly, I have been unable to make it work with the Stockfish application that is available for download here: https://stockfishchess.org/download/ The process seems to start, however it also seems to lock up my application. There does not seem to be any clues in the device logcat messages as to what the problem is. The demo still includes the files, and the code that attempts to run it, however the code has been commented out in favour of some more basic executables that are known to work. I have put my efforts on hold (though I may use the run process code myself for something else), and have thrown it open to anyone else who might be able to make it work.
  9. Thank you for the question, David. It's probably not obvious at all... the reason Rubicon search results come back so quickly is because the answer is known in advance, and that's because the word-to-location index is created before searches are done. That's called indexing. Re-indexing happens when the text changes. I'll give you some scenarios to clarify. 1. Natural delay between text changes. Let's say the text data comes from a government publication which comes out monthly. No text data changes except at the time of publication. Therefore it is perfectly natural to add information about the new text data on a monthly basis. In terms of workflow, at some point after the new text data is available, an EXE compiled with Delphi + perhaps FireDAC components + Rubicon would "Make" the index such that it includes the new text data. Something needs to run that EXE, either a human being or a windows task or something else in the ecosystem. The "index" which we call the WORDS table lives in some database. The WORDS table might live the same database as your text data or it might be separate. You can have a hybrid of an Oracle database with a SQLite or NexusDB words table. The "Make" process generates a table which essentially tracks the location of every word within the text -- and "location" means LongInt identifier. In this scenario, you would probably naturally know the last cut-off of your indexing, and be able to use Append mode to merge in the information for the newly released text. ("Make" is a complete re-index, "Append" picks up where the last round of indexing left off.) 2. Daily updates on a smallish text database. Let's say the text data is something on a personal or small business LAN system, such that complete re-indexing would take less than 5 minutes. That could happen nightly, similar to a nightly backup workflow. You would just use Make to reindex the whole thing because it's fast and there's no need to build anything more complicated. Ideally this is when a bartending system is integrated with the personal computer, so running the index triggers creation of the user's favorite beverage. 🙂 The 5 minute guideline is for the system architect to contemplate. Maybe the business actually closes at 6pm and you could re-index for 6 hours without bothering anyone. Then you could do this on a fairly large database. 3. Multi-user add/edit/delete maintenance to tables which include text relating to a single ID, perhaps a Job or an Invoice or a manufacturing part. This is challenging, and can be in fact impossible if the rate of text editing exceeds the ability to update the Words table. It boils down to whether there will be collisions on individual popular words. The problem is not multi-user collision on the record being edited but on the location-data associated with the keyword being indexed. If you look at the Rubicon Showcase project and stare at the Words table for a few minutes, you'll probably see what I mean. There is a BLOB storing location data for each word, so if two users modify text memos and both of them use the word 'surrogate' then there will be contention on updating the Blob relating to 'surrogate.' In the recipe sample system, there would be a contention when two users modified a recipe using an 'egg'. Collision can be likely if there are enough users or the text entries are frequently similar. Therefore this is not an ideal use-case for Rubicon unless there are multiple seconds between edits, perhaps because the majority of users are in readonly reporting mode. You can still do it by cycling between two indices, one which is used for searches but is a little delayed in knowing everything, and one which is regenerated on a schedule and swapped into active use. Whether this is practical comes down to the database size, hardware spec, DBMS speed, and how necessary it is to have data available a microsecond after it has been typed. Ok, that was a long answer! Cheers. -- A huge THANK YOU to everyone who has filled in our survey and obtained their discounts already. Ann Lynnworth HREF Tools Corp. https://www.href.com
  10. Remy Lebeau

    Simple JSON parsing

    That is an unusual thing to do. This is really no better than a try..finally: try ... finally // sends response as json contents Connection.IOHandler.WriteLn(Response); end; But, what if it is the last WriteLn() that raises the exception? Then you try the same WriteLn() again? I would use this instead: try ... finally try // sends response as json contents Connection.IOHandler.WriteLn(Response); except end; end; Though, are you really sure you want to catch an exception at all? You are going to leave the connection in an unstable state. You may as well just let the exception propagate up the call stack uncaught, and let the server catch it and close the connection for you.
  11. Lars Fosdal

    Olaf Monien's Multithread demo on DelphiCon was nice!

    https://s3.amazonaws.com/heysummit-production/media/uploads/events/delphicon/MonienThreading-Intel-vs-M1.zip and you need a unit from here: https://github.com/omonien/sieve-of-eratosthenes-delphi
×