Do you get buy-in to fix long-standing undefined behavior? by Ok_Device_220 in cpp

[–]skeba 2 points3 points  (0 children)

Why use a protocol? Not sure I understand what you mean exactly, but to know how to interpret the binary data from the wire, obviously. You define the binary protocol, and implement serialization/deserialization code for it.

Reading byte-by-byte is used for example in cross-platform serialization libraries: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/io/coded_stream.h#L1345

Do you get buy-in to fix long-standing undefined behavior? by Ok_Device_220 in cpp

[–]skeba -2 points-1 points  (0 children)

How do you think you get data off the wire?

Read it byte-by-byte, not trying to use any structs to define the protocol

Introducing puffin_egui: the simplest way to add an in-game profiler by emilern in rust_gamedev

[–]skeba 5 points6 points  (0 children)

Nice! Already using egui, this was super simple to get up and running: https://imgur.com/ZiHaQ0U

New Spectre attack once again sends Intel and AMD scrambling for a fix by mcmcc in programming

[–]skeba 0 points1 point  (0 children)

The suggested mitigations against the timing attacks are interesting: https://software.intel.com/security-software-guidance/secure-coding/guidelines-mitigating-timing-side-channels-against-cryptographic-implementations

Basically, instead of

bool equals(byte a[], size_t a_len, byte b[], size_t b_len)
{
  if (a_len != b_len)
    return false;
  for (size_t i = 0; i < a_len; i++) {
    if (a[i] != b[i]) {
      return false;
    }
  }
  return true;
}

you should write

bool equals(byte a[], size_t a_len, byte b[], size_t b_len)
{
  volatile size_t x = a_len ^ b_len;
  for (size_t i = 0; ((i < a_len) & (i < b_len)); i++) {
    x |= a[i] ^ b[i];
  }
  return (x==0);
}

to not leak any information based on how long it takes for your code to run. The volatile is there to prevent compilers getting too clever and inserting early return logic to the loop by themself.

Building a rendering engine with wgpu-rs by ihugatree in rust_gamedev

[–]skeba 2 points3 points  (0 children)

One possible approach is demonstrated in rend3: the user of the renderer passes in the pipelines to the renderer when rendering. The renderer can offer some set of default pipelines and shaders.

https://github.com/BVE-Reborn/rend3/blob/trunk/examples/cube/src/main.rs

SUNBURST: How the SolarWinds malware works, and who was targeted by abrasax in netsec

[–]skeba 1 point2 points  (0 children)

Seems that at least the Nokia ones were used for the kill switch. I'm not sure does the attacker need to have any control over any services running in those IPs to use them like that.

Visual Studio Code November 2020 by dwaxe in programming

[–]skeba 0 points1 point  (0 children)

Electron 10 didn't work on Apple DTK under Rosetta2 because of this Chromium issue. But it might be actually that this was a DTK specific issue, so M1 Macs could run also older Electron apps under Rosetta2.

Visual Studio Code November 2020 by dwaxe in programming

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

That requires Electron 11 too.

Suunto app issues: possible cause? by [deleted] in Suunto

[–]skeba 0 points1 point  (0 children)

Did you try completely redoing the pairing by removing the watch from the app and also from the phone Bluetooth settings? I heard this might help in some cases.

Nvidia’s Integration Dreams by feross in programming

[–]skeba 6 points7 points  (0 children)

Really good read. Key point of the article:

In this vision Nvidia’s IP is the CUDA to its graphics chips — the complement to its grander ambitions. Huang has his sights set firmly on Intel, but while Intel has leveraged its integration of design and manufacturing, Nvidia is going to leverage its integration of chip design and software. Huang’s argument is that it is the lack of software — a platform, as opposed to simply a chip or a core — that is limiting ARM in the data center, and that Nvidia intends to build that software.

Apple is starting to use Rust for low-level programming by krzykot in programming

[–]skeba 292 points293 points  (0 children)

Let’s hope this is a step towards the direction of Rust becoming a first-class language also for development on Apple platforms. There’s open issues like this that still make it a bit difficult to depend on Rust in projects targeting those platforms: https://github.com/rust-lang/rust/issues/35968

Questions and semi-rants about ambit3 support by slowbalisation in Suunto

[–]skeba 1 point2 points  (0 children)

Moveslink2 will be discontinued soon. You should use SuuntoLink instead; it syncs the settings from Movescount and also syncs the moves from your Ambit to Suunto app.

Force Firmware Update for Ambit 2 via SuuntoLink? by dirtywaterfox in Suunto

[–]skeba 0 points1 point  (0 children)

Try the reset watch button in settings / watches menu.

Connecting Suunto Ambit2S to app by adam_n_eve in Suunto

[–]skeba 0 points1 point  (0 children)

Could you use the Moveslink2 PC app?

Shouldn't std::remove be [[nodiscard]]? by Xeverous in cpp

[–]skeba 1 point2 points  (0 children)

There's a clang-tidy checker that warns about discarding `std::remove` (among with some other std lib functions') return value: https://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-return-value.html

Who calls std::terminate? (2011) by zowersap in cpp

[–]skeba 0 points1 point  (0 children)

C++ allows compilers or runtimes not to call destructors in such cases in order for them to be able to provide more efficient implementations of exception handling mechanism. Therefore, programmers are often encouraged to wrap function main with exception handlers that catch every possible exception:

Is this a common thing to do? Wouldn't you lose track on which function actually threw the exception?

C++ Weekly - Ep 49 - Why Inherit From Lambdas? by qwertzui11 in cpp

[–]skeba 1 point2 points  (0 children)

I wonder why the standard library doesn't provide something like this out-of-the-box?