-
Content Count
2857 -
Joined
-
Last visited
-
Days Won
101
Everything posted by dummzeuch
-
Enable the map file in the linker settings and then select "parse map file" in GExperts Grep. It will then search all files listed in the map file. Of course this only works if your project compiles or at least compiled at one time, so a map file exists. Also, the map file only contains files that contribute code to the executable, so e.g. units only containing ressourcestrings won't be searched.
-
That's the whole point of NTP.
-
If you don't want to use the local time of the computer, you need a different time source. There is of course NTP (network time protocol), if you have an internet connection. Then there are various hardware solutions, but if those are available they are usually already used to set the local time (actually, recent Windows already uses NTP to adjust the system time). And then there is GPS, which also contains UTC in various of its NMEA sentences. Always keep in mind that there is a delay between the source sending the time and your program receiving it.
-
D10.4.2 where's setting to not debug into RTL ?
dummzeuch replied to David Schwartz's topic in Delphi IDE and APIs
You can compile without debug dcus. That's in compiler settings. Or you can press F8 (step over) or even Shift+F8 (run until return). And then there is a plug-in by @Uwe Raabe that can manage which debug dcus should be used. I forgot the name though. -
Tool to inspect properties at run-time?
dummzeuch replied to PeterPanettone's topic in Delphi Third-Party
There is also an object inspector component in the jvcl. -
It is a GPStructuredStorage file written by @Primož Gabrijelčič. The implementation is in unit GPStructuredStorage located in externalsource. If I remember correctly this expert originally used some kind of database but since the Delphi personal editions didn't support databases at some time it was changed to this free format supported by all Delphi versions and variants. No idea whether Primoz was actually involved in this or just contributed the format and implementation.
-
There is no way to import snippets or merge two .fs files. The file type is binary, so it's not even possible to merge them manually with an editor as it would be possible with a text based file. I guess an export and import functionality would be nice, but I doubt that I will implement it any time soon. But feel free to add a feature request on SourceForge.
-
I don't really see much of a difference between using a listbox and using a one column string grid.
-
No. You will have to move a control with the mouse for this to happen. Alternatively you can select (many) controls and click Position -> Snap to grid in the context menu. Whichever way you chose, it requires manual work.
-
What about TStringGrid / TDrawGrid?
-
ping @David Millington
-
You can't. What you can do is do the drawing yourself (isn't that necessary for TDrawGrid anyway?) and if nothing is supposed to be selected, don't draw the focus rectangle. But that would only be visual, If you read row and column they will still have some value. And it would also be necessary to somehow detect when something is being selected. It's easy to detect when the user clicks on something with the mouse, but more difficult when he wants to use the keyboard. It might be easier to have a special row that contains the entry "<nothing>" or similar instead.
-
GExperts can only check for shortcuts that are assigned to actions registered with the IDE. The keyboard shortcuts of the code editor cannot be discovered through any means that I know of (which is a real shame, because it should be simple to create an OTA method for it).
-
Build / Output messages filtering plugin
dummzeuch replied to CoMPi74's topic in Delphi IDE and APIs
Which Delphi version was that for? My guess would be Delphi 7 or earlier, because later versions use a VirtualTreeview and I found no way to get at its contents. -
Build / Output messages filtering plugin
dummzeuch replied to CoMPi74's topic in Delphi IDE and APIs
I've got something called msbuildfilter as part of my buildtools, But It solves a different problem even though it does parse the msbuild output. It's not open source and I can't easily make it. So it's not possible to simply adapt it to this purpose So, no, nothing readily available up my sleeve. 😉 -
I have got two programs which execute the same code as the first step in some processing. It's about checking huge (like in 100 gigabytes) files for consistency. These files are basically a container for large binary data (blob) of different sizes. Each blob has some small metadata (a few 100 bytes) stored just in front of it. The data is stored in chunks of n blobs each chunk is preceded by a descriptor which contains a pointer to the next descriptor and n pointers and size of blobs stored in this chunk. The structure is like this: file header chunkA descriptorA data1 metadata1 blob1 data2 metadata2 blob2 data3 metadata3 blob3 ... dataN metadataN blobN chunkB descriptorB dataN+1 metadataN+1 blobN+1 dataN+2 metadataN+2 blobN+2 dataN+3 metadataN+3 blobN+3 ... data2*N metadata2*N blob2*N ... These files are created incrementally on a different computer by a different program. Every time a blob is added it gets appended to the last chunk until that chunk is full at which point a new chunk appended appended. Then these files are transferred to the computer that runs the programs I am talking about here. There they are available from a local hard drive (so there is no network access involved when reading them). Both programs read the metadata from the blobs and check them for consistency. In order to do that they first read all the descriptors and put them into an array. Then they go through these descriptors and read the corresponding metadata for each blob. This means that they read small parts from all over the huge file, skipping the actual binary content in the process. The first time this is done in Program1, it takes several minutes. When I repeat this the second time (even when exiting the program and starting it again) the full process takes only a few seconds. So I thought that Windows 10 does some really efficient caching which is great. But then I started Program2 which as the first step also does the same consistency check (same source code) on the same file. Program1 was still running but had already finished the processing. Program2 then took several minutes to complete that check. When I abort the check, close Program2 and then restart it again, the check moves to the entry it last processed within a second and then again takes much longer to process the rest. Once it's done, exiting it and starting it again the same effect happens as with Program1: The consistency check takes only seconds. To summarize: Program1 takes several minutes for the check on the first run. Program1 takes only a few seconds for the check on subsequent runs. Program2 takes several minutes for the check on the first run even though Program1 had just done the same check on the same file and was still active. When I abort Program2 and restart it again, it only takes seconds to reach the position where I aborted the last run and then slows down again. Once Program2 has finished processing the file, running it again the processing only takes seconds. Can anybody explain this phenomenon to me? If it's Windows caching I would have expected that Program2 would only take seconds because it would take advantage of the data in the file cache put there by Program1. But that doesn't happen. Just in case it matters: Both programs are Delphi 2007 programs (so 32 bit) and they are running on Windows 10 64 bit. The checking code is exactly the same in both.
-
That sounds as if it might be a likely explanation. Unfortunately I haven't got a 32 bit OS available to me any more (the last one was Windows XP and went out about half a year ago) and I can't simply port this code to 64 bits either. Maybe I can recreate the effect with some simpler code though.
-
No COM or OLE in sight. This is plain Delphi code, using stream IO.
-
I looked a the performance tab of Task Manager and saw that during the fast access (presumably from cache) no disk access was shown "Active time" was 0). During the slow access (presumably not from cache), disk access was shown ("Active time" was high). By "cache counter", do you mean the number shown at the "cached" label (it says 3.9 GB and doesn't really change much)? I can't see anything called "cache counter" there. I also tried the resource monitor but it didn't show anything enlightening. The disk is local to me. I can see it in the computer sitting below my desk, it's attached via SATA to the on board controller, and it's a single hard disk (no SSD, no RAID). There is no Server involved at all. I didn't try perfmon (somehow I forgot that it exists).
-
st := TdzFile.Create(_Filename); try st.AccessMode := [faRead]; st.ShareMode := [fsRead]; st.CreateDisposition := fcOpenFailIfNotExists; st.Open;
-
I can't really imagine writing any code > WriteLn('hello world'); without using SysUtils and Classes. And I doubt that many will go this way. Eliminating the VCL is a different matter. That's possible if the lib doesn't need a UI. But I would probably not even try that nowadays, not to just save a few megabytes.
-
Wouldn't the inline declaration solve this problem?
-
File Copy implementation with Progress Callback
dummzeuch replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
My dzlib has TFilesystem.CopyFileWithProgress in unit u_dzFileUtils. It's a wrapper around the WinAPI function CopyFileEx. I also seem to remember such a functionality in the jcl. -
Advantages of record constructor over record class function, reviewed after CustomRecords
dummzeuch replied to Rollo62's topic in RTL and Delphi Object Pascal
That's why I still think the old object model did it right with explicit memory allocation separate from the constructor: MyInstPtr := new(TSomeObjectType, Init(Parameters, go, here)); vs. MyInst.Init(...); (I hope I remembered the syntax correctly. It has been over a decade that I used this.) -
Fast Pos & StringReplace for 64 bit
dummzeuch replied to Tom de Neef's topic in Algorithms, Data Structures and Class Design
Apache or MPL are the most commonly used when you want few restrictions.