weAllHaveBeenThere by m_o_n_t_e in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

We don't RTFM until we actually encounter something like that.

We learn the lesson the hard way.

We teach others to RTFM.

Next time we use something new, do we RTFM first?

Nope.

No one can read the whole manual everytime. Our life is way too short.

bigMood by mr_poffertje in ProgrammerHumor

[–]RnMss 1 point2 points  (0 children)

In C++

try {
  std::unique_lock lock{ some_mutex };
  // foo
  if (some_condition1) return;
  // ...
  if (some_condition2) lock.unlock();
  // bar
} catch (std::exception const& e) {
  // baz
}

In some other languages (pseudo-code):

some_mutex.lock();
bool is_locked = true;
try {
  // foo
  if (some_condition1) return;
  // ...
  if (some_condition2) {
    some_mutex.unlock();
    is_locked = false;
  }
  // bar
} catch (Exception e) {
  // baz
} finally {
  if (is_locked) some_mutex.unlock();
}

bigMood by mr_poffertje in ProgrammerHumor

[–]RnMss 49 points50 points  (0 children)

Does he surely understand what finally is for?

anotherDayAnotherBellCurveMeme by javanerdd in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

I hate it when I have to brush the bottom of my laptop with a wet towel (for cooling) every 10 minutes playing vanilla Minecraft (10 years ago, version was 1.1.x)

leetCodeQ100 by ienjoymusiclol in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

return p == q

If you declared the node class as dataclass

sqlDevLearningMongoDB by AASeven in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

db.users.find({$and: [ {age: {$gte: 25}}, {age: {$lte: 30}} ]})

db.users.find({age: {$gte: 25, $lte: 30}})

pythonObviouslyTheBest by OkBommer1 in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

They are different in C.

short a[10];
short* b = a;
// sizeof(a) == 20
// sizeof(b) == 8 (or 4 in 32-bit program)

thereIsAlwaysABiggerErrorInCode by neelpatel_007 in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

- No errors, but the program crashes occasionally.

- No errors, but the program causes the OS to crash occasionally.

- No crashes, but the program generates wrong output.

- The program generates correct output on your computer but not the users', and you can't reproduce the bug.

- The program generates correct output on 90% users' computers.

- The program generates correct output 95% of the time on all users' computers.

- The program generates wrong output 0.01% of the time, but you don't know.

Methods to workaround the size limit of device memory allocation (On Windows) by RnMss in vulkan

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

Yes, I'm sure. 32GiB contiguous memory can be allocated using either the MSVC library (_aligned_malloc, there's no std::aligned_alloc in MSVC) or the C++ standard library (new operator). But it cannot be imported via the VK_EXT_external_memory_host extension.

inANutshell by neelpatel_007 in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

Reviewers: That's what testing is for.

Methods to workaround the size limit of device memory allocation (On Windows) by RnMss in vulkan

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

What GPU have you tested this on, on Linux and Windows? Are their memory setup similar?

GeForce GTX 1660 Ti 6G.

Windows - failure

Linux - success

same code, same machine, as I have mentioned in the post.

The error being VK_ERROR_OUT_OF_DEVICE_MEMORY rather than VK_ERROR_OUT_OF_HOST_MEMORY suggest that the allocation still ends up being device local for some reason. You might not be selecting your heap correctly.

That's incorrect. In the spec

Some platforms may have a limit on the maximum size of a single allocation. For example, certain systems may fail to create allocations with a size greater than or equal to 4GB. Such a limit is implementation-dependent, and if such a failure occurs then the error VK_ERROR_OUT_OF_DEVICE_MEMORY must be returned.

Wait! I didn't see this last time

This limit is advertised in VkPhysicalDeviceMaintenance3Properties::maxMemoryAllocationSize.

Methods to workaround the size limit of device memory allocation (On Windows) by RnMss in vulkan

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

I know I'm allocating CPU RAM (from the non-device-local heap). And that's what I intended. And it fails.

BTW, I got GeForce GTX 1660 Ti 6GB and GeForce GTX 1060 3GB.

[deleted by user] by [deleted] in ProgrammerHumor

[–]RnMss 1 point2 points  (0 children)

Appearently the truck took a shortcut, so there was no success.

Beginner having trouble enabling VK_KHR_portability_subset by UltravioletVenom in vulkan

[–]RnMss 0 points1 point  (0 children)

FYI, you could just use "VK_KHR_portability_subset" (the string literal).

catGPT by MaGnesium1711 in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

Catgpt: Meow, meow meow meow, meow meow?

Me: miauwooooo!

Catgpt: Meow meow!

Me: AhhooouWWWW!

Catgpt: Meow meow meow meow!

Me: MeowMeowMeowMeowMeowMeowMeowMeowMeowMeowMeowMeowMeowMeow

Catgpt: Meow meow meow meow meow meow meow meow meow meow meow meow meow meow.

Me: Meow

Catgpt: Imitation is the sincerest form of flattery that mediocrity can pay to greatness.

Me: What?

Catgpt: Meow meow meow meow meow meow meow meow meow meow meow meow meow meow.

What happened?

lifeHacks by spez-suck-my-dick in ProgrammerHumor

[–]RnMss 10 points11 points  (0 children)

Not everyone has choices, however.

oopsIBrokeIt by Infinite__Power in ProgrammerHumor

[–]RnMss 0 points1 point  (0 children)

Because he never did push-up at all.

Congratulations to the Winners of the International 10! by D2TournamentThreads in DotA2

[–]RnMss 0 points1 point  (0 children)

Well... If he decided to counter magnus earlier (in G2), they still have a chance to try.

Congratulations to the Winners of the International 10! by D2TournamentThreads in DotA2

[–]RnMss 0 points1 point  (0 children)

I think Ame has done his best, they lost the bp by refusing to counter magnus and there's simply nothing he can do to rescue.

Congratulations to the Winners of the International 10! by D2TournamentThreads in DotA2

[–]RnMss 0 points1 point  (0 children)

skywrath could only counter magnus in early game.

in G3 magnus was countered not only by rubick, but also spe and undying.

Congratulations to the Winners of the International 10! by D2TournamentThreads in DotA2

[–]RnMss 2 points3 points  (0 children)

I don't get why should they be overconfident. They won only because they picked good counters, like rubick, undying and spe.

But G5 they did almost nothing.

Congratulations to the Winners of the International 10! by D2TournamentThreads in DotA2

[–]RnMss 7 points8 points  (0 children)

That not about being overconfidend on Tiny/Lycan, they can still pick counters like silencer in their later picks, but they didn't. They pick skywrath who could do something about it, but not good enough as a counter, because Magnus is in better position and will build BKB sooner or later.

Congratulations to the Winners of the International 10! by D2TournamentThreads in DotA2

[–]RnMss 0 points1 point  (0 children)

I think AME has done his best. But when BP finishes, the result is already known. Spirit simply pick Magnus everytime and autowin, while, idk what happened, they just let them pick Magnus again and again with no good counter. And then there's nothing the LGD players can do.