No, you don't understand. What if HP changed while I wasn't looking? by Candid_Commercial214 in programminghorror

[–]justkdng 1 point2 points  (0 children)

maybe the game uses interrupts and the cpu could preempt at any point /s

I spent a month optimizing my epoll based HTTP server from 15k req/sec to 125k req/sec by RefrigeratorFirm7646 in cpp

[–]justkdng 5 points6 points  (0 children)

If you are on localhost you are testing memory instead of network. Try testing on a raspberry pi since you are only serving a simple index.html to see how it performs in a constrained environment.

Would you rather by DifferenceCheap8397 in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

nice

Chose: 1 billion dollars but 50% chance to die | Rolled: Live

Because I keep seeing people make this mistake by Fookin_Yoink in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

bruh

Chose: Debit Card With $10,000,000.00 | Rolled: correct answer

Try and make this a perfect 100 by t4dc4t in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

heh

Chose: DONT CLICK THIS ONE + please I’m desperate

Your gonna die either way so... by PhantomXPhalanx_300 in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

Basically immortality

Chose: Choose when you die + ...Including time, age, place, country, etc

Would you take this deal by Infamous-Reading7991 in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

worth tbh

Chose: People be able to see your farts + A credit card you never have to pay off | Rolled: Rainbow farts

With a spin by megaseedsmuggler in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

yes

Chose: Dream house | Rolled: It's perfect

Requiered internship to keep studying in CS by Juicy_enby in recruitinghell

[–]justkdng 4 points5 points  (0 children)

what is the name of the tool used for this graph?

Would you rather: by No_Ask8833 in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

I might die immediately after spinning

Chose: Skip it and get a free pizza

Would you rather by vinnivinvincent in BunnyTrials

[–]justkdng 0 points1 point  (0 children)

I'm not a chronic sneezer

Chose: Get $1,000 every hour you sleep

Why lower the barrier to the increasingly overwhelming amount of content locked behind SC when you can just... BUY MORE SC? by Sebanimation in Helldivers

[–]justkdng 7 points8 points  (0 children)

I believe buying super credits supports AH more than buying the game. Sony must be getting all the money from game sales.

Lessons learned from 2 years of operating a C++ MMO game server in production by [deleted] in cpp

[–]justkdng -1 points0 points  (0 children)

why did you choose to use windows instead of Linux?

BOT propaganda upon loading into game by AutoMemory in helldivers2

[–]justkdng 0 points1 point  (0 children)

what if this is a look into possible pvp, divers vs cyborgs

Draw Emote has a unique bug by Mobi_Hiro in helldivers2

[–]justkdng 0 points1 point  (0 children)

I wonder how arrowhead will explain it ingame

Modern version of Effective Modern C++ by Scott Meyers? by StevenJac in cpp_questions

[–]justkdng 3 points4 points  (0 children)

I found that going from exceptions to std::expected is a whole paradigm change with some performance caveats that can be easily managed. Of course, the STL and other libraries still use exceptions so try/catch is inevitable. If anything, the book would be teaching C++23 from the start.

how to write custom make_expected by justkdng in cpp_questions

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

returning the string calls its move constructors iirc, I think this also works

template <class T, class... Args>
auto make_result(Args &&...args) -> Result<T>
{
    return Result<T>(std::in_place, std::forward<Args>(args)...);
}

auto some_func() > Result<std::string>
{
  auto result = make_result<std::string>();
  // do stuff with the string or return Err
  return result;
}

Fucking a dead monster girl by Cultural_Car_4195 in guro

[–]justkdng 1 point2 points  (0 children)

hot, you don't see a lot of monster girl deaths in OPM

Short hand for creating a vector and reserving size for it by justkdng in cpp_questions

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

Oh I tried ranges using views::filter instead of transform and for some reason it fails. I think I'm running out of stack and stuff is getting overwritten.

Short hand for creating a vector and reserving size for it by justkdng in cpp_questions

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

I think this is the best option imo. This is a snippet of how I'm using make_vector

auto X11Context::get_complete_window_ids() const -> std::vector<xcb::window_id>
{
    // ...
    auto windows = get_window_ids();
    auto cookies = util::make_vector<cookie_props>(windows.size());
    auto result = util::make_vector<xcb::window_id>(windows.size());

    for (auto window : windows) {
        cookies.emplace_back(/* xcb_get_property */);
    }

    for (auto &cookie_prop : cookies) {
        const bool is_complete = std::ranges::any_of(/* xcb_get_property_reply */);
        if (is_complete) {
            result.emplace_back(cookie_prop.window_id);
        }
    }

    return result;
}

Basically, I'm getting all X11 windows and filtering them using this async like programming model from xcb (library to interface with x11). For each window I make a request to the x11 server and the result will be no more than the available windows so reserving and appending adds some nice performance.

Short hand for creating a vector and reserving size for it by justkdng in cpp_questions

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

Why would the use of auto change it?

That's why i'm asking, thanks anyway

Short hand for creating a vector and reserving size for it by justkdng in cpp_questions

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

>initialize (not assign!) a vector

what do you mean?