Jump to content

Anders Melander

Members
  • Content Count

    2943
  • Joined

  • Last visited

  • Days Won

    166

Everything posted by Anders Melander

  1. Anders Melander

    Interlocked API and memory-mapped files

    And it's extremely subject to race conditions. https://devblogs.microsoft.com/oldnewthing/20160826-00/?p=94185
  2. Anders Melander

    Interlocked API and memory-mapped files

    Why not just use the traditional synchronizations mechanism provided by the OS and keep things simple? It seems pointless focusing on micro optimizing the concurrency control of a buffer backed by virtual memory and accessed synchronously. The sync mechanism is not going to be the bottleneck. I have the code for a shared memory ring buffer somewhere if the OP is interested. I used it a few decades ago to pipe CodeSite log messages between a producer and a consumer service. The consumer wrote the log to disk.
  3. Call me old fashioned but the way you've formatted your code makes it close to unreadable to me.
  4. Anders Melander

    How do I enumerate all properties of a Variant?

    Instead of waiting on the back and forth I'll assume that what we have here is a classic case of the XY problem. To determine what properties a WMI object exposes you can use a tool like WMI Explorer (there are many other tools like that, this is just the first one I found).
  5. Anders Melander

    How do I enumerate all properties of a Variant?

    Those are just the WMI methods and they are all documented. https://docs.microsoft.com/en-us/windows/win32/api/wbemcli/nn-wbemcli-iwbemclassobject If you want to talk to a COM server why are you then going through WMI? Are you sure it isn't a WMI Provider you are talking about? If you install the Windows SDK (just the tools parts) there's a utility in it called OleView that you can use to examine type libraries and COM servers. The type library of your server is probably embedded in the EXE file. Edit: If it's a WMI provider then it's probably a DLL and it's probably early bound and without a type library. It depends on what kind of provider it is.
  6. Anders Melander

    How do I enumerate all properties of a Variant?

    Maybe if you learned the difference between OLE and COM you wouldn't be so scared... Hardly anyone uses OLE anymore.
  7. Storing a 31-bit value in a 64-bit intermediary doesn't magically produce more distinct values. You'll still have at most 2^31 distinct values.
  8. Anders Melander

    DelphiVCL: Fantastic! But there are some issues

    Hey Reinier! I think it must be over 20 years since I last heard from you. AFAIR you were the original maintainer of The Delphi Bug List. Ah, yes: https://web.archive.org/web/20001025065121/http://www.dataweb.nl/~r.p.sterkenburg/indexpag.htm Good to see you're still around.
  9. Most of them. You're scaling a 31-bit integer value in the approximate range 0..X-1 to the range 0..2^64-1 A lot of things wasn't mentioned. For example here's my solution which satisfies all the criteria that was mentioned: The result is 64-bit unsigned. It's cross platform. It compiles with FPC. It's random (for a large enough sample size). and as a bonus It's super fast. function SuperRandom: UInt64; begin Result := 1; end; (sorry - it's Friday)
  10. Anders Melander

    CrystalNet - .Net Runtime Library for Delphi

    You can ask @CrystalNet
  11. Anders Melander

    CrystalNet - .Net Runtime Library for Delphi

    Nope. I just use COM callable .NET wrappers. I would rather have the .NET code live in an external .NET assemble than introduce a dependency on a 3rd party library and have a dependency on .NET.
  12. I like it for internal documentation. For external use I think it sucks as you can't style it properly. If we were to replace it I would probably just use WordPress. Oh... wow. I just read their announcement. For Jira, Confluence and Bitbucket this won't affect us much. Our Jira and Confluence are already on cloud. But for Bamboo this definitely means that we'll have to find alternatives and Bitbucket pipelines isn't a viable alternative. I just took their migration quiz. Bamboo isn't listed at all... and for Bitbucket it recommended that I migrate to Bitbucket Data Center - which is also being EOL'd.. Classic Atlassian.
  13. Yeah, well Bamboo being an Atlassian product relies on paid 3rd party add-ins for even the simplest things It does have support for XMPP but that isn't supported by Teams.
  14. Nice. I've been using the following to post the status of our Bamboo build jobs (it's a PowerShell script) but I've been thinking about adding Teams notification to some of our automated test tools and your example will come in handy there. $uri = 'https://outlook.office.com/webhook/yadayadayada/IncomingWebhook/yadayadayada/yadayadayada-yada-yada-yada-yadayadayada' if("${bamboo_buildFailed}" -eq "true"){ $status = 'Failure' }else { $status = 'Success' } $body = ConvertTo-Json -Depth 4 @{ title = 'FooBar Build Notification' text = "Build of FooBar version ${bamboo.fileVersion} completed with status $status" sections = @( @{ activityTitle = 'FooBar Build' activitySubtitle = '${bamboo.buildKey}' activityText = 'The build of ${bamboo.planRepository.branchName} ${bamboo.planRepository.revision} completed.' activityImage = 'https://pbs.twimg.com/profile_images/1128664840233525248/T3YNFtIt_400x400.png' }, @{ title = 'Details' facts = @( @{ name = 'Branch' value = '${bamboo.planRepository.branchName}' }, @{ name = 'Revision' value = '${bamboo.planRepository.revision}' } ) } ) potentialAction = @(@{ '@context' = 'http://schema.org' '@type' = 'ViewAction' name = 'Click here for details' target = @('${bamboo.buildResultsUrl}') }) } Invoke-RestMethod -uri $uri -Method Post -body $body -ContentType 'application/json'
  15. Anders Melander

    Listview control with filtering like File Explorer

    It's so easy to throw a statement like that out there. Have you thought about the consequences of having the VCL maintained by a bunch of amat^H^H^H^H enthusiasts that are stuck on Delphi 7? Look at the JVCL if you're in doubt of what that would look like. If you want open source there's plenty to choose from already.
  16. Anders Melander

    Alpha Controls support for LMD Tools??

    Excellent question... for the AlphaControls forum: https://www.alphaskins.com/forum/
  17. Anders Melander

    "Debug process not initialized."

    Did you work in IT support before you became a developer? Every time I contact our IT department because there's something wrong with one of the servers, the first thing they ask me is to "restart windows". I've given up on educating them so now I just pretend. My current uptime is 118 days. Try disabling the MadExcept "IDE exception catching". Just to eliminate MadExcept as the cause.
  18. Anders Melander

    Compiler: Endless loop

    Try building with MSBuild (Project Options, Building, Delphi Compiler, Use MSBuild externally to compile). My current client have several projects that fail during compile with internal errors unless we use MSBuild. Wouldn't that be a linker issue then. This looks like a compiler issue.
  19. Anders Melander

    how to classify and match error message patterns?

    It sounds more like you're rubber ducking.
  20. Anders Melander

    Large address space awareness. How to test properly?

    Dudes. I'm not stupid. I'm not saying that it's good practice only that it's safe to cast between pointer and integer. The OP said that this was for 32-bit only so bringing 64-bit into the equation is also irrelevant. Thanks for playing.
  21. Anders Melander

    Large address space awareness. How to test properly?

    As long as it doesn't do "pointer math" on the integer value then there shouldn't be problems casting between integer and pointer.
  22. Anders Melander

    A bit confused about SVG

    You don't need to but you can. It's not really a SVG imagelist. It's an imagelist that also supports SVG meaning it can contain SVG, PNG, BMP, etc. This also mean that you can have one imagelist for low-res containing a mix of SVG and PNG and another for hi-res. I find that PNGs are often better for small (e.g. 16x16) low-res images.
  23. Anders Melander

    A bit confused about SVG

    You can only assign one imagelist at a time but if you've named your imagelist according to their instructions then they will switch between the different ones automatically. If you're using SVG then you only need one imagelist.
×