Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/28/22 in all areas

  1. Alexander Sviridenkov

    1 day 50% discount on HTML Office Library

    https://delphihtmlcomponents.com/office.html Please use coupon code BFO2022 HTML Office Library is a cross platform and 100% native solution for reading and displaying MS Office files (RTF, XLS, XLSX, XLSB, DOC. DOCX, PPT, PPTX), PDF, EPUB, MD, FB2, WMF, EMF, PICT, MSG, EML, OutLook (PST and OST) and The Bat mailboxes. For Word formats (DOC, DOCX, RTF) it supports both paged and web layout. Converted document can be displayed in VCL or FMX application (using included part of HTML Component Library) or browser. Conversion is threadsafe and do not use system API so can be used in Web serverrs. Embedded WMF/EMF/PICT vector images are converted to SVG. Library also contains full text search engine (also 100% written in Delphi) which is faster and requires less memory than other well-know solutions. Test on 8000 EPUB documents, 3.5 Gb. Application Indexing Time Index Size Mem used DocFetcher 3 min 476Mb 600Mb dtSearch 8 min 727Mb 1000Mb X1 Search 59 min 1260 Mb 600Mb Copernic 13 min 1150 Mb 500Mb Office Demo 1m 30s 145 Mb 300 Mb There are two compiled demos available: Simple document viewer: allows to view any document on hard drive using file tree on left side and HtPanel on right. https://delphihtmlcomponents.com/FileBrowser.zip Search Engine demo: create full text search index for documents located in selected folders and find any document from application or Web. https://delphihtmlcomponents.com/SearchEngine.zip No installation required. How to use: Run application (SearchEngine.exe). Click Add folder and select folder containing office documents or Outlook PST/OST databases. Click Start indexing, wait until it is completed. Search for documents using one of the following: a) Go to Search tab and enter search query (any words). b) Click Web interface icon and enter search query.
  2. vfbb

    Converting C++ API Post Request into Delphi Code

    You can try using Refit, which is a library to consume apis rest in a simple way, without manipulating strings, json, or http components. First you would create a unit for your api: unit CheckBook; interface uses iPub.Rtl.Refit; // Just download and add it to your project: https://github.com/viniciusfbb/ipub-refit type TNewPayment = record Recipient: string; Name: string; Amount: Double; Number: string; Description: string; end; [BaseUrl('https://sandbox.checkbook.io/v3')] ICheckBookApi = interface(IipRestApi) ['{97789B20-5C26-4359-AC41-D2042C4FAEC7}'] [Post('/check/digital')] [Headers('Authorization', '{AuthToken}')] function CreateDigitalPayment(const ABody: TNewPayment): string; function GetAuthToken: string; procedure SetAuthToken(const AValue: string); property AuthToken: string read GetAuthToken write SetAuthToken; end; var FCheckBookApi: ICheckBookApi; implementation initialization FCheckBookApi := GRestService.&For<ICheckBookApi>; end. Then you would consume it in your forms as follows: uses CheckBook; procedure TForm1.Button1Click(Sender: TObject); var LNewPayment: TNewPayment; begin LNewPayment.Recipient := 'testing@checkbook.io'; LNewPayment.Name := 'Widgets Inc.'; LNewPayment.Amount := 5; LNewPayment.Number := ''; LNewPayment.Description := 'Test Payment'; FCheckBookApi.AuthToken := 'xxxxxxxxx:xxxxxxxx'; ShowMessage(FCheckBookApi.CreateDigitalPayment(LNewPayment)); end;
  3. programmerdelphi2k

    Possible changes to string/char handling in Delphi 11(.2)?

    "statistical timer"... your percents values is well defined!!! :)))
  4. type TMyStack<T> = class(TStack<T>) function Peek(indexFromTop: Integer): T; overload; inline; end; {$IF RTLVersion < 33} type TStackAccess<T> = class(TEnumerable<T>) FItems: TArray<T>; property List: TArray<T> read FItems; end; {$IFEND} function TMyStack<T>.Peek(indexFromTop: Integer): T; begin Result := {$IF RTLVersion < 33}TStackAccess<T>(Self).{$IFEND}List[Count - indexFromTop - 1]; end;
  5. This can be frustrating to understand, because technically your code works. The comment above is right on point, your next step in isolating this should really be using SysInternals Process Explorer and use the Environment tab to examine the environment variables. Compare the run from the IDE and from Windows explorer and then you know, based on the difference, what to set and what gets set from the IDE.
  6. Stefan Glienke

    ANN: Open Source Event Bus NX Horizon

    Spring4D Events are just multicast events (like your regular OnClick but with possibly multiple handlers) - an event bus is more.
  7. I think it's far more likely to be environment variables being inherited.
  8. Are you running the application from the IDE, either run or debug? Close the IDE and then run your executable, it will likely work.
  9. ptlycldy

    Hoiw to visualize GRIB2 Files

    The GRIB2 data is highly compressed data that effectively is a giant matrix. GRIB2 is a compression format just like *.ZIP or *.TAR files are compressed files. GRIB2 files are massive files and are compressed to make transmission faster. There are decompression programs that you can find free on the internet that will read them and create a gridded data file (matrix is a better description.) And I'd suggest using those programs to extract the data rather than writing your own. The next step is to select what data you wish to plot. For example, the GFS model covers the entire world, and I believe the spacing is a value every one degree of lat and Long. That is 129,699 values for every parameter, for every level -- surface to 10mb -- for every time period for 16 days. To plot a map, you have to go into this immense file and pick out those points that you want to display on the projected area of the map. To complicate it, some values are actually pairs of data, one on one grid, and one on another. Wind data is one such set. To evaluate the wind at one point, you have to get the correct value from the correct point in two 129,699 point grids. Finally, once you have your array of data that you want to plot, you have to plot it on to a map projection. Unless you commit to using a simple Mercator projection, and your background bitmap is also a measurable Mercator projection, Overlaying the weather data onto an existing map on the screen will not be trivial either. If you can find out exactly what projection your bitmap image was created with, you job will be much easier. Without that, I would recommend you create your own background map in a projection that you have the equations for and like. Then comes the job of converting every data point (lat/long) into the X/Y coordinates of the screen. This is all do-able--I've done it for creating trajectory forecasts for objects at about 100,000 ft ASL. Just want to let you know that this is not a "beginner's" project and it will take a lot of time. In another post, you were asking about plotting fronts and pressure centers on a bitmap image. I'd suggest knocking that project out first. That has all the challenges of putting data out onto a map projection, but using simplified data values: lat/long points for fronts, and a couple of numerical values for the Highs and Lows. The advantage of doing that smaller project is I think those weather messages come out 4 times a day (or at least twice a day) and you can go on-line to check your plot against the "official" plot presumably where NWS took the data from. Just be sure to check the product issue dates and times--that you don't have an outdated map to compare against. It is essential that you always verify that you are plotting is what you think you are plotting. That the data are in the right place and have the correct values. Good luck on this project. Creating the program to plot fronts from the text message is a good one, and it will give you a working sub-routine that you can fold into later software you develop that also plots data onto maps. Handy to keep in your bag of tricks. Once you get the method of plotting data onto map projections down, then you might try getting into working with the GRIB2 data. Be sure you are solid on pointers and seek() commands, etc. Have fun, and let me know when you get results. Love to see them. ptlycldy
  10. Fr0sT.Brutal

    7zip (LZMA) compression

    Even that LZMA is not pure, it uses C obj files. Probably you could build LZMA2 objs as well and link them to Delphi app.
  11. Rollo62

    ANN: Open Source Event Bus NX Horizon

    Thanks for the insights. I just started to read your new book for some days now, since I get distracted here and there, but I already can say its very well written book and nicely structured. I hope to see more books like that, to core topics, from you soon.
  12. We need a real RawByteString without ANY implicit conversions. Just show a compiler error when trying to implicitly convert a string. Or improved TBytes with copy-on-write and all manipulation routines.
  13. Kryvich

    Test Bits in a Byte

    You can write it as If ((b and $01) > 0) or ((b and $08) > 0) or ((b and $80) > 0) then ... Or you can create an enumeration and use meaningful names for each bit. type TMyEnum = (mb0, mb1, mb2, mb3, mb4, mb5, mb6, mb7); TMyBits = set of TMyEnum; // = Byte in size function Test: Byte; var mbs: TMyBits; begin mbs := [mb0, mb3, mb7]; Byte(mbs) := $89; // It's equivalent of mbs := [mb0, mb3, mb7]; if mbs * [mb0, mb3, mb7] <> [] then // If one of bit is set ;//... if mbs * [mb0, mb3, mb7] = [mb0, mb3, mb7] then // If all 3 bits are set ;//... if mbs - [mb0, mb3, mb7] = [] then // If no other bits are set ;//... Include(mbs, mb1); // Set 2nd bit mbs := mbs - [mb3, mb7]; // Unset 4th and 8th bit //etc... Result := Byte(mbs); end; It's always better to deal with clearly named typed variables and constants.
×