Leaderboard
Popular Content
Showing content with the highest reputation on 01/12/23 in all areas
-
(Possibly) interesting stuff to read
Tommi Prami posted a topic in Algorithms, Data Structures and Class Design
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- -
MAP2PDB - Profiling with VTune
Mahdi Safsafi replied to Anders Melander's topic in Delphi Third-Party
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); -
Does ChatAI make StackOverflow obsolete ?
Sherlock replied to david_navigator's topic in Tips / Blogs / Tutorials / Videos
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: -
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!
-
MAP2PDB - Profiling with VTune
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
MAP2PDB - Profiling with VTune
Vincent Parrett replied to Anders Melander's topic in Delphi Third-Party
Much simpler to switch to github, for gitlab you have to apply for free hosting of open source. -
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
-
MAP2PDB - Profiling with VTune
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
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. -
MAP2PDB - Profiling with VTune
Attila Kovacs replied to Anders Melander's topic in Delphi Third-Party
this bitbucket is a piece of shit -
MAP2PDB - Profiling with VTune
Anders Melander replied to Anders Melander's topic in Delphi Third-Party
Thanks. I'll get that fixed. https://bitbucket.org/anders_melander/map2pdb/issues/4/segment-index-incorrectly-parsed-as-hex -
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
-
"Always break line between else and if" vs. comments
David Heffernan replied to uligerhardt's topic in GExperts
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; -
LOL, no 😄
-
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.
-
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
-
[Problem] Convert DB from unidac sqlite to FD sqlite
programmerdelphi2k replied to kabiri's topic in FMX
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 -
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.)
-
There also is a confusing comment here https://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.SQLite_Encryption_Sample