Jump to content

Anders Melander

Members
  • Content Count

    2312
  • Joined

  • Last visited

  • Days Won

    119

Everything posted by Anders Melander

  1. Anders Melander

    ANN: Better Translation Manager released

    my kbd just died so im typing w the on-screen kbd :-( I'll get on it when that's resolved
  2. Anders Melander

    ANN: Better Translation Manager released

    Yes, that was a bug. I've just pushed a fix. Do you need me to upload a new build or can make one yourself? P.S. Say hi to Arne for me.
  3. Anders Melander

    Is Move the fastest way to copy memory?

    Umm... You mean to say you haven't profiled it?
  4. Anders Melander

    Gradiant from an array of value

    https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-gradientfill ...or since you're using DevExpress anyway, use one of their gradient functions.
  5. Anders Melander

    some dxgettext improvements

    Fork the project and commit the changes there. SourceForge has become an OpenSource graveyard. Last I heard of Lars was this: https://www.sn.dk/halsnaes-kommune/lars-har-aabnet-sit-hjem-for-to-ukrainere/ (It's about him hosting some Ukranian refugees). His personal domain is no longer functional so I'm guessing he's too busy for hobby projects these days.
  6. Anders Melander

    Delphi component for MRZ and NFC reader for Passport

    How many do you need?
  7. Anders Melander

    Rounded polygon

    I just remembered that Graphics32 has two examples which demonstrates interpolation: https://github.com/graphics32/graphics32/tree/master/Examples/Drawing/CubicSpline https://github.com/graphics32/graphics32/tree/master/Examples/Drawing/Curves Both of these just uses Graphics32 for output. The curve generation is independent. Built into Graphics32 there's also the TCanvas32.CurveTo method which does cubic Bézier interpolation (4 control points) and the TCanvas32.ConicTo method which does quadratic Bézier interpolation (3 control points).
  8. Anders Melander

    Rounded polygon

    I counted one photo of a Chinese paper lamp, two irrelevant meme pics, two general conceptual illustrations and 10 pages of math with no illustrations 😕
  9. Anders Melander

    Developer Express gave up on FMX

    A cop out from Julian Bucknall: https://supportcenter.devexpress.com/ticket/details/t1072425/vcl-roadmap-2022#c488df20-f902-4a5e-862d-6e39d11da2f2 TL;DR: Roadmaps are not promises and some of the items in them might not get implemented. Duh! DevExpress wasted a lot of resource on a failed Grid for FMX because reasons. DevExpress then used a lot of resource on a charting suite for VCL which they apparently have now decided was a mistake because they don't believe they can compete. Instead they will now focus on polishing existing VCL controls based on their .NET counterparts. Apparently there's no plans for this because they can't produce a roadmap for it. We'll know what we're getting when they deliver it. Personally, at this point in time, more than a roadmap, I believe I need a statement from DevExpress on how they plan to resolve the problem that their owners and developers are Russian, given that Russia in all likelihood soon will be joining Iran and North Korea in the technological stone age. I will be recommending my clients that they not renew their subscriptions until this has been resolved.
  10. A perfectly valid solution. You could also do it like this: TPackageItem = record WorkPackage: TWorkPackage; Padding: array[0..256-SizeOf(WorkPackage)-1) of byte; end; I don't know how you distribute the rows being processed by each thread but another thing to try is to ensure that each thread will be working on a contiguous set of rows. For example for 10 rows and 3 threads the rows should be divided something like this: AAAAAAAAAA AAAAAAAAAA AAAAAAAAAA BBBBBBBBBBB BBBBBBBBBBB BBBBBBBBBBB CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC CCCCCCCCCC and not like this: AAAAAAAAAA BBBBBBBBBBB CCCCCCCCCC AAAAAAAAAA BBBBBBBBBBB CCCCCCCCCC AAAAAAAAAA BBBBBBBBBBB CCCCCCCCCC CCCCCCCCCC This will improver cache locality. Another thing that will improve cache locality is only working on one row at a time. For example if you are averaging 3x3 pixels then I'm guessing that you are reading pixels from 3 different rows for each pixel. If the size of a row (or even 2 rows) is greater than the cache then this will trash the cache. To avoid this you can first process the bitmap horizontally, transpose the bitmap and then process it horizontally again. One might think that a transpose is too expensive but it's actually fairly cheap (if you use a good blocked transpose algorithm) and the gain from not thrashing the cache makes it worth it.
  11. It's a good thing we have Google then. There are lots of (relatively) easy to understand explanations these topics. The data being manipulated just needs to be in different cache lines. The size of a cache line depends on the processor. Again: Google.
  12. Yes but it doesn't do anything because supposedly FData=nil. Instead it terminates the thread (I'm guessing). This isn't how I would design a work queue but I don't think the queue's the problem. @dummzeuch Are threads reading from memory in the same cache line as other threads are writing to - or are the threads writing to memory in the same cache line. If so you are probably suffering from false sharing and/or cache-line ping pong.
  13. Anders Melander

    New Delphi job opportunity

    Broken eco-system. On the Danish job-sites I can see the same Delphi jobs being posted again and again and I've had something in the neighborhood of 10 unsolicited Delphi related job offers during the past 12 months. The last one, this past Friday, need 2-3 Delphi developers. "Unfortunately" I'm fully booked, overbooked actually, and there's only one of me 🙂
  14. Anders Melander

    ANN: Better Translation Manager released

    You might be able to use the existing CSV importer to import those into a project. Just specify "=" as the delimiter instead of ";"
  15. Anders Melander

    ANN: Better Translation Manager released

    I see. Can you reveal what tool was used to produce that format? Maybe I can make an importer for it. It's open source so you can do whatever you like with it. If you prefer to keep your existing format the easiest approach would probably be to modify a copy of the amLocalization.Persistence unit and then alter the TLocalizationCommandLineTool.LoadFromFile method in the amLocalization.CommandLine unit to use your own persistence class. It should be relatively easy to extend the existing solution with support for different project file formats using either an internal or external plugin architecture [*] but I'm not sure when I will have time to add that. * Internal=You register a class to handle your format and recompile. Very easy to implement for me. external=You build and register an external DLL which handles the format. Much more work as I would need to wrap much more stuff in interfaces.
  16. Anders Melander

    ANN: Better Translation Manager released

    The PE stub I use is defined in amLocalization.ResourceWriter.pas (see below). If a file named EmptyResourceModule.dll exists in the same folder as BTM then that file will be used as the stub. Otherwise the stub is loaded from a resource (see Source\Resources folder) and finally if that resource doesn't exist the hardcoded stub below will be used. const sResourceModuleStub = 'EmptyResourceModule.dll'; sResourceModuleStubRes = 'EmptyResourceModule'; // Name of above file as an embedded resource // The following is the content of the file specified by the sResourceModuleStub constant. // It should be a minimal (i.e. no code) PE module containing nothing but a resource section without any resources. sResourceModuleData : AnsiString = #$4D#$5A#$90#$00#$03#$00#$00#$00#$04#$00#$00#$00#$FF#$FF#$00#$00#$B8#$00#$00#$00#$00#$00#$00#$00#$40#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$B0#$00#$00#$00+ #$0E#$1F#$BA#$0E#$00#$B4#$09#$CD#$21#$B8#$01#$4C#$CD#$21#$54#$68#$69#$73#$20#$70#$72#$6F#$67#$72#$61#$6D#$20#$63#$61#$6E#$6E#$6F+ #$74#$20#$62#$65#$20#$72#$75#$6E#$20#$69#$6E#$20#$44#$4F#$53#$20#$6D#$6F#$64#$65#$2E#$0D#$0D#$0A#$24#$00#$00#$00#$00#$00#$00#$00+ #$37#$CF#$3C#$DF#$73#$AE#$52#$8C#$73#$AE#$52#$8C#$73#$AE#$52#$8C#$E1#$F0#$AD#$8C#$72#$AE#$52#$8C#$E4#$F0#$50#$8D#$72#$AE#$52#$8C+ #$52#$69#$63#$68#$73#$AE#$52#$8C#$00#$00#$00#$00#$00#$00#$00#$00#$50#$45#$00#$00#$4C#$01#$02#$00#$B0#$66#$81#$5A#$00#$00#$00#$00+ #$00#$00#$00#$00#$E0#$00#$02#$21#$0B#$01#$0E#$00#$00#$00#$00#$00#$00#$04#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$10#$00#$00+ #$00#$10#$00#$00#$00#$00#$00#$10#$00#$10#$00#$00#$00#$02#$00#$00#$06#$00#$00#$00#$00#$00#$00#$00#$06#$00#$00#$00#$00#$00#$00#$00+ #$00#$30#$00#$00#$00#$02#$00#$00#$00#$00#$00#$00#$02#$00#$40#$05#$00#$00#$10#$00#$00#$10#$00#$00#$00#$00#$10#$00#$00#$10#$00#$00+ #$00#$00#$00#$00#$10#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$20#$00#$00#$10#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$10#$00#$00#$1C#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$2E#$72#$64#$61#$74#$61#$00#$00#$70#$00#$00#$00#$00#$10#$00#$00#$00#$02#$00#$00#$00#$02#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$40#$00#$00#$40#$2E#$72#$73#$72#$63#$00#$00#$00#$10#$00#$00#$00#$00#$20#$00#$00+ #$00#$02#$00#$00#$00#$04#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$40#$00#$00#$40#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$B0#$66#$81#$5A#$00#$00#$00#$00#$0D#$00#$00#$00#$40#$00#$00#$00#$1C#$10#$00#$00#$1C#$02#$00#$00#$00#$00#$00#$00+ #$00#$10#$00#$00#$1C#$00#$00#$00#$2E#$72#$64#$61#$74#$61#$00#$00#$1C#$10#$00#$00#$54#$00#$00#$00#$2E#$72#$64#$61#$74#$61#$24#$7A+ #$7A#$7A#$64#$62#$67#$00#$00#$00#$00#$20#$00#$00#$10#$00#$00#$00#$2E#$72#$73#$72#$63#$24#$30#$31#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00+ #$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00#$00;
  17. Anders Melander

    ANN: Better Translation Manager released

    No. A resource module is just a PE file (a DLL) with a resource section but without any code. That's how I use it too. I use Bamboo with the following config for the BTM task (XXX is the target project name). The target is a 64-bit exe. Executable: c:\Tools\Better Translation Manager\amResourceModuleBuilder.exe Argument: "${bamboo.build.working.directory}\translation\XXX.xlat" -v -b -n:0 "-s:${bamboo.build.working.directory}\bin\XXX.exe" "-y:${bamboo.build.working.directory}\bin\XXX.drc" "-o:${bamboo.build.working.directory}\bin" What do you mean by "my own resource project format."?
  18. Anders Melander

    ANN: Better Translation Manager released

    Even if your target project is 64-bit you don't need the resource builder to be 64-bit. The 32-bit build works with both 32- and 64-bit targets. Yes, you're right. It should be a THandle or a NativeUInt. I have pushed the fix. Thanks.
  19. Anders Melander

    Developer Express gave up on FMX

    From the comment track on that page: Oh, those Russians I think you're right. https://www.linkedin.com/company/developer-express-inc./people/
  20. Anders Melander

    ANN: Better Translation Manager released

    Yes - and it works for me. Does it fail on every target project you run it against? Why do you want it as a 64-bit executable? I don't think there should be any need for it as the memory usage is quite modest when building resource modules.
  21. Anders Melander

    ImageLists. One or Multiple??

    It almost was, but they dropped that ball long time ago: http://melander.dk/reseditor/ The resource editor was meant to be a part of Delphi 2010 but even though I implemented all Embarcadero's requirements (primarily two-way RC file support) the required open tools API was never surfaced in Delphi (basically just the ability to register a custom module editor). And when they stopped communicating I simply gave up on that project. I almost deleted the source in anger.
  22. Anders Melander

    Developer Express gave up on FMX

    There's some interesting information in that thread. From what I could understand through Google translate: DevExpress is American owned. Their developers are primarily Russian. Their supporters are Russian & Ukrainian. Is that correct? BTW, I just found this one: https://supportcenter.devexpress.com/ticket/details/t1081876/regular-updates-and-new-features
  23. Anders Melander

    Developer Express gave up on FMX

    I don't know but it could be some of their support people are busy killing each other. I'm heavily invested in their products but I must say that I've had mixed experiences with them these last few years. Their attitude towards enhancements gets a bit tiresome. Too often I see a reasonable request answered with "We don't plan to further enhance X in the foreseeable future", "We're just wrapping a standard Windows control" or "That's not how Microsoft does it". It seems many of their products are, if not in actual maintenance mode, then not really evolving anymore. I'm sure it doesn't help that Julian Bucknall seems to have fallen out of love with Delphi.
  24. Anders Melander

    DUnitX and StackTraces

    I just looked in my own unit tests and I can see that I have added the following to enable madExcept support. I can't remember why - or even if it works. ...unrelated stuff snipped... // Work around for broken Delphi 10.3 compiler support in bundled DUnitX {$if defined(MADEXCEPT)} type TMadExcept4StackTraceProvider = class(TInterfacedObject, IStacktraceProvider) public function GetStackTrace(const ex: Exception; const exAddressAddress: Pointer): string; function PointerToLocationInfo(const Addrs: Pointer): string; function PointerToAddressInfo(Addrs: Pointer): string; end; function TMadExcept4StackTraceProvider.GetStackTrace(const ex: Exception; const exAddressAddress: Pointer): string; begin Result := madStackTrace.StackTrace(false, false, false, nil, nil, exAddressAddress, false, false, 0, 0, nil, @exAddressAddress); end; function TMadExcept4StackTraceProvider.PointerToAddressInfo(Addrs: Pointer): string; begin Result := String(StackAddrToStr(Addrs)); end; function TMadExcept4StackTraceProvider.PointerToLocationInfo(const Addrs: Pointer): string; begin Result := String(StackAddrToStr(Addrs)); end; {$ifend} begin {$if defined(MADEXCEPT)} TDUnitXIoC.DefaultContainer.RegisterType<IStacktraceProvider, TMadExcept4StackTraceProvider>(true); {$ifend} {$if defined(RUNNER_TESTINSIGHT)} ExecuteTestInsight; {$elseif defined(RUNNER_GUI)} ExecuteGUIRunner; {$else} ExecuteConsoleRunner; {$ifend} end.
  25. Anders Melander

    looking for remote Delphi job

    It would probably improve your chances of getting a response if you stated where in the world you're located and didn't post under an alias.
×