-
Content Count
2857 -
Joined
-
Last visited
-
Days Won
101
Everything posted by dummzeuch
-
The simplest way i can think of is a hosted web server that supports https for your clients (add some kind of logon if you need it) and uses sftp to upload files.
-
When sorting a “StringList” is very costly
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Impressive: sorted reverse half random QuickSort(10000000): 0.69550 0.72872 not done 1.89622 QuickSort+(12)(10000000): 0.63999 0.65609 3.61170 1.70513 QuickSort+(15)(10000000): 0.63134 0.66484 3.65941 1.72658 QuickSort+(17)(10000000): 0.63200 0.65742 3.58655 1.73312 QuickSort+(20)(10000000): 0.59678 0.62114 3.60640 1.75100 TimSort(10000000): 0.02052 0.03282 0.11939 1.88033 QuickSort(100000000): 8.13450 8.50642 not done 21.52633 QuickSort+(12)(100000000): 7.16910 7.47369 45.95549 19.66967 QuickSort+(15)(100000000): 7.25634 7.49350 45.59182 19.57720 QuickSort+(17)(100000000): 7.15293 7.43410 46.06242 19.69688 QuickSort+(20)(100000000): 7.26109 7.46288 46.09772 20.61769 TimSort(100000000): 0.20487 0.33015 1.12082 23.05309 This is the result of a test sorting an array of 10 Million and 100 milliion integers on my computer. The values are the time in seconds. QuickSort is my regular quicksort implementation QuickSort+ is my optimized quicksort which: choses a pivot by selecting the median between elements Left, Right and (Left + Right) / 2 uses InsertionSort for small sets, if Right - Left < Cutoff (The value in parenthesis is the cutoff.) TimSort is the code from the link above, adjusted so it compiles with Delphi 2007 (no generics). Edit: Here is the source code. Note that It currently can only sort an array of integer. -
When sorting a “StringList” is very costly
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Don't know whether it's any good, but here is one for free pascal: https://github.com/avk959/LGenerics Unit lgMiscUtils -
When sorting a “StringList” is very costly
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
A ListView would also require lots of messages, but from experience i know that it can easily handle thousands of lines and still be reasonable fast (we're talking about less than 200 here). A VirtualTreeview would be an option, but meaning to add yet another component which i am rather reluctant to do in this case. Another option would be a (virtual) StringGrid, I actually started down that road but decided to try and improve that sorting first. Now I've got a solution that's fast enough and works, so I'll probably leave it as is. -
When sorting a “StringList” is very costly
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
As I said: A virtual ChecklistBox would have been ideal, but unfortunately that mode has been broken since forever. So it's either live with that, or use a different control (ListView?). I'm still considering the latter, but I'm not sure it's worth the effort since it's fast enough now and newer IDEs already come with a similar functionality. -
When sorting a “StringList” is very costly
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Hm, good point, I'll have to check that too. Edit: No, doesn't happen. -
When sorting a “StringList” is very costly
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
Yes @Anders Melander, you are right in all points. Unfortunately none of the options you mention was possible in this case (Delphi 6 -> no Generics, Objects already used). I could also have used TStringList.Objects to store the old index and use Sort, just as you describe for TList<integer>, but that wouldn't have helped much in this particular case. The point of this post was that everything else is better than directly using the Items property and that it is not obvious why. A virtual CheckListBox would have been even better, but that code is broken since like forever. -
Security - How freaky can you get!
dummzeuch replied to Clément's topic in Algorithms, Data Structures and Class Design
I think you meant "worse" here. -
Range Check Error - what actually happens
dummzeuch replied to david_navigator's topic in Algorithms, Data Structures and Class Design
This should do the trick: function GetSetCardinality(const aSet; aLen: Word): Word; var B, i: Integer; abyte: PByte; begin Result := 0; abyte := @aSet; for B := 0 to aLen - 1 do begin for i := 0 to 7 do if (abyte^ and (1 shl i)) <> 0 then Inc(Result); Inc(abyte); end; end; test code: var SomeSet: set of 0..255; Count: Word; begin SomeSet := [1, 5, 6, 100, 200]; Count := GetSetCardinality(SomeSet, SizeOf(SomeSet)); Count should be set to 5, the number if elements in the set. ALen should be 32. var SomeSet: set of 0..10; Count: Word; begin SomeSet := [1, 5, 6]; Count := GetSetCardinality(SomeSet, SizeOf(SomeSet)); Count should be set to 3, ALen should be 2 (one byte has 8 bits, the set can have 11 elements (0..11) which is > 8 and <= 16 -> 2 bytes. -
Range Check Error - what actually happens
dummzeuch replied to david_navigator's topic in Algorithms, Data Structures and Class Design
Even worse: It provides a false sense of security and on top of that results in a runtime error that isn't really an error in this case. On the other hand, there is the aLength parameter which supposedly contains the length of the aSet parameter in bytes and there is nothing to prevent it from being larger than Length(bytes) (Assuming that aSet is a set as the name implies it has a maximum size of 32 bytes = 256 elements, each represented by one bit). Using a PByte would probably be better here and some comment would also be in order. -
Are Valid Dates?
dummzeuch replied to Ian Branch's topic in Algorithms, Data Structures and Class Design
Why are these dates stored as strings in the first place? If they are in a database they should be in a date field. If they were entered with a date picker, they should be TDate or TDateTime variables. If you want to store them as strings in a database for whatever reason, store them in a standard format: ISO 8601, and document that format. Don't rely on your users having Windows configured for any particular date format, you will find somebody who didn't, especially if your program is used in more than one country. And keep in mind, that date formats can be ambiguous: 01/12/15 can be 12 January 1915 or 12 January 2015 (American format), 1 December 2015 (British format), 15 December 2001 (some MSSQL format that looks like they got ISO 8601 wing). The only one I haven't seen so far is using the middle term for the year, but I'm sure some idiot will come up with that too. TryStringToDate by default uses the Windows settings, so that's out in this case. I wrote my own conversion and checking code for ISO 8601. It's in my dzlib if you are interested. -
Just remembered capecod gunny (Michael Riley) who wrote some financial software in Delphi. Not sure whether it can apply here because it seem very specific to - in my view - typical American problems. https://www.zilchworks.com/zilch-standard.asp
-
Excel is a nice tool for simple everyday tasks. It becomes a support nightmare once it somehow gets involved in the business procedures, because of course everybody thinks he is an expert in Excel and knows exactly how to use it and how to change stuff. Sooner or later you will end up with a monster spreadsheet that nobody can understand. As to the topic: Either people know how to use spreadsheets, then they will probably already use it for that task, or they don't, in which case they most likely will be overwhelmed when you give them anything more than a table with a few sums. Will they pay you for support? By the hour? If not, don't use Excel. You will end up either spending a lot of unpaid time for support or they will hate you, because you don't.
-
The current version doesn't work with Delphi (as reported in that project and in the SemanticMerge forums). I fixed that issue a while ago, but by now even that fix might no longer work: https://github.com/dummzeuch/pas2yaml But I don't use it (I only tried it for a while), so I don't really care.
-
New Explicit Properties Filter expert in GExperts
dummzeuch replied to dummzeuch's topic in Tips / Blogs / Tutorials / Videos
I think you are, because a different monitor resolution won't change anything for the position or size of a control. Only different pixel densities will, but these properties won't help there either. But whatever the reason for these properties, they are an annoyance and not useful for most people. -
Where to report bugs or feature requests? Or how to make pull request?
dummzeuch replied to Tommi Prami's topic in GExperts
That would only make a difference if I received more than one patch per month. Currently I'm not even getting that "many". I doubt that switching to Github would result in more. It didn't work for other Delphi related projects, as far as I can see. -
Yes, that was in other projects. For graphics32 there was only the one you saw. But I could probably also submit packages for other Delphi versions that currently don't exist. Yeah, that has happened / is happening with many Delphi libraries. I was shocked to find that Indy has only one developer left. dxgettext is mostly dead too, I get the odd bug report or sometimes bug fix which I try to apply, but I'm not the project lead, I only happen to still have write access to the repository, and Lars seems to be no longer much interested.
-
Try the attached project files. They go into a subdirectory Xx10.0 under source\packages. They compile for me, haven't tried to install them though. Graphics32_Delphi10.0.7z Yeah, great. I just submitted a pull request for theses files and got an email from Github that they will be disabling login with passwords by August 2021. They give several hints on what to do, but don't mention the svn bridge. I guess that's it then: No pull requests from me on Github any more. They got ignored most of the time anyway...
-
The JVCL also comes with some graphics manipulation functions. They look very similar to those in Graphics32 to me, so they might come from the same origin.
-
I just converted your code into an expert in revision #3418
-
What is GExperts? GExperts is a plugin for the Delphi IDE that adds many enhancements and also fixes some bugs. Which Delphi versions are supported? By the time of this writing GExperts supports Delphi 6 to 10.4 (with the exception of Delphi 8). GExperts releases always support/require the latest update for each Delphi version available at the time of the release. Where can download it? There is a link to downloads for the current and older releases on https://gexperts.dummzeuch.de I found a bug, what do I do? Please file a bug report. If you happen to have already fixed this bug, please also attach a patch or an archive with the changed source files. I have a brilliant idea for an improvement. What do I do? Please file a feature request. I have added some improvement to GExperts. Where can I submit it? Please also file a feature request and attach a patch or an archive with changed source files. Why shouldn't I report bugs an request features through this forum? I prefer to work on the actual program rather than being my own secretary. Taking posts from the forum and create the bug reports / feature requests is boring and time consuming work. I don’t want to do that work. Where is the source code? See compiling your own DLL. Why is GExperts still on SourceForge rather than on Github like all the other important projects? I happen to like SubVersion better than Git. Github does not support SubVersion (apart from a bridge with limited features). What if I have a question not covered in this list? There is a more comprehensive list of frequently asked questions on my homepage Additional questions can of course be asked in the forum.
-
ANN: Parnassus Parallel Debugger
dummzeuch replied to Dave Millington (personal)'s topic in Delphi Third-Party
I second that, but as always I would prefer text + screen shots over a video because it's searchable and I can easily jump between the parts that are currently important for me. -
Where to report bugs or feature requests? Or how to make pull request?
dummzeuch replied to Tommi Prami's topic in GExperts
https://gexperts.dummzeuch.de has a menu "GExperts" which looks like this ... ... and links to pages that in turn have links to: https://sourceforge.net/p/gexperts/bugs/ and https://sourceforge.net/p/gexperts/feature-requests respectively. The bug report / feature request dialog in GExperts also links there. Regarding pull requests: Since this is not github, there is no such thing. If you want to contribute, post a feature request or bug report and attach a patch or, if you prefer that, an archive with the the changed sources. If you plan to contribute regularly, you can get write access to the svn reqository. @Daniel Would it be possible to make a sticky post in this forum with this information? -
Now that you mentioned it, I remember that I always wanted to try that tool as soon as I move to a more recent Delphi version...
-
As I wrote: This works find for libraries. Components are a problem, because they are installed globally. There are various solutions for that too, e.g. custom registry branches, but they are a pain in the lower back anyway.