Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/12/23 in all areas

  1. Stumbled upon few articles. Color quantization and related to that project http://blog.pkh.me/p/39-improving-color-quantization-heuristics.html http://blog.pkh.me/p/38-porting-oklab-colorspace-to-integer-arithmetic.html http://blog.pkh.me/p/36-figuring-out-round%2C-floor-and-ceil-with-integer-division.html UTF-8 <-> UTF-16 transcoding https://lemire.me/blog/2023/01/05/transcoding-unicode-with-avx-512-amd-zen-4-vs-intel-ice-lake/ Parsing JSON https://arxiv.org/abs/1902.08318 Validating UTF-8 https://arxiv.org/abs/2010.03090 -Tee-
  2. Mahdi Safsafi

    MAP2PDB - Profiling with VTune

    Excellent work ... Thanks ! I was using the tool with some map file and I got an AV error. I started investigating and I found a bug in the map parser : // debug.info.reader.map.pas (line 349): var SegmentID: Cardinal := HexToInt16(Reader.LineBuffer, n); The SegmentID should be read as a DECIMAL value and not as a HEX ! if the map file contains more than 9 segment, the next segment is emitted like (0010:xxxxx) but you're reading it like a hex (so its ID becomes 16 !) and then there is this line FSegments[ListIndex] := Result; // FSegments[10 .. ListIndex - 1] = nil => AV A simple fix : function DecToInt32(const s: string; var Offset: integer): integer; var P: PChar; begin Result := 0; P := PChar(s); while Ord(P^) in [$30 .. $39] do begin Result := (Result * 10) + (Ord(P^) - $30); Inc(P); Inc(Offset); end; end; // ... var SegmentID: Cardinal := DecToInt32(reader.LineBuffer, n);
  3. Well, there's your answer. And also why SO has banned AI generated answers. So...actually no need to start a new thread. Just chime in one of the other threads:
  4. Anders Melander

    MAP2PDB - Profiling with VTune

    It took me a bit longer than expected to get here but I believe I've finally reached the goal. The following shows VTune profiling a Delphi application, with symbol, line number and source code resolution: Download Get the source here: https://bitbucket.org/anders_melander/map2pdb/ And a precompiled exe here: https://bitbucket.org/anders_melander/map2pdb/downloads/ The source has only been tested with Delphi 10.3 - uses inline vars so it will not compile with older versions. Usage map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Parses the map file produced by Delphi and writes a PDB file. Usage: map2pdb [options] <map-filename> Options: -v Verbose output -pdb[:<output-filename>] Writes a PDB (default) -yaml[:<output-filename>] Writes an YAML file that can be used with llvm-pdbutil -bind[:<exe-filename>] Patches a Delphi compiled exe file to include a reference to the pdb file -test Works on test data. Ignores the input file Example: Configure your project linker options to output a Detailed map file. Compile the project. Execute map2pdb <map-filename> -bind Profile the application with VTune (or whatever) Known issues The -bind switch must occur after the filename contrary to the usage instructions. PDB files larger than 16Mb are not valid. This is currently by design. 64-bit PE files are not yet supported by the -bind option. As should be evident I decided not to go the DWARF route after all. After using a few days to read the DWARF specification and examine the FPC source I decided that it would be easier to leverage the PDB knowledge I had already acquired. Not that this has been easy. Even though I've been able to use the LLVM PDB implementation and Microsoft's PDB source as a reference LLVM's implementation is incomplete and buggy and the LLVM source is "modern C++" which means that it's close to unreadable in places. Microsoft's source, while written in clean C and guaranteed to be correct, doesn't compile and is poorly commented. Luckily it was nothing a few all-nighters with a disassembler and a hex editor couldn't solve. Enjoy!
  5. Anders Melander

    MAP2PDB - Profiling with VTune

    Yes, it is - but I like the spirit of Gitlab. I need to get some real-life experience with it anyway because I also plan to switch the company from BitBucket to Gitlab at some point. Github is way too expensive for enterprise use. I've had a Gitlab account for quite some time. AFAIR I didn't need to "apply". I think I just checked a box somewhere.
  6. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Much simpler to switch to github, for gitlab you have to apply for free hosting of open source.
  7. JimKueneman

    Can't Find SDK

    Thank you that kicked me in the right direction... order matters on XCode and Command Line Tools... https://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error Jim
  8. Anders Melander

    MAP2PDB - Profiling with VTune

    Yup. That pretty much sums it up. Like everything else Atlassian touches it only gets worse with time. My plan is to switch everything to Gitlab at some time but other stuff keeps getting in the way.
  9. Attila Kovacs

    MAP2PDB - Profiling with VTune

    this bitbucket is a piece of shit
  10. Anders Melander

    MAP2PDB - Profiling with VTune

    Thanks. I'll get that fixed. https://bitbucket.org/anders_melander/map2pdb/issues/4/segment-index-incorrectly-parsed-as-hex
  11. Dave Nottage

    Can't Find SDK

    I have the same setup as you and it works OK. On the Mac, can you open a Terminal window, execute this command: /usr/bin/xcodebuild -version -sdk If it succeeds, the results can be fairly lengthy, but you should see things like: MacOSX13.0.sdk in it
  12. David Heffernan

    "Always break line between else and if" vs. comments

    Personally I think it's much clearer like this: procedure MyProcedure(a, b: Boolean); begin if a then begin if b then Beep else Beep end else begin if b // Kommentar then Beep else Beep; end; end;
  13. Lars Fosdal

    OAuth2 bearer token example?

    LOL, no 😄
  14. Uwe Raabe

    OAuth2 bearer token example?

    It is possible that you have to implement it yourself in the way it is needed as it is noted in the docs: That said, giving a concrete example is difficult without knowing more details.
  15. weirdo12

    FireDAC + TableNames with '$'

    This might be of some help to Dmitry I suppose. These also work: SELECT * FROM wares$rules "wares$ rules$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "wares $ rules $" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$$$$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$ $" WHERE fldidxwarerule = :dummy_string_param But these do not: SELECT * FROM wares$rules "$$" WHERE fldidxwarerule = :dummy_string_param SELECT * FROM wares$rules "$$$" WHERE fldidxwarerule = :dummy_string_param
  16. programmerdelphi2k

    [Problem] Convert DB from unidac sqlite to FD sqlite

    well, if you know the "reason", then this way would be the better way to solve this problem. but if dont... if you can open in UniDAC usage, then, try UniDAC export /import manager Tutorial to CSV export https://www.sqlitetutorial.net/sqlite-export-csv/ or, you can use any other "DB Manager" to export it (datas) your database SQLite to any DB used by FireDAC
  17. Henry Olive

    Split String

    Thank You SO SO SO MUCH Uwe, Lars, Programmer I solved the problem as below 1- In Uses, I changed StrUtils to System.StrUtils in USES 2- In Uses, I moved QRCtrls, QuickRpt units BEFORE System.StrUtils (as Uwe said.) 3- In codes, I used System.StrUtils.SplitString( ... , ... ) (as Lars said.)
  18. Lars Fosdal

    [Problem] Convert DB from unidac sqlite to FD sqlite

    There also is a confusing comment here https://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.SQLite_Encryption_Sample
×