Hacker Newsnew | past | comments | ask | show | jobs | submit | lang4d's commentslogin

Kalshi currently has the chances at 13% for full republican control of congress


clang-tidy has a check for this case


I'd be surprised if some combination of ASAN and UBSAN wouldn't catch this and similar dangling references


I thought it should too, but it doesn't seem to, unless I made a mistake, which I probably did: https://godbolt.org/z/Ex63vxj4r


I think you need to actually use the dangling reference: https://godbolt.org/z/f4s3fT3nM


Ah, that would make sense, yes. Thanks!


My go to for formatting would be clang-format, and for testing gtest. For more extensive formatting (that involves the compiler) clang-tidy goes a long way


I think you meant for more extensive static analysis. Clang-tidy is really awesome. There is also Facebook's Infer.

  https://fbinfer.com


Clang tidy does both: it can run clang's analyzer [0] (also available with clang++ --analyze or the scan-build wrapper script which provides nicer HTML-based output for complex problems found), has it's own lightweight code analysis checks but also has checks that are more about formatting and ensuring idiomatic code than it is about typical static analysis.

MVSC [1] and GCC [2] also have built-in static analyzers available via cl /analyze or g++ -fanalyzer these days.

There is also cppcheck [3], include-what-you-use [4] and a whole bunch more.

If you can, run all of them on your code.

[0] https://clang-analyzer.llvm.org/

[1] https://learn.microsoft.com/en-us/cpp/build/reference/analyz...

[2] https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.h...

[3] https://cppcheck.sourceforge.io/

[4] https://github.com/include-what-you-use/include-what-you-use


Do you save photos and messages somewhere?


Should this be 18446744073709551615.org? Is it common to use signed integers for timestamps?


Maybe just semantics, but I think I would call that prediction. Even if you have perfect perception (measuring the current state of the world perfectly), it's nontrivial to predict the future paths of other actors. The prediction problem requires intuition about what the other actors are thinking, how their plans influence each other, and how your plan influences them.


Waymo is also in competition with non AV ride sharing companies. They'll need to make it more cost effective and/or (continue to) deliver higher quality rides


They're in competition with the individual drivers, not with the ridesharing companies. The expensive part is owning the cars.


That would be one way to silence an unused variable warning


`git bisect run ...` Has been really nice for me when trying to find which which commit broke long running commands. It'll run atomically using the return code for good/bad determination.


It's all good and fun until your build command takes 30 minutes to run and you still need manual testing :(


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: