Jump to content

Tommi Prami

Members
  • Content Count

    273
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Tommi Prami

  1. Tommi Prami

    TArray<T> helper

    Stumbled upon this. https://github.com/WilliCommer/ArrayHelper This really should be part of RTL already. Good job from author, If in RTL would not need add unit to the uses. (OR paste unit of one's own but...) -Tee-
  2. Tommi Prami

    Overloocked Format( ) options

    FixInsight tries to check Format strings and parameter count, which is nice. Not checking types I think. Have found couple of bugs with it. -Tee-
  3. Tommi Prami

    TArray<T> helper

    Dang πŸ™‚ My Bad.
  4. Tommi Prami

    Main screen tab error

    I've got the same problem
  5. Could someone point into nice implementation? Would be nice (but not 100% necessary) that would have similar functionality than RTL version have. More than less drop in replacement (Easy to port) -Tee-
  6. You got good Delphi implementation of that πŸ˜„
  7. OK, Let me try again, any reasonably fast, Free and OpenSource implementation of good Random number generator algorithm, that is tested statistically to give better randomness than Stock RTL one.. I have no knowledge on which algorithm is best for what, that is why I am asking. I have an impression that Mersenne twisters are not suggested anymore. As mentioned above xoshiro / xoroshiro generators I have heard are good. But again, have no idea how to choose better one. I would not ask if I had all needed info πŸ™‚ -Tee-
  8. I just need random numbers that have better quality than stock Random() function in the RTL. I think that is valid requirement. -Tee-
  9. For now, I am open to all suggestions πŸ™‚ Just need to get random numbers and have some Randomize-functionality. As long it is way better tna build in RTL version. If can use it to replace RTL version in code, way or other, I am happy πŸ™‚ -Tee-
  10. Sometimes removing withs, especially nested ones, are really tricky. Easy to mess up. Just got bit by this other day. IDE/Compiler/LSP must know which is which, so it would get first pass way faster than doing it manually. https://quality.embarcadero.com/browse/RSP-18953?filter=-2 On a side note thee has not been too much love towards refactoring features in IDE. Hope it would get more and ones we have to get better. -Tee-
  11. Exactly. And also removing withs are quite pain by hand. More complicated it is. Nested with clauses are pure evil. Even ones that seems trivial are pain to remove sometimes. -Tee-
  12. Hello, Is there a way to tell TDataset that now would be preferred time to do some filtering of records? Current record or all. -Tee-
  13. Tommi Prami

    How to kick TDataset to filter record(s)

    That is discussion of another time,. That code Above was satisfactory for my needs. But maybe helpful for some other tough. Or different use case. Thanks for your suggestion. -Tee-
  14. Tommi Prami

    How to kick TDataset to filter record(s)

    Sure that works, but I think that filters whole dataset, which I did not want. -Tee-
  15. Tommi Prami

    How to kick TDataset to filter record(s)

    I do not present the problem at there. That was my Quick and dirty solution to the problem -.Tee.-
  16. Tommi Prami

    How to kick TDataset to filter record(s)

    Hmmm... No wonder... πŸ™‚ Dataset have emails, I load filtered emails on startup to the TSringList. Andf use OnFilerRecord (Etc event of dataset to filter those out). I need also to filtr out rows from dataset on runtime, and I need to kick the TDataset that Hey Dude, Filter current work right now. And code above more than less filled my need. Using GotoBookMark(). -Tee-
  17. Tommi Prami

    How to kick TDataset to filter record(s)

    Problem was that I Have filtered dataset, but the Filtering criteria or filtered rows criteria is changed separate from data on dataset.. I have something like: function KickDatasetFilterRecord(const ADataSet: TDataSet): TBookmark; var LBookmark: TBookmark; begin LBookmark := ADataSet.GetBookmark; try if not ADataSet.Eof then ADataSet.Next else ADataSet.Prior; Result := ADataSet.GetBookmark; finally if ADataSet.BookmarkValid(LBookmark) then ADataSet.GotoBookmark(LBookmark); end; end; procedure Foo(const AEmail: string); begin FFilteredEmails.Add(AEmail) ; // Filter current wor now. Dataset.GotoBookmark(KickDatasetFilterRecord(Dataset)); end;
  18. Tommi Prami

    How to kick TDataset to filter record(s)

    One way seems to use GotoBookmark.
  19. Hello, One piece of code we use (3rd party component) is taking bitmapdata and put rgb values to stream. And on large bitmap this will take quite a long time, due the sheer amount of pixels to go through, Original code was even sl,owe because it used Pixels []-property. Now it uses Scanline. There is two different buffering (now) strategies but changes to that buffering (Collect data to byte array and write that once and awhile to stream) strategy changes can only go so far. I was just pondering coulΓΆd there be any weird bit fiddling trics etc to get that RGBA -> RGB byte triplet faster? That is the most common operation anyhow. I eman this: LLine := ASrcmap.Scanline[LY]; for LX := 0 to xdim - 1 do begin bbuff[BP] := LLine[LX].R; // RGBColor^.red; bbuff[BP + 1] := LLine[LX].G; // RGBColor^.green; bbuff[BP + 2] := LLine[LX].B; // RGBColor^.blue; Inc(BP, 3); end; Any ideas?
  20. Added "BitShifter and write 3 bytes at the time" to buffer code provided by @Anders Melander I would have guessed that this would have speeded things up a bit. But no πŸ˜„ -Tee-
  21. Tommi Prami

    TBCEditor text editor component

    Some claim it is rebranded SynEdit, which it is not. Author said right away that Show me where there is SynEdit code, and I'll change it. No one presented anything (Meaningful at least) TBCEditor works fundamentally differently (Or made differently) than SynEdit.
  22. Tommi Prami

    TBCEditor text editor component

    TBCEditor was made by my coworker. Saying "violation the SynEdit license" might be bit overstatement, as I remembered someone found couple of trivial pieces, when Author said show me the code and I'll rewrite, nobody did nothing so... It was ground up rewrite more than less from Scratch. Spend couple of years coding it every day basically. This weird dude who ripped TBCEditor off was extremely rude, so Author just took it off of public. Editor (or it's descendant) is in Text Editor Pro, which is very good text editor tool. And yes, totally abandoned and left in state that would need lot of work from dedicated people to fix for sure.
  23. This seems interesting Random number generator algorithm, don't have any authority to actually prove it tough. https://www.pcg-random.org/ There is some Delphi implementation at https://github.com/LUXOPHIA/LUX IT is way too complex if you only need one algorithm. Also one 32 bit version at https://github.com/mpodvin/PCG32-Random. Dunno how it is going to compare with https://bitbucket.org/egrange/dwscript/src/master/Source/dwsRandom.pas if someone knows, I would be happy to learn. -Tee-
  24. Problem (to me) is that I've seen 10x speedup without using that much ScanLine, And would be nice to abple to reproduce that scenario. Some one also made simple test app and saw that ScanLines too significant time, alone, without other code.
  25. Fair point. Said in some point that this is 3rd part library, very small part of it, tough more than less obsolete and we started to fix it our self's, But some portion we have no control of it, like TBitmap (Would be total rewrite of huge library)
Γ—