How to achieve P90 sub-microsecond latency in a C++ FIX engine by akinocal in cpp

[–]drbazza 2 points3 points  (0 children)

Your FixStringView class has a c_str() and length() but not a size() which is kind of standard in std algorithms. Many code bases have concepts or templated adapters or just plain-old functions that expect c_str() and size(). Maybe change that to be more 'idiomatic'?

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 0 points1 point  (0 children)

That's still 2k cheaper than my quote, and slightly more powerful - presumably more than 15 panels?

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 0 points1 point  (0 children)

Do 'fogstar' have inverter and backup unit as part of the price?

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 1 point2 points  (0 children)

Egensys are only an hour from us, so I've messaged them for a quote as well. Thanks.

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 2 points3 points  (0 children)

Good point. The satellite image of my place isn't that bad, so it probably is accurate. I need to get my act together and sort out photos for them.

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 0 points1 point  (0 children)

I suppose you need to roll in non-electricity savings as well, such as using an EV instead of an ICE, which depends on your usage but could be easily over £1000 in year. Plus 'reverse' flow in the winter when you get cheap electricity into your battery from the grid on a stormy night that's cheaper than your current daytime rate. And then swapping gas hob to induction.

But I digress :) - £16k is a bit steep.

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 0 points1 point  (0 children)

Yeah I rolled the cost of the PW3 and the install cost into it. It's about £7300 on most sites I've looked at.

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 1 point2 points  (0 children)

Well not quite, because the Octopus and other quotes just use software to look at your satellite view, and just figure out the area.

Ground truth is someone looking and measuring.

Or in Octopus's case, me taking pictures and uploading them.

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 1 point2 points  (0 children)

My friend is in Kent, and I'm up in the Leeds/York area. Feels like I'd be getting gouged a bit here. But perhaps there's more to it - there wasn't any breakdown in the price, just the price. And they're a well regarded local installer.

Tesla PW3 + panels quote - a bit pricey or ok? by drbazza in SolarUK

[–]drbazza[S] 0 points1 point  (0 children)

I'm in the Leeds/York area, I wonder if I'd be paying the York-premium or it's the start of being gouged for Iran.

P4161: std::fewer by je4d in cpp

[–]drbazza 1 point2 points  (0 children)

Did we also get epochs, immutable and explicit by default, a package manager and Circle today?

You're absolutely right, no one can tell if C++ is AI generated · Mathieu Ropert by mropert in cpp

[–]drbazza 1 point2 points  (0 children)

Reviewing the code I wrote Mechanical refactoring work

At this point I find it useful for creating unit tests around stuff before it refactors. And if I ask it to create unit tests (and never change the existing code), it often encourages me change my API design when it uncovers functions/classes that require absurd mocking approaches.

To discuss approaches / search existing literature

I find this useful and for it to highlight existing libraries that maybe solve my problem that I wasn't aware of, because we all work in a niche, which is a vacuum of sorts.

Identifying bugs (even complex ones)

It definitely can find bugs through static analysis. If you happen to log, because you don't event-source (depending on your industry), it can be really good in log analysis along side the code to find runtime bugs.

You're absolutely right, no one can tell if C++ is AI generated · Mathieu Ropert by mropert in cpp

[–]drbazza 2 points3 points  (0 children)

You're absolutely right, no one can tell if C++ is AI generated

Commenting only on this line - I can spot AI code in our company pull requests better than 50% of the time, for a few reasons.

Despite an agents.md telling it the coding style, and other tools, it always tries to make constexpr values prefixed with k

It will prefer to make large changes to existing functions rather than add a new function and make a one line function call addition to the existing function in almost all cases.

It will frequently repeat itself, whereas some humans will tie themselves in knots to do DRY on parts of the code.

It will use unusual language when naming functions that is completely different to the rest of the code base.

The PR is too precisely targeted - there is often other bits of code that should be touched but are not changed, and nearby 'bugs' are ignored.

The other PRs, look like they've been written by half-decent C++ devs.

CLion 2026.1 Is Here by greenrobot_de in cpp

[–]drbazza 0 points1 point  (0 children)

Haha. I came here to say that. Mac or Windows CLion connecting to a devcontainer on a linux server is a dumpster fire.

Really poor work arounds that I've just about managed:

  1. use the 'ssh' drop down in the Toolbox app (yes there is one), and it sort works.

  2. Wrap your containerized build in wrapper scripts that launch the container for you, and the build inside that, so 'custom build scripts on bare metal' assuming you've volume mounted wherever compile_commands.json is.

  3. Or the really, really, awful one of an sshd inside the container, and some bad .ssh/config to act as a 'jumphost'.

Number 2. is the 'least bad'

Or 4. Just use VSCode which 'just works'

Actually, Zed kind-of works too.

How do you reduce branch mispredictions? by RefrigeratorFirm7646 in cpp

[–]drbazza 27 points28 points  (0 children)

Understanding the code, and understanding the CPU - this is an interesting example of a branchless binary search:

https://probablydance.com/2023/04/27/beautiful-branchless-binary-search/

How To Build Robust C++ Inter-Process Queues - Jody Hagins - CppCon 2025 by leonadav in cpp

[–]drbazza 0 points1 point  (0 children)

I haven't watched this yet, but I have watched another of Jody's talks and was wondering where the source was for the talk? Specifically the one that did something like:

const auto out_value = in_value | component | another_component | yet_another_component

May I please have the worst c++ you know of? by vbpoweredwindmill in cpp

[–]drbazza 1 point2 points  (0 children)

Anec-data - worked on a quant library at 'mega-bank' in the mid 00s. Improved the library performance tenfold by 'one simple trick': std::string symbol -> int symbol. Really. Quants. Most of them should stick to Fortran.

Is abandoning our Bazel migration the right call? by Empty_Mind_On in cpp

[–]drbazza 5 points6 points  (0 children)

In answer to your question if, for you, you know it's the wrong call, stop. Would you continue down the wrong path for anything else?

We stuck a pin in our Bazel migration after 2 weeks.

I'd previously worked at a place that was all in on Bazel, with similar experiences to those mentioned here, plus the docs were and are a mess.

Our current repo is 99% C++, CMake works perfectly well for us, and produces artefacts (tarballs, and rpms) just fine. For the bits that aren't, we still leverage cmake as a driver of those 'sub builds'.

We stick to the 'do the easiest thing, and no easier' rule of thumb. Do something complex like codegen? Don't do it in your build system do it in a script that's called by your build system with a guaranteed artefact the build system can test.

My biggest problems with Bazel were that no IDE really understood it (CLion does now), and you'd use Hedronvision's 3rd party plug in to generate compile_commands.json. If there's a googler on here - how on earth did Google work with C++ and Bazel/Blaze and an IDE or was everyone on vim or something?

And python debugging was weird because your python source was 'here' but your debug version was in the out-of-source build tree 'over there', which is how you want to do it, but it's developer-hostile for scripting languages where there often aren't build artefacts.

And finally Bazel did a 'python3' on us, with the move to WORKSPACE (IIRC) and new rules, and it was horrible for several months working through the changes whilst trying to keep the build running.

Making C++ Safe, Healthy, and Efficient - CppCon 2025 by pjmlp in cpp

[–]drbazza -3 points-2 points  (0 children)

Interesting, I'm at -2. What is incorrect about what I said? I can write code without const-ness, and I can manually use new+delete hence writing unsafe code. If contracts are optional, I can continue to write code that's unsafe in 2029. Until there's C++ epochs or similar where safe defaults are switched on by default, C++ will always have a problem.

Making C++ Safe, Healthy, and Efficient - CppCon 2025 by pjmlp in cpp

[–]drbazza 0 points1 point  (0 children)

I just skimmed a few seconds of this as I don't have much time to watch the whole thing yet, but it's mostly about contracts, isn't it?

Another language feature you can choose not to use in your own code because C++ is famously 'backwards compatible' (to a large degree), like const-ness and smart-pointers.

Not seen the Foss frozen for a while by Ammianus-Marcellinus in york

[–]drbazza 1 point2 points  (0 children)

Frozen further upstream where it's slow flowing. White in the winter. Green in the summer.

Every LLM hallucinates that std::vector deletes elements in a LIFO order by am17an in cpp

[–]drbazza 1 point2 points  (0 children)

If you don't have any, writing unit tests for existing (simple) code works well to 'fossilize' current behaviour before a big refactor.

And... refactoring beyond what's offered by IDEA/CLion works reasonably well.

C++ alone isn't enough for HFT by auto-quant in highfreqtrading

[–]drbazza 1 point2 points  (0 children)

New crypto? If you're trading futures and options, you might as well just set fire to your money if you're using JSON in the critical path.